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:
Schema | Schemaless or strict Schema |
---|---|
Type | What problem are we solving and what type of database is it? |
Transaction | Is transaction integrity required or not? |
Performance | How is the performance of the DB for Read and Write operations |
Scalability | Is the database scalable and what would be the cost of it? Eg: Mongo, MySQL or Postgres supports scalability by DB partitioning and sharding |
Opensource | Is the database open-source vendor locked? MySQL is OS, and Aurora or DynamoDB are vendor-locked (AWS) |
USP | What 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 DB | Which programming language is a database using. Eg: Relation MySQL uses SQL. |