Sobes.tech
Senior

How does a relational database differ from a non-relational one?

sobes.tech AI

Answer from AI

A relational database (RDB) organizes data into tables with well-defined schemas, where rows are records and columns are fields with data types. Main characteristics:

  • Uses SQL for queries.
  • Supports transactions with ACID properties.
  • Schema is fixed and strictly typed.

A non-relational database (NoSQL) can store data in various formats: documents, key-value, graphs, column stores. Features:

  • Flexible or absent schema.
  • Easier horizontal scaling.
  • May sacrifice consistency for performance (BASE instead of ACID).

Example: MongoDB — document-oriented NoSQL DB, PostgreSQL — relational.

The choice depends on data structure requirements, scalability, and consistency.