NoSQL vs RDBMS
When starting a new project, often the first questions we will have to answer are about the technology behind the product. Our clients, rightfully, can be very specific about the technology with which their product is being built. They meet us and ask about our choices of Backend, UI and Database technologies. Very often the discussion centres around the topic of when to use a NoSQL database (such as MongoDB) versus an RDBMS (Relational Database Management System such as Postgres or SQL Server). This choice is incredibly important, and we want to ensure the correct choice is made for each project individually. To help facilitate the discussion there are five key factors we ask all our clients to consider:
- When you are dealing with data that is arranged in a tabular structure: A RDBMS is best suited for a tabular data such an accounting table or school grades. However if you are dealing with a more complex data structure with multi-level nesting and hierarchy, a NoSQL is usually your better option. The structure of your data is the most important factor to consider in the decision.
- When the data is unstructured, or Schema-less: In a RDBMS you need to have all the information about the final data model, data types, schemas, and relations in advanced. You also have to have it right the first time, or any modifications to the data model would slow down or even stop the database from functioning. Database administrators are very familiar with the hassles of migrating a database in production when new changes to the model arrives.
- When the store needs to be easily scalable: NoSQL databases are usually very easy to scale horizontally. Horizontal scalability means you can add new servers and data storage to your distributed system. That’s where in an RDBMS, a system’s capacity is only enhanced vertically when you add to your CPU cores, your RAM or Hard Disk.
- When performance is a key metric: when it comes to big data processing and representations, NoSQL works much faster than an RDBMS. So whenever the client needs to deal with huge data and process or represent data in real-time, NoSQL is usually a better option.
- When an iteration on the idea needs to happen fast: With the idea of Lean Startup, most small startups need to build upon their initial idea, maybe start collecting data and change the model to react to the market requirements quickly when needed. For the reasons mentioned above in bullet point one, a NoSQL database where you do not need to close your data model design first thing in the development process works much better.