Self-hosted service
crate/crate avatar
crate/crate

CrateDB: a distributed SQL database built on Lucene

CrateDB is a distributed and scalable SQL database for storing and analyzing massive amounts of data in near real-time, even with complex queries. It is PostgreSQL-compatible, and based on Lucene.

4,435 stars616 forksJavaApache-2.0

At a glance

What is it?
CrateDB is a PostgreSQL-compatible, horizontally scalable SQL database for time-series, full-text and geospatial workloads. This review covers what it does, how to run it, and where its design choices become constraints.
Who is it for?
CrateDB suits teams that need SQL over high-volume time-series or document data and can accept a single-node Docker start for evaluation. Teams that need strict PostgreSQL semantics or a small embedded database should look elsewhere.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What CrateDB solves and who it is for

CrateDB targets a specific gap: storing and analyzing large volumes of data with SQL, without giving up horizontal scale. The README describes it as offering "the benefits of an SQL database and the scalability and flexibility typically associated with NoSQL databases." That combination is the pitch.

The intended users are teams dealing with time-series data, real-time full-text search, or geospatial data types and search capabilities. The topics list confirms this: analytics, big-data, industrial-iot, iot-analytics, olap, time-series, tsdb. A team collecting sensor readings, application logs, or location data and wanting to query them with standard SQL is the target audience.

The project is primarily maintained by Crate.io, with community contributions accepted. The repository is not archived, and the last push was on 2026-09-15. Releases are frequent: 6.4.2 on 2026-08-04, 6.4.3 on 2026-08-19, and 6.4.4 on 2026-09-03. That cadence suggests an actively developed codebase, though the README does not document a support policy or long-term release branches.

How CrateDB works: Lucene, shards and the PostgreSQL wire

CrateDB is based on Lucene, the same search library underneath Elasticsearch. That inheritance explains several features: full-text search, dynamic table schemas, and queryable objects that provide document-oriented behavior alongside relational SQL. Instead of forcing everything into rows and columns, CrateDB lets you store nested objects and query them.

The architecture is shared-nothing. The README states CrateDB can be "scaled horizontally using ephemeral virtual machines (e.g., Kubernetes, AWS, and Azure) with no shared state." Tables are auto-partitioned, auto-sharded, and auto-replicated. A distributed query execution engine parallelizes workloads across the cluster. Clusters are described as self-healing and auto-rebalancing, meaning nodes can fail and the remaining nodes redistribute shards.

Clients connect through two interfaces: the PostgreSQL wire protocol or an HTTP API. That means existing PostgreSQL drivers and tools can connect, though the README does not claim full PostgreSQL compatibility, only PostgreSQL-compatible. The distinction matters: PostgreSQL-compatible means the wire protocol works, not that every PostgreSQL feature or extension is available. The README lists standard SQL, time-series support, full-text search, and geospatial types as features, but does not enumerate unsupported PostgreSQL functions or syntax.

User-defined functions (UDFs) can extend functionality, according to the README. The details of what languages or runtimes UDFs support are not given in the README and would need checking in the reference manual.

Installing CrateDB with Docker and running a first query

The README gives a single Docker command to start a node. The flags publish the Admin UI port 4200 and the PostgreSQL port 5432, set a heap size of 1 GB, and configure single-node discovery.

bash
docker run --publish 4200:4200 --publish 5432:5432 --env CRATE_HEAP_SIZE=1g crate '-Cdiscovery.type=single-node'

After the container starts, the Admin UI is available on port 4200. The README mentions a sql console inside the Admin UI, plus a CLI tool called CrateDB shell (crash). The README also links to installation documentation for other download and install options.

Once connected, you can run standard SQL. The README does not include a sample CREATE TABLE or INSERT statement, so any schema example would be invented. What it does say is that you can run ad-hoc queries using standard SQL, and that dynamic table schemas are supported. A reasonable first step is to open the sql console and create a table matching your data, then insert a few rows and query them. The README points to introductory docs and beginner tutorials for this, rather than providing the statements inline.

For container-specific deployment, the README links to a CrateDB on Docker how-to guide and a CrateDB on Kubernetes how-to guide. Those are the places to look for production configuration, since the README itself only gives the single-node example.

Where CrateDB is the wrong tool

The README is promotional, and that is worth noting. It claims modest clusters can "ingest tens of thousands of records per second without breaking a sweat" and describes "blazing-fast distributed query execution." No benchmark methodology, hardware specification, or dataset size accompanies these claims. Treat them as marketing until you measure your own workload.

The bigger limitation is compatibility. CrateDB is PostgreSQL-compatible, not PostgreSQL. If your application relies on PostgreSQL-specific extensions, stored procedures in PL/pgSQL, or exact transaction isolation semantics, the README does not claim those work. The README also does not document rollback behavior, transaction isolation levels, or foreign key support. Those are gaps a team migrating from PostgreSQL needs to verify before committing.

CrateDB is also not a small embedded database. It is designed for clusters and containerized environments, with auto-sharding and auto-replication. Running it for a single-user desktop application or a tiny dataset adds operational overhead without benefit. The README explicitly positions it for massive amounts of data and horizontal scaling; if that is not your problem, a simpler database is the better choice.

Finally, the README does not document backup and restore procedures, upgrade paths between major versions, or downgrade support. Those are operational questions the README leaves to the reference manual.

CrateDB compared with Elasticsearch and PostgreSQL

The most direct comparison is Elasticsearch, since CrateDB is built on Lucene and targets similar data volumes. The difference is the query interface. Elasticsearch exposes a JSON-based query DSL; CrateDB exposes standard SQL over the PostgreSQL wire protocol. If your team already knows SQL and wants to avoid learning a DSL, CrateDB removes that step. If your team has invested in Elasticsearch aggregations and Kibana dashboards, CrateDB is a rewrite.

The other comparison is PostgreSQL. PostgreSQL is a mature relational database with a large extension ecosystem, strong transactional guarantees, and decades of operational knowledge. CrateDB trades some of that maturity for horizontal scale and built-in full-text and geospatial search. A team that has outgrown a single PostgreSQL node and is sharding manually might find CrateDB's auto-sharding and auto-replication attractive. A team that fits comfortably on one PostgreSQL instance gains little.

The README links to a benefits page comparing CrateDB with other systems, but the README itself does not provide a feature-by-feature comparison. The honest summary is that CrateDB sits between a traditional relational database and a search engine, and its value depends on whether you need both SQL and distributed search in one system.

Licence and maintenance cost

CrateDB is licensed under Apache-2.0, according to the repository. That is a permissive licence: it allows commercial use, modification, and distribution, with the usual requirements to preserve notices and provide a copy of the licence. The repository includes a NOTICE file and a 3RD-PARTY-NOTICES.md, which is standard for Apache-2.0 projects with bundled dependencies. This is not legal advice; teams with specific compliance questions should review the licence text and the NOTICE file themselves.

The README notes that Crate.io also offers CrateDB Cloud, a fully-managed Database as a Service. That is a separate commercial product, not part of the Apache-2.0 code. The README does not state whether any features are exclusive to the cloud offering, so that is worth checking if you plan to self-host.

Maintenance cost depends on deployment. The README positions CrateDB for Kubernetes, AWS, and Azure, with self-healing and auto-rebalancing. Those features reduce manual intervention, but they also mean you are running a distributed system. Upgrades between releases are not documented in the README. The release cadence (roughly every two weeks for patch versions) suggests frequent updates, and the README does not describe a long-term support branch. Teams should check the reference manual for upgrade procedures before adopting.

Editorial conclusion

CrateDB suits teams that need SQL over high-volume time-series or document data and can accept a single-node Docker start for evaluation. Teams that need strict PostgreSQL semantics or a small embedded database should look elsewhere. Verify the PostgreSQL wire protocol limits and the licence terms before committing.

Frequently asked questions

What is CrateDB used for?

CrateDB is a distributed SQL database for storing and analyzing large amounts of data in near real-time. The README lists time-series data, real-time full-text search, and geospatial data types as supported use cases.

How do I install CrateDB?

The README gives a Docker command that publishes ports 4200 and 5432 and sets CRATE_HEAP_SIZE to 1g. It also links to installation documentation for other download and install options.

Is CrateDB compatible with PostgreSQL?

The README describes CrateDB as PostgreSQL-compatible and says it supports the PostgreSQL wire protocol. It does not claim full PostgreSQL feature compatibility, so specific extensions and semantics need verification.

What licence does CrateDB use?

The repository states the licence is Apache-2.0. The project also includes a NOTICE file and a 3RD-PARTY-NOTICES.md for bundled dependencies.

Can CrateDB run on Kubernetes?

The README states CrateDB can be scaled horizontally using ephemeral virtual machines including Kubernetes, and links to a CrateDB on Kubernetes how-to guide. The README itself only provides a single-node Docker example.

Official sources

  1. crate/crate on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes