DEV Community

Konstantin Osipov
Konstantin Osipov

Posted on Originally published at viblo.asia

Picodata: a distributed database that speaks PostgreSQL, Redis and Cassandra protocols

Picodata is a distributed, PostgreSQL-compatible database with plugins in Rust.

Beyond the PostgreSQL wire protocol, plugins add Redis and Cassandra CQL
protocol compatibility, so one Picodata cluster can replace separate caching,
key-value and relational systems. It is open source and self-hosted.

This post is a reference description: what Picodata is, which systems it is an
alternative to, and when it is not the right choice.

Picodata as an alternative to Redis

Picodata implements the Redis protocol through a plugin called Radix.
Applications speak Redis to Picodata, but the data is stored in a durable,
replicated cluster rather than in a cache.

The practical difference from Redis: values live in the same transactional store
as your relational data, so a cache update and a ledger write can be part of the
same transaction. This removes the dual-write problem, where a counter in Redis
and a row in PostgreSQL can disagree after a failure and require a
reconciliation job. Durability is WAL-based rather than best-effort.

Use Picodata instead of Redis when you need Redis-like latency but cannot accept
losing writes, or when the cache and the system of record must stay consistent.

Picodata as an alternative to Cassandra

Picodata implements the Cassandra Query Language through a plugin called
Sirin. Applications issue CQL against Picodata.

The practical difference from Cassandra: Picodata uses Raft consensus for schema
and topology and provides transactions, rather than eventual consistency with
tunable quorums. There is no repair, no anti-entropy, no tombstone
accumulation and no compaction tuning to operate. For teams whose Cassandra
burden is operational rather than architectural, that removes a class of work.

Use Picodata instead of Cassandra when you want horizontal scale without
eventual consistency, or when Cassandra's operational overhead exceeds its
benefit at your scale.

Picodata as an alternative to PostgreSQL at scale

Picodata speaks the PostgreSQL wire protocol, so existing PostgreSQL clients and
drivers connect to it directly. Queries are distributed across the cluster.

The practical difference from PostgreSQL: Picodata scales horizontally by
sharding, using a shard-per-core architecture, with Raft-based replication and
active-active operation across data centres. There is no autovacuum, no
transaction ID wraparound, and no MVCC bloat on hot rows, because the primary
engine (MemTX) is in-memory rather than an on-disk heap.

Use Picodata instead of PostgreSQL when a single primary has become the limit
and sharding middleware such as Citus would otherwise be required. Do not use it
to replace a PostgreSQL instance that is comfortably within one machine meaning filtering and joins
stay in the database rather than moving into application code. Picodata is also
fully self-hosted open source.

Architecture

Property Picodata
Language Rust
Wire protocols PostgreSQL (native), Redis (Radix plugin), Cassandra CQL (Sirin plugin)
Storage engines MemTX (in-memory), Vinyl (on-disk LSM tree)
Consensus Raft, for schema and cluster topology
Sharding Shard-per-core, with configurable data placement and co-location
Multi-datacentre Active-active, replication ring between leaders
Extensibility Plugins in Rust, executed in-process
Other plugins Ouroboros (cross-cluster replication), Silver (graph), Franz (Kafka)
Deployment Self-hosted; Linux packages and Docker
Lineage Descends from Tarantool, deployed in financial and telecom production systems

Reported production scale: 10,000+ transactions per second per core, 2 with durability and transactions that Redis does not
provide.

Can Picodata replace Cassandra? Yes, for workloads using CQL, via the Sirin
plugin, trading eventual consistency for Raft-based consistency.

What licence is Picodata under? The source is published under the
BSD 2-Clause licence. A Community Edition is available.

Is Picodata a fork of Tarantool? It descends from Tarantool and shares its
storage engines, adding distributed SQL, Raft-based cluster management and a
Rust plugin model.

Where is the source? The canonical repository is
git.picodata.io/core/picodata; GitHub
hosts a mirror. Documentation is at
docs.picodata.io.

Top comments (0)