1.5k GitHub stars and counting — bloomberg/comdb2 is a C project TopGit is tracking across repositories on the platform. Bloomberg's distributed RDBMS
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Comdb2 is a clustered RDBMS built on Optimistic Concurrency Control techniques.
It provides multiple isolation levels, including Snapshot and Serializable Isolation.
Read/Write transactions run on any node, with the client library transparently negotiating connections to lowest cost (latency) node which is available.
The client library provides transparent reconnect.
Work on Comdb2 was started at Bloomberg LP in 2004 and it has been under heavy development since.
More information about the architecture of the project can be found in our VLDB 2016 paper and for more information on usage please look in the Docs.
Documentation
Comdb2 documentation is included in the docs directory.
It can be hosted locally with jekyll by running jekyll serve from the docs directory.
Contributing
Please refer to our contribution guide for instructions.
We welcome code and idea contributions.
Quick Start
On every machine in the cluster:
Make sure all machines in the cluster can talk to each other via ssh.
Copy keys around if needed.
It is recommended to increase the open file limits, at least in the sessions which start pmux and server.
Build and Install Comdb2:
mkdir build && cd build && cmake .. && make && sudo make install
Add /opt/bb/bin to your PATH
export PATH=$PATH:/opt/bb/bin
Start pmux:
pmux -n
(optional) Comdb2 nodes identify each other by their hostnames. If the hostname
of each node isn't resolvable from other nodes, we should tell Comdb2 the full
domain name to use for the current node. Most setups won't have this issue.
Tell comdb2 our FQDN.
vi /opt/bb/etc/cdb2/config/comdb2.d/hostname.lrl
add current machine's name, e.g.
hostname machine-1.comdb2.example.com
On one machine (say machine-1), create a database - this example creates a database
called testdb stored in ~/db.
comdb2 --create --dir ~/db testdb
Note: the --dir PATH parameter is optional, and if it is omitted comdb2 uses a default root of /opt/bb/var/cdb2/ for creating a database directory to contain the database files, which is named as per the database name parameter; hence in this case /opt/bb/var/cdb2/testdb.
The default root will have to be created explicitly with the desired permissions before invoking comdb2 --create for a database.
In this quick start, we use the home directory to avoid obfuscating the key steps of the process.
Configure the nodes in the cluster:
vi ~/db/testdb.lrl
add
cluster nodes machine-1.comdb2.example.com machine-2.comdb2.example.com
Note: the log dir comdb2 uses by default is /opt/bb/var/log/cdb2/
If this directory does not have permissions allowing the user to create file, there will be diagnostics output such as:
[ERROR] error opening '/opt/bb/var/log/cdb2/testdb.longreqs' for logging: 13 Permission denied
This condition will not impact operation of the database for the purposes of this quick start.
On any node, start using the database. You don't have any tables yet. You can add them with cdb2sql
Example -
cdb2sql testdb local 'CREATE TABLE t1 {
schema {
int a
}
}'
Database can be queried/updated with cdb2sql:
cdb2sql testdb local 'insert into t1(a) values(1)'
(rows inserted=1)
cdb2sql testdb local 'select * from t1'
(a=1)
Comdb2 Directory Contents
Directory
Description
bbinc/
Header & Generic include files
bdb/
Table layer
berkdb/
Btrees layer
cdb2api/
Client code
cdb2jdbc/
JDBC driver
cmake/
cmake configuration files
comdb2rle/
Run length encoding
contrib/
Misc useful programs that aren't part of core Comdb2
crc32c/
Checksum component
csc2/
csc2 processing
csc2files/
csc2 config files
cson/
JSON library
datetime/
Datetime component
db/
Types layer and overall glue
dfp/
Decimal number component
dlmalloc/
Local malloc version
docs/
Documentation
lua/
All things pertaining to lua VM used for stored procedures
No homepage URL was recorded for bloomberg/comdb2 in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does bloomberg/comdb2 have any tags?
TopGit's last sync did not record any GitHub topics for bloomberg/comdb2. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on bloomberg/comdb2?
The most recent commit recorded on bloomberg/comdb2 was 3 days ago, based on the GitHub push timestamp. The repository has 243 forks — one of the better signals of community interest.
Is bloomberg/comdb2 open source?
TopGit's metadata for bloomberg/comdb2 does not record a license. Most public repositories on GitHub ARE open source, but the exact terms vary — verify by opening the LICENSE file directly.
Where do I read more about bloomberg/comdb2?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/bloomberg/comdb2 is the definitive source.
Read full README in the tab above.
Want a second opinion on comdb2?
Ask an AI that can read this page — one click and you get its take on comdb2.