Skip to content

Article · 8 min read · Oct 31, 2026

Types of databases: what each one is for, and which ones a business needs

There are nine common types of databases: relational, document, key-value, wide-column, graph, time-series, search, vector and columnar analytical. Each solves one kind of problem well, but most companies of 20 to 200 people need one relational database, often PostgreSQL, and a cache or a reporting store only when a measured problem appears. This guide is for business and technical leaders deciding what to add to their stack.

Farzan AnsariCofounder and CTO

Key takeaways

  • Nine database types exist because workloads differ: transactions, lookups by key, relationships, time series, text search, similarity search and large-scale reporting each favor a different design.
  • A relational database should hold your system of record, the data your business cannot afford to get wrong.
  • PostgreSQL features and extensions cover document, text search, vector, geospatial and time-series needs at small scale, so a second database is often unnecessary.
  • Every added database brings backups, security, monitoring and a person who understands it, so each one needs a named reason and owner.
  • Specialized databases and sharding pay off at real scale: Discord moved its messages to a Cassandra-compatible store, Notion sharded Postgres, and both run enormous data volumes.

"What database should we use?" sounds like one question and is really nine. Databases come in types because the jobs differ: recording a payment safely, fetching one record in a millisecond, tracing who is connected to whom, searching text, or summing a billion rows for a board report. Knowing the types lets a non-specialist follow a technical proposal and ask whether a new database is needed at all.

What are the main types of databases?

The nine types below cover almost everything a company will meet. The table gives the main strength of each, well-known products, a typical business use and, most useful, when to avoid it. The product names come from the ranking in the 2026 Stack Overflow Developer Survey and the vendors' own documentation.

TypeGood forPopular productsTypical business useWhen not to use it
RelationalStructured records with relationships and rules; transactionsPostgreSQL, MySQL, SQL Server, Oracle, SQLiteOrders, invoices, customers, inventory, anything finance auditsExtremely high write volume on simple lookups, or data that is mostly free-form
DocumentSelf-contained records whose fields varyMongoDBProduct catalogs with varying attributes, content, user profilesWhen records link to each other and need multi-record rules
Key-valueVery fast lookup by a single keyRedis, DynamoDBCaching, sessions, shopping carts, rate limitingWhen you need to ask questions across many records
Wide-columnHuge write volumes spread over many serversApache Cassandra, ScyllaDBMessage history, event logs, device data at very large scaleSmall data, or any need for flexible ad hoc queries
GraphQuestions about connections between thingsNeo4jFraud rings, recommendations, network and dependency mappingData that is mostly records rather than relationships
Time-seriesMeasurements ordered by timeInfluxDB, TimescaleDBSensor readings, system metrics, usage telemetryGeneral business records with no time-ordered stream
SearchFull-text and relevance-ranked searchElasticsearchSite and document search, log searchAs the system of record, since it is built for searching copies of data
VectorFinding items similar in meaningpgvector, Elasticsearch, RedisAI document search and recommendationsExact-match lookups, or small collections that fit in a prompt
Columnar analyticalScanning and summing huge tables fastClickHouseReporting and analytics across years of dataLive transactions that read and write single rows

Products overlap. Redis describes itself as an in-memory data store used as a cache, vector database, document database, streaming engine and message broker, and Elasticsearch now stores vector data too. Treat the types as jobs, because one product may do several.

When is a relational database the right choice?

Almost always, for the data that runs the business. A relational database stores data in tables linked by keys and queried with SQL. It enforces rules such as "every invoice has a customer" and keeps groups of changes all-or-nothing. The PostgreSQL project says its database has been ACID-compliant since 2001, and it supports document, key-value and other data types inside the same system.

It is also the safest choice for people. In the Stack Overflow survey, PostgreSQL ranked first at 57.9%, followed by SQLite at 42.1% and MySQL at 35.1%. Engineers who know these systems are easy to find, and nearly every business tool can connect to them. Our guide to SQL vs NoSQL covers the decision in more depth.

What are document and key-value databases good for?

A document database stores each record as a self-contained document. MongoDB's guidance is that data accessed together should be stored together, and that documents in one collection need not share the same fields. That suits content and catalogs where each item has its own shape.

A key-value database stores a value against a unique key, much like a very fast filing cabinet where you must know the label. AWS describes the key as the unique identifier for each value. Redis keeps data in memory, which is why teams use it as a cache that spares the main database from repeated reads. DynamoDB is the key-value service most AWS shops meet.

Both types are weak at questions you did not plan for. If finance asks for margin by region and customer segment, a key-value store cannot answer without exporting the data somewhere else.

When do wide-column, graph and time-series databases make sense?

These three solve narrower problems, and most companies of 20 to 200 people will never need one.

Wide-column databases such as Apache Cassandra spread data across many servers. Cassandra describes itself as a NoSQL distributed database with a masterless architecture, where a partition key distributes data among nodes. Discord is a published example. Its engineering blog (March 6, 2023) says it ran 12 Cassandra nodes in 2017 storing billions of messages and 177 nodes by early 2022 storing trillions, then moved to ScyllaDB, a Cassandra-compatible database, which brought the cluster to 72 nodes. The same post lists the costs of running Cassandra at that size: hot partitions, garbage collection pauses and compaction backlogs.

Graph databases store connections directly. Neo4j explains that its graphs hold nodes, relationships and properties, and that they do not use JOINs. They fit questions like "which accounts share a phone number, an address and a device." They are a poor fit when your data is mostly records and few questions concern the links.

Time-series databases handle measurements stamped with time. InfluxData says InfluxDB 3 Core is purpose-built for real-time data monitoring and recent data, and Tiger Data documents TimescaleDB with hypertables for time-series data. Machine sensors, application metrics and usage telemetry are the typical loads.

What do search, vector and columnar analytical databases do?

Search databases make large amounts of text findable. Elastic describes Elasticsearch as an open source, distributed search and analytics engine, and its documentation says a stored document becomes searchable in near real time, within 1 second. Use one to power site search or search across large document sets, and keep the original data in a system of record.

Vector databases store numeric representations of meaning, called embeddings, so that software can find content similar in meaning rather than matching exact words. This is the retrieval step behind most AI knowledge assistants. The pgvector extension adds vector types to PostgreSQL and performs exact nearest-neighbor search by default. Adding an HNSW or IVFFlat index switches to approximate search that trades some recall for speed. Our guide to RAG vs fine-tuning explains where this fits.

Columnar analytical databases store each column's values together, so a query that sums one column over millions of rows reads far less data. ClickHouse describes itself as a column-oriented SQL database for online analytical processing, and notes that the layout makes it harder to restore single rows. That trade-off defines the type: excellent for reporting, wrong for the live application.

Can PostgreSQL replace several of these databases?

At small and moderate scale, often yes. PostgreSQL is built to be extended: the CREATE EXTENSION command loads new data types, functions, operators and index support into a database. That is why one Postgres server can cover several jobs from the table above.

NeedWhat PostgreSQL offers
Document datajsonb columns with indexing, built in
Text searchBuilt-in full text search with ranking by relevance
Vector searchThe pgvector extension, with HNSW and IVFFlat indexes
Location dataPostGIS extends PostgreSQL for location-based data
Time-seriesTimescaleDB, which describes itself as a time-series database built on Postgres

Extensions must be supported by your host, so check your managed provider's extension list before relying on one. Scale limits also apply. pgvector, for instance, can index vectors of up to 2,000 dimensions, and extension performance at very large volumes differs from purpose-built systems. For graph, wide-column and columnar analytical workloads, a dedicated system is usually the better answer once data is large.

The practical advice: resist adding a new database. Each one means another bill, another backup plan, another set of credentials, another upgrade schedule and another person who has to understand it. Add one when you can show that the database you have cannot meet a measured need.

How many databases should a 20 to 200 person company run?

Fewer than the architecture diagrams suggest. A relational system of record handles most of the load. A cache is the most common addition, followed by a search index or reporting store if a real need appears.

Illustrative example: A 70-person logistics company is told it needs a document database for shipment records, a graph database for route planning, a search engine for the customer portal and a vector database for an AI assistant. Four new systems would mean four more things to secure, back up and staff. The team reviews the actual needs instead. Shipments fit tables and need transactions, so they stay in PostgreSQL. Portal search covers a few hundred thousand records, which built-in full text search handles. The AI assistant searches a few thousand documents, which pgvector handles. Route planning uses a specialized solver and needs no database change. They run one database, plus a cache after page load times are measured.

Real companies at huge scale choose differently, because their numbers differ. Notion's engineering team wrote in October 2021 that it split its Postgres data into 480 logical shards across 32 physical databases. It stayed on one database family and spread the load. Discord moved to a database built for its message volume. Both decisions followed measured limits at very large size.

How do you choose a type of database?

  1. Name the workload. Is it recording transactions, looking up by key, searching text, finding similar items or analyzing history?
  2. Default to relational for the system of record.
  3. Check whether a PostgreSQL feature covers the need at your data volume.
  4. Measure before adding. Run the real queries on realistic data and write down the number that failed.
  5. Name an owner and a recovery plan for every database you add, including how it is backed up and who is called when it breaks.

How Kastling approaches database choices

Choosing and connecting databases is part of the design work in Custom Solutions, alongside internal tools, dashboards and portals. Kastling would start with the work the system supports and the records it must keep correct, connect the systems already in use, and pick the smallest set of databases that meets the need. Each added database would have a named owner, and success would be agreed in measurable terms. For the migration side, see our guide to moving a legacy application to the cloud.

Questions

What is the difference between a database and a data warehouse?

A database runs the live application: it records each order, update and login as it happens. A data warehouse holds copies of data from many systems, organized for reporting and analysis across long periods. Most columnar analytical systems act as the engine of a warehouse. Running heavy reports directly on the live database is the usual reason companies add one.

Is Excel or SharePoint a database?

They store data, but they lack what a database provides: enforced rules, safe simultaneous edits by many users, transactions and reliable queries across related tables. A spreadsheet is a good place to start a process and a poor system of record once several people and systems depend on it.

Do AI projects need a vector database?

Only when the AI searches company documents by meaning, as in a retrieval system. Even then, a vector extension on the database you already run is often enough at modest document volumes. See our guide to RAG, fine-tuning and prompting for when retrieval is the right design.

What does a managed database mean?

A cloud provider such as AWS or Azure runs the servers, backups, patching and failover for you, and you pay for the service. It removes much of the operational work and does not remove the need to choose the right type of database or to design the data well.

Sources

  1. PostgreSQL: About
  2. AWS: What is NoSQL?
  3. Stack Overflow Developer Survey 2026: Technology
  4. MongoDB Manual: Data Modeling Introduction
  5. Redis documentation: Get started with Redis Open Source
  6. Apache Cassandra: Cassandra basics
  7. Discord: How Discord Stores Trillions of Messages
  8. Neo4j: What is a graph database?
  9. InfluxData: Get started with InfluxDB 3 Core
  10. Tiger Data (TimescaleDB): Use Tiger Data documentation
  11. Elastic: Elasticsearch
  12. Elastic: Near real-time search
  13. PostgreSQL 18 documentation: Full text search introduction
  14. pgvector: Open-source vector similarity search for Postgres
  15. ClickHouse: What is ClickHouse?
  16. PostgreSQL 18 documentation: CREATE EXTENSION
  17. Notion: Herding elephants, sharding Postgres at Notion
  18. Tiger Data: TimescaleDB
  19. PostGIS

Guide · 15 min read

Build, buy or integrate: deciding on custom business softwareBuy software for standard processes, integrate when your existing systems already hold the data, and build only where the process sets you apart. Companies of 20 to 200 people usually end up with a hybrid: buy the core system of record, then integrate or build the edges around it. Compare the options on 3 to 5 year total cost of ownership, not on the first invoice.Read

Article · 8 min read

Rust vs TypeScript: when to use eachTypeScript is the right default for web applications, APIs and business software because of its hiring pool, speed of change and ecosystem. Rust earns its higher cost in CPU-heavy paths, latency-critical services, embedded and edge work, and anywhere memory safety and predictable performance matter. The two are often combined, and this guide is for owners and technical leads at companies of 20 to 200 people deciding what to build in.Read

Article · 8 min read

Sentry vs PostHog: which one does your team need?Sentry is built for developers who find and fix errors and performance problems, and PostHog is built for product teams who need to understand user behavior through analytics, session replay, feature flags and experiments. Each has moved into the other's territory: PostHog now offers error tracking and Sentry offers session replay. This guide is for technical leads and product owners choosing monitoring for a web application, and for small teams deciding whether one tool is enough.Read

One useful email a month.

New guides, tools and practical notes on putting AI to work. No sales sequences.

See how an idea becomes a working solution.

Explore how we scope, build and hand over AI projects, with clear decisions at each stage.