How to design non-relational databases

Laptop

Each type of NoSQL has its own peculiarities. I will focus on Key-Value as the most common non-relational database. Moreover, this database is used in one of my projects, namely DynamoDB. Its choice, like any other database, can hardly be called rational. The final decision is influenced by many factors: from business requirements to customer preferences. However, this does not negate attempts to make a conscious project evaluation.

How do you know if you need a non-relational database?

  • The project has a large dataset. When you have more than 1 TB of data and its index does not fit in RAM, it is better to abandon the relational model.
  • High update speed. If you need more than 100 KUps, choose NoSQL.
  • Availability. A non-relational database can have a fixed latency of 2 ms and provide high read and ping speeds, as well as no locks. In SQL, this is possible only on small datasets.
  • Stable access pattern. NoSQL is ideal for business applications where clear access patterns can be identified. These can be queries that do not change or change slowly. For example, a list of certain products in an online store.
  • Accounting prevails over analysis. This is the OLTP approach mentioned above, which is associated with access patterns.

After choosing the right type of database, proceed to design. In the case of NoSQL, we are limited in the ways we can access data. Therefore, you need to customize the model for frequent and important queries. To do this, analyze the Use Cases and all product requirements in detail. This way, you will be able to correctly assess how to look at your data. This will form the basis of the future data structure.