Sobes.tech
Middle

What is a relational database? How does it differ from a columnar database? What types of databases do you know?

sobes.tech AI

Answer from AI

A relational database (RDB) is a database management system where data is stored in the form of tables (relations), consisting of rows and columns. Each table has a unique key, and relationships between tables are implemented through foreign keys. The main properties of RDBs are data integrity, support for transactions, and the ability to perform complex queries using SQL.

A columnar database stores data not row-wise, but by columns. This is optimal for analytical tasks where data often needs to be aggregated by certain columns, as reading and compressing data is more efficient. Unlike relational databases, columnar DBs are less effective for operations with individual records and transactions.

Types of databases:

  • Relational (PostgreSQL, MySQL, Oracle)
  • Columnar (ClickHouse, Apache Cassandra)
  • Document-oriented (MongoDB, CouchDB)
  • Key-value (Redis, Riak)
  • Graph (Neo4j, JanusGraph)
  • Time series (InfluxDB, TimescaleDB)

The choice depends on the task: relational are suitable for classic business applications, columnar — for analytics and BI.

What is a relational database? How does it differ… - sobes.tech