![]() One of the reasons why RDBMS became so good at handling transactions is exactly because of the limitation of its data model: Does make sense to store an order if there are no items in it? Still, I’m forced to create a transaction to save this “single unity” spread between at least two tables: ORDER and ORDER_ITEM. All RDBMS nowadays already have many optimizations for the scenario above, but modeling the data the way we have been doing for the last 30 years is definitely suboptimal. In a real-world scenario, users are often also associated with many other entities, which will make this scenario even worse and force developers to decide which relationships should be lazy or eager. We are all familiar with the cost of a JOIN operation in an RDBMS at scale: If you have 1 Million users with 10 preferences each, then in order to bring this user back to the memory, assuming that you are using an ORM framework ( Object-Relational Mapping ) you will need to make a join with a table of USER_PREFERENCES with 10 million rows. Modeling Data: RDBMS and Document Databases If you don’t have time to read the whole article, I will summarize the most important findings in the conclusion. In this article, I would like to address the key differences and use cases. However, I have seen many people inadvertently featuring Postgres 11 as “The New NoSQL” or that they don’t need any NoSQL database as they are already using Postgres. In my personal opinion, it will help developers to be more familiar with all the advantages of storing data as JSON instead of plain old tables. Postgres has been my favorite RDBMS for years, and I’m thrilled with the increasing popularity of its JSONB support. ![]() The reality is that databases are converging, and in the last few years, it is becoming even more difficult to point what are the best scenarios for each datastore without a deep understanding of how things work under the hood. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |