4.7_database_alternatives - MartijnKeesmaat/dating-app GitHub Wiki

What is a database

A structured set of data held in a computer, especially one that is accessible in various ways. -- https://www.dictionary.com/

Visualizing databases

Database management systems aren't typically good at visualizing data. That's were entity relations diagrams

Entity relations diagrams

Terms

  • Each table is called an entity.
  • Colom categories are called attributes
  • The connections between your tables are called relations

What databases are there?

SQL/Relational databases

Store data according to a schema that allows data to be displayed as tables with rows and columns. Think of a relational database as a collection of tables, each with a schema that represents the fixed attributes and data types that the items in the table will have. It provides functionality for reading, creating, updating, and deleting data, typically by means of Structured Query Language (SQL) statements. The tables in a relational database have keys associated with them, which are used to identify specific columns or rows of a table and facilitate faster access to a particular table, row, or column of interest.

Advantages

  • Relational databases are well-documented and mature technologies, and RDBMS are sold and maintained by a number of established corporations.
  • SQL standards are well-defined and commonly accepted.
  • A large pool of qualified developers has experience with SQL and RDBMS.
  • All RDBMS is ACID-compliant, meaning they satisfy the requirements of Atomicity, Consistency, Isolation, and Durability.

Disadvantages

  • RDBMSes donโ€™t work well โ€” or at all โ€” with unstructured or semi-structured data, due to schema and type constraints. This makes them ill-suited for large analytics or IoT event loads.
  • The tables in your relational database will not necessarily map one-to-one with an object or class representing the same data.
  • When migrating one RDBMS to another, schemas and types must generally be identical between the source and destination tables for migration to work (schema constraint). For many of the same reasons, extremely complex datasets or those containing variable-length records are generally difficult to handle with an RDBMS schema.

NoSQL non-relational

NoSQL databases emerged as a popular alternative to relational databases as web applications became increasingly complex. NoSQL/Non-relational databases can take a variety of forms. However, the critical difference between NoSQL and relational databases is that RDBMS schemas rigidly define how all data inserted into the database must be typed and composed, whereas NoSQL databases can be schema agnostic, allowing unstructured and semi-structured data to be stored and manipulated.

Advantages

  • Schema-free data models are more flexible and easier to administer.
  • NoSQL databases are generally more horizontally scalable and fault-tolerant.
  • Data can easily be distributed across different nodes. To improve availability and/or partition tolerance, you can choose that data on some nodes be "eventually consistent".

Disadvantages

  • NoSQL databases are generally less widely adopted and mature than RDBMS solutions, so specific expertise is often required.
  • There is a range of formats and constraints specific to each database type.

Popularity

It's no longer just a battle between monolithic relational database vendors. In fact, the popularity of non-relational databases is on the rise, more than doubling over the last 5 years; however, only one (MongoDB) is in the top 5 overall (Relational and Non-Relational combined).

Comparison by @Alooma

Popular Relational and Non-relational databases

Overview by @Alooma

MongoDB

Is a scalable NoSQL database. As Fons said in his guest lecture: NoSQL is easier for this project. It uses a less complex data model for beginners and is more common to what we are used to. I'm not sure why MongoDB has been chosen. Maybe because it is one of the most popular databases.

Sources