Using Postgres with Deno
Learn when to use SQL in our application.
We'll cover the following...
SQL and No SQL databases have their pros and cons. Choosing one over the other depends on many factors and is still a subjective decision since, in theory, both can do the same job.
Pros and Cons of SQL Databases
Pros | Cons |
Data integrity semantics: By implementing the ACID properties, data stored in SQL databases is highly reliable. | Rigid data models: This is one of the most obvious disadvantages of SQL databases. Having a fixed data model (schema) can be problematic in the cases when the model gets updated frequently. |
SQL queries: Since the SQL query is mature and well maintained, it’s highly flexible and optimized. SQL queries tend to be easy to construct and maintain. | Limited horizontal scalability: Many SQL databases don’t have simple support for horizontal scalability. Depending on our application size and usage, it could be problematic, but it can be solved. |
Data optimization: Another advantage linked to the maturity and simplicity of SQL databases is the low memory usage that makes these databases highly performant. |
Use case
A common use case for SQL databases is user management, since this kind of database is rigid and ensures high availability of data. The rigidity of data models shouldn’t be an issue since a user model tends to be stable.
We can, of course, use a NoSQL database for this use case. It’s up to us ...