DeployCloud

Architecture · Reference

Database selection, five models sorted honestly

Relational, document, key-value, edge/SQLite and vector databases each optimise for a different shape of data and a different failure mode. The ledger below sorts and filters on consistency, strengths, where each one hurts, and how hard it is to migrate away from later — including an honest answer for when the "boring" relational choice is correct, which is most of the time.

The honest default

Start relational, and require a reason to leave

Most application data has entities that relate to each other — users have orders, orders have line items, posts have comments. That shape is exactly what relational databases were built for.

PostgreSQL in particular has become a reasonable one-database-does-most-of-it default: it handles strictly relational data, semi-structured JSON documents (via its native jsonb type), full-text search, and — via the widely-used pgvector extension — vector similarity search, all inside one system you already know how to operate, back up and migrate. That consolidation matters: every additional database type in your stack is another thing to secure, monitor, back up and staff for. The other four rows in the ledger below are genuinely useful, but each is a deliberate trade of that simplicity for a specific capability — read the "where it hurts" column before reaching for one on a hunch.

The ledger

Five models, sorted your way

Click any column to sort; type to filter. "Migration difficulty" means the effort to move away later, not the effort to adopt it today.

TypeConsistency modelWhat it's good atWhere it hurtsMigration difficulty
Relational (PostgreSQL, MySQL)Strong, ACID transactions across rows and tables by defaultRelated, structured data; complex joins; anything needing transactional integrity (payments, inventory counts)Very high write throughput sharded across many independent nodes; deeply nested, wildly variable-shape recordsModerate — schema migrations are a decades-old, well-tooled discipline (versioned, reviewable, reversible)
Document (MongoDB)Strong on single-document operations; tunable read/write concerns across documentsRecords whose shape varies a lot between entries; content catalogs; rapid schema iteration during early developmentEnforcing integrity or complex joins across collections — that logic moves into application code instead of the databaseLow to add new fields day-to-day; harder to retroactively enforce or migrate structure across existing documents
Key-value (Redis, DynamoDB, Workers KV)Simple point lookups are typically strongly consistent per key; DynamoDB offers tunable eventual or strong readsExtremely fast reads/writes by a known key — caching, sessions, feature flags, rate-limit countersAny query by something other than the key — no joins, no ad-hoc filtering without a secondary index designed in advanceLow structurally (no schema to migrate) but access patterns must be designed up front, especially on DynamoDB
Edge / SQLite (Cloudflare D1, Turso)Standard SQLite semantics; single primary writer per database, with read replicas available on some platformsColocating data with edge compute; small-to-medium relational workloads that benefit from low operational overheadVery high write concurrency against one database, or datasets much larger than a single SQLite file is comfortable withFamiliar SQL migrations; Cloudflare documents point-in-time recovery for D1 to any minute within the last 30 days
Vector (pgvector, Pinecone, Vectorize)Typically eventually consistent for index updates in dedicated vector databasesSimilarity/semantic search over embeddings — RAG, recommendations, "find things like this"Exact-match transactional workloads and relational integrity — it answers a fundamentally different question than SQLA genuinely new discipline (embeddings need regenerating when the model changes); pgvector keeps it inside a familiar Postgres migration workflow

No benchmark or throughput column on purpose — see the FAQ for why, and the sources ledger for each vendor's own current, verifiable numbers.

A distinction worth keeping

"NoSQL" is not one thing — document, key-value and vector solve different problems

Grouping MongoDB, Redis and Pinecone together as "NoSQL" hides more than it reveals; each rejects a different part of the relational model for a different reason.

A document database rejects a fixed schema — every record can look different, which suits catalogs and content where the shape genuinely varies. A key-value store rejects query flexibility entirely in exchange for speed — you get one operation, "fetch by key," done as fast as physically possible, which is exactly right for a cache or a session store and exactly wrong for anything you need to filter or aggregate. A vector database rejects exact matching as the primary operation — it answers "what's similar to this," a question SQL's equality and range operators were never built to ask. Knowing which constraint each model relaxes, rather than lumping them under one "NoSQL" umbrella, is what actually predicts whether it fits your workload.

Sources

  1. PostgreSQL Global Development Group, official documentation — jsonb, transactions and extension support. postgresql.org/docs/. Accessed 26 Jul 2026.
  2. pgvector project, README and reference — open-source vector similarity search extension for PostgreSQL. github.com/pgvector/pgvector. Accessed 26 Jul 2026.
  3. MongoDB, Inc., official manual — document data modelling and schema flexibility. mongodb.com/docs/manual/. Accessed 26 Jul 2026.
  4. Redis, official documentation — data types and in-memory key-value semantics. redis.io/docs/latest/. Accessed 26 Jul 2026.
  5. AWS, "What is Amazon DynamoDB?" — the vendor's own stated single-digit-millisecond performance claim, on-demand scale-to-zero with no cold starts, no native JOIN support, and continuous backups with point-in-time recovery up to 35 days. docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html. Accessed 26 Jul 2026.
  6. Cloudflare, "Cloudflare D1" overview and pricing — SQLite-compatible serverless database, Time Travel point-in-time recovery to any minute within 30 days. developers.cloudflare.com/d1/ and developers.cloudflare.com/workers/platform/pricing/#d1. Accessed 26 Jul 2026.
  7. Cloudflare, "Cloudflare Vectorize" overview — globally distributed vector database for embeddings, generally available. developers.cloudflare.com/vectorize/. Accessed 26 Jul 2026.
  8. DeployCloud, "Choosing a Database Guide" (this site) — the narrative, prose companion to this ledger. deploycloud.allfrontierglobal.com/choosing-a-database-guide.

FAQ

Good to know

Is a relational database really the right default?
For most application backends, yes. Data with entities that relate to each other — users, orders, posts — is the common case, and a relational database gives you transactional integrity and joins for free. Reach for something else when you have a specific, named reason, not by default.
When do I actually need a vector database?
When you're doing similarity search over embeddings — semantic search, recommendations, retrieval-augmented generation (RAG). If you're already on PostgreSQL, an extension can add this capability without introducing a separate database to operate.
Can I use more than one database type in the same app?
Yes, and larger apps often do — a relational database for core records, a key-value store for sessions or caching, and a vector index for search are a common combination rather than a single database doing everything.
Why isn't there a benchmark or throughput column?
Published benchmarks depend heavily on hardware, dataset shape and query pattern, and a single number here would mislead more than it would help. The sources ledger links to each vendor's own documentation, including the specific claims they stand behind — such as AWS's own stated single-digit-millisecond figure for DynamoDB — so you can verify current, workload-specific numbers yourself.

Terms used on this page

Tap any term for this site’s own definition — no search, no leaving the page.

More in this section

Now apply it

Turn a database choice into a running schema

Describe your app and pick a database in the configurator — the generator scaffolds a real schema file for it, not just advice.