Sobes.tech
Junior — Middle

Explain what non-relational databases are and how they differ from relational ones?

sobes.tech AI

Answer from AI

Non-relational databases (NoSQL) are data storage systems that do not use the traditional relational model with tables and relationships. They differ from relational databases (SQL) in the following features:

  • Data structure: NoSQL can store data as documents (JSON, BSON), key-value pairs, graphs, or columns, rather than in tables.
  • Schema flexibility: NoSQL often does not require a rigid schema, which is convenient for dynamically changing data.
  • Scalability: NoSQL databases generally scale better horizontally, which is important for large volumes of data.
  • Transactions: Relational databases support ACID transactions, while NoSQL often sacrifices this for performance and scalability.

Example: MongoDB is a document-oriented NoSQL database, unlike PostgreSQL, which is a relational database.

Thus, the choice depends on requirements for data structure, scalability, and consistency.