@sargonpiraev

Database

A database is an organized system for storing, retrieving, and changing data. The important part is not only that it stores data, but that it gives the application a model for querying, consistency, durability, and coordination.

Different databases optimize for different access patterns. A relational database, a search engine, a key-value store, and a columnar analytical database all store data, but they make different tradeoffs around schema, latency, transactions, indexing, and scale.

Types of databases

Theory

Systems

  • Postgres — relational database.
  • Redis — in-memory data store often used for caching, queues, and coordination.
  • Qdrant — vector database for similarity search.
  • Pinecone — managed vector database.

Questions to ask

  • What access pattern is this database optimized for?
  • Does the system need transactions, search, analytics, caching, or relationship traversal?
  • Which invariants belong in the database, and which belong in the application?
  • What becomes expensive as the dataset grows?