Comdb2

active

by Bloomberg · since 2004 · also known as comdb2

Bloomberg's clustered relational database with optimistic concurrency and synchronous replication.

relationaldatabase engineopen source (permissive)mature

Overview

Comdb2 is the relational database Bloomberg has run in production since the mid-2000s and open-sourced in 2016. It combines a SQLite-derived SQL frontend with a heavily modified Berkeley DB storage layer, and clusters replicate synchronously so any node can serve reads and accept writes with serializable or snapshot isolation via optimistic concurrency. It supports stored procedures in Lua, triggers and queues for event delivery, online schema changes and table partitioning. It is battle-tested at Bloomberg scale, but outside Bloomberg the community, documentation and tooling are small.

Strengths & trade-offs

Strengths

  • +Synchronous replication with serializable isolation across the cluster
  • +Optimistic concurrency lets any node accept writes
  • +Online schema changes without blocking traffic
  • +Built-in queues and Lua triggers for event-driven designs
  • +Two decades of production use at Bloomberg

Trade-offs

  • −Small external community and few third-party tools or drivers
  • −Not wire-compatible with MySQL or PostgreSQL
  • −Sparse documentation compared with mainstream databases
  • −Optimistic concurrency causes retries on hot rows

Great for

  • +Highly available financial OLTP systems
  • +Event delivery via database queues and triggers
  • +Clusters needing strong consistency across nodes

Think twice for

  • −Teams needing broad ORM and tooling support
  • −Analytical workloads
  • −Quick-start or managed cloud use

Capabilities

Native or official first-party support · 12 of 25 tracked

✓Transactions
✓Joins
✓Secondary indexes
✓JSON
✓Change data capture
✓Triggers
✓Stored procedures
✓Pub/Sub
✓Durable persistence
✓Compression
✓Role-based access
✓Online schema changes
–Full-text search
–Vector search
–Geospatial
–Materialized views
–TTL / expiry
–Columnar storage
–In-memory
–Encryption at rest
–Time travel
–Branching
–Streaming ingest
–Offline sync
–Runs in WebAssembly

Scale & consistency

Comfortable data size
Medium · ≤ 10 TB
Horizontal scaling
Manual
Multi-region
Read replicas
Transactions
Full ACID
Consistency
Strong
Schema
Strict
Architecture
Distributed, Multi primary, Client server
Query languages
SQL, Lua

Full-replica clusters with synchronous replication; partitioning and remote-table queries for larger datasets.

Deployment

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

apis & protocolsComdb2 protocol (cdb2api), JDBC
client languagesC, Java, Go, Python, JavaScript

Alternatives to Comdb2

Compare all→
CockroachDBRelational47.1

Postgres-wire distributed SQL built to survive node, zone and region failures with serializable transactions.

comdb2 vs cockroachdb →
PostgreSQLRelational93.2

The extensible, standards-first open-source relational database.

comdb2 vs postgresql →
MySQLRelational82.3

The web's default open-source SQL database, now on calendar versioning with 9.7 as the LTS line.

comdb2 vs mysql →
TiDBRelational35.9

MySQL-compatible distributed SQL with a row store for OLTP and a columnar replica for real-time analytics.

comdb2 vs tidb →
YugabyteDBRelational32.7

Apache-licensed distributed SQL that reuses the PostgreSQL query layer on a Raft-replicated storage engine.

comdb2 vs yugabytedb →
FoundationDBKey-Value36.8

Apple's ordered, strictly serializable distributed key-value store, built to have layers on top.

comdb2 vs foundationdb →

Comdb2 FAQ

What is Comdb2?

Comdb2 is a relational database by Bloomberg, first released in 2004. Comdb2 is the relational database Bloomberg has run in production since the mid-2000s and open-sourced in 2016. It combines a SQLite-derived SQL frontend with a heavily modified Berkeley DB storage layer, and clusters replicate synchronously so any node can serve reads and accept writes with serializable or snapshot isolation via optimistic concurrency. It supports stored procedures in Lua, triggers and queues for event delivery, online schema changes and table partitioning. It is battle-tested at Bloomberg scale, but outside Bloomberg the community, documentation and tooling are small.

Is Comdb2 open source?

Yes. Comdb2 is open source. License: Apache License 2.0.

Does Comdb2 support ACID transactions?

Yes. Comdb2 supports full ACID transactions, with strong consistency.

Does Comdb2 scale horizontally?

Comdb2 has no built-in sharding; scaling out means partitioning data in your application. It is comfortable at medium scale (≤ 10 TB). It supports cross-region read replicas.

How can I run Comdb2?

You can self-host it.

What is Comdb2 best for?

Comdb2 is a strong fit for highly available financial OLTP systems; event delivery via database queues and triggers; and clusters needing strong consistency across nodes. Think twice for teams needing broad ORM and tooling support.

What are the best alternatives to Comdb2?

Common alternatives to Comdb2 include CockroachDB, PostgreSQL, MySQL, TiDB and YugabyteDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.

How popular is Comdb2?

Comdb2 ranks #291 of 844 databases on the WhichDB Score (10.9/100), and #92 among relational databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.