4. How to pick your database

One of the most asked questions for system design is – “Which storage mechanism/database you will pick for the problem?”

If you are going to answer that I know X database. Hence, I would like to go with X, it would be the WRONG answer.

Neither you should be talking in terms of any database brand/name. Infact the correct way is to talk about the type of database. Eg: Relational, document, graph etc.

Now, the question comes of how one can pick the database. So, here is a short summary which can help you to take a decision:

SchemaSchemaless or strict Schema
TypeWhat problem are we solving and what type of database is it?
TransactionIs transaction integrity required or not?
PerformanceHow is the performance of the DB for Read and Write operations
ScalabilityIs the database scalable and what would be the cost of it? Eg: Mongo, MySQL or Postgres supports scalability by DB partitioning and sharding
OpensourceIs the database open-source vendor locked? MySQL is OS, and Aurora or DynamoDB are vendor-locked (AWS)
USPWhat is the unique feature of the database? Eg: Document-based DBs are more straightforward to scale due to sharding, and Aurora is highly performant.
How you talk to DBWhich programming language is a database using. Eg: Relation MySQL uses SQL.

Leave a Reply