What is this? This is just something to summarize the mistakes that I found from my experience
as a Software Engineer.
The first one that I want to talk about is the war between SQL and NoSQL. This is one of my favorite
topic. I can debate about this topic for a whole day. 😁
It doesn’t mean I hate NoSQL. I just want to use the right tool for the right job…
This may be true at this time but who knows what will
change in the future? I have faced a lot of problems with the design of NoSQL, especially when it is
the main backing service for the whole system. Each database has its own strength and weakness and
we should use it for the most suitable job or at least, pick the one that can solve 80% of your
problems and live with the other 20% pain instead of choosing the one that fits for 20% use cases
and fix the problem that it brings to the other 80%.
By NoSQL, I mean Document database systems (Mongo DB for example)
A real life loop
Back in the 1970s, the most popular database used a simple data model called the hierarchical model,
which is similar to JSON model used in document databases today. That model worked well for
one-to-many relationships. However, when it comes to
many-to-many relationships, this design exposes a whole lot of problems, from joining issue to
duplicate data management. Two alternative solutions were proposed, Relational model
and Network model. The fact is obvious, Relational model wins the long run.
It seems that NoSQL
databases today are repeating the problems in the history, which have been solved for decades.
Despite the advantages of a more flexible data schema or a better representation of
data (which is more similar to objects in programming language), the 1970s’ problems still exist and
developers still have to handle them manually in an awkward way.
Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems