How to choose the right database for your project?
Steps involved in choosing a database when building a project from scratch

passionate programmer
Search for a command to run...
Steps involved in choosing a database when building a project from scratch

passionate programmer
No comments yet. Be the first to comment.
👋 I'd like to share a small side project I’ve been working on: collector.dev — a Chrome extension that turns your plain old New Tab into a smart little launchpad. It brings your essential tools front and center, so you spend less time hunting and mo...

Best practices to ensure your server is secure and up to date
It's been a long time since I have built something small, stupid, and fun. I'm planning to build a newsletter service for engineers that aggregates the data from popular engineering blogs and articles and gives a curated list of weekly updates. If yo...

I'm tired of hearing these arguments about how X web framework is bad or it won't scale because they are at the bottom of benchmark rankings and why you shouldn't pick for your project. When asked to justify, the common reply you will get is 'Oh it p...

Choosing the right database is one of the most important decisions you have to make when starting a new project. It should be the first building block when deciding on the tech stack.
Nowadays, you have a lot of choices than the usual RDBMS (MySQL or Postgres) which are great and tend to solve most of the problems but you should understand the advantages and disadvantages of different technologies. So down the line, you don't regret making a wrong choice.
The article aims to give you a framework/process for choosing a database instead of exploring technologies and comparing them.
The following steps can help you identify the right database:
You can't think of deciding on a database without knowing the use cases.
The following criteria can help:
Try to understand and roughly visualize how you will define the data models for the given use cases. It's an important step to help identify potential problems.
It will be an exercise heavily dependent on your experience, so don't forget to brainstorm with your team members.
For example, you can try to define approaches for the most critical features or stories and build on top of it.
You have identified the use cases and roughly figured out some approaches. Now you are in a much better position to answer 'What are the things you expect from your database?' and potential problems related to scaling, performance, maintenance, etc.
It can include the technical requirements such as
and business requirement
Something like the below image is a gist of what we wanted from the database.
You can define it more specifically to your needs and add criticality levels (Severe, High, Medium, Low) as well.
Now that we have a clear idea of what to expect from our database and the use cases. We can start exploring the database, considering the factors we have defined above.
Tip: You can take the help of DB Engine it keeps a list of most of the databases according to their type and also has a popularity index which can be helpful in some cases.

You can create a decision matrix of the factors and databases. It can help easily distinguish the advantages and disadvantages among databases.
The decision matrix should help you outline the benefits of one over another. You can brainstorm with your team members and project members and conclude.
Some tips you can that can help
It's critical to understand where the comfort of your team lies. You should thoroughly understand the implications of adopting a new database and the problems it solves.
Good development practices are a must. A poor data model and query won't scale well irrespective of the database. Always make sure that the models you define and queries are optimized.
Performance and scaling metrics are highly dependent on your use case and database design. Try to take benchmarks with a pinch of salt.