ScyllaDB
6.xSummary
C++ reimplementation of Apache Cassandra using the Seastar asynchronous framework. Wire-compatible with Cassandra's CQL protocol. Eliminates JVM GC pauses through a shard-per-core architecture where each CPU core runs its own event loop and owns a dedicated subset of data partitions. Designed for sub-millisecond p99 latency under sustained write bursts.
Primary Use Case
Write-heavy workloads requiring predictable low-latency at high throughput: time-series data, message storage, activity feeds, IoT sensor ingestion, and any workload where JVM GC-induced p99 spikes from Cassandra are unacceptable.
Workload Fit
Strengths
Best for
- ·Write-intensive workloads where predictable p99 latency is required: eliminating JVM GC pauses is the primary reason to choose ScyllaDB over Cassandra
- ·Time-series and IoT ingestion at millions of writes/second where partition key design enables even distribution across nodes
- ·Message storage systems (Discord's architecture) where wide rows within a partition store ordered messages and reads access recent data
- ·Activity feeds and audit logs where append-only write patterns suit the LSM-tree storage model
- ·Multi-datacenter deployments requiring tunable consistency and local reads without cross-region latency
Excels when
- ·Write throughput exceeds what any single-node relational database can handle and horizontal write scaling is required
- ·Access patterns are known at design time and can be encoded in the partition key + clustering key schema
- ·Workload is predominantly writes with simple point reads by partition key: the LSM-tree model is optimized for this pattern
- ·Latency variance (p99/p50 ratio) is more important than absolute throughput: ScyllaDB's shard-per-core model delivers tight p99 bounds
Architectural advantages
- ·Shard-per-core architecture eliminates lock contention between CPU cores: each core has its own memory, I/O scheduler, and data partitions without cross-core synchronization
- ·No JVM garbage collector: memory is managed with C++ RAII and Seastar's explicit memory pools; no stop-the-world pauses at any throughput level
- ·Wire-compatible with Cassandra CQL: existing Cassandra clients and drivers work without modification; migration is operational, not application-level
- ·Seastar's async I/O model submits I/O operations to the kernel io_uring interface, achieving near-saturation of NVMe bandwidth per core
- ·Consistent hash ring with vnodes provides even data distribution and simplified node operations (add, decommission) without manual token assignment
When to Avoid
Avoid when
- ·Workload requires ACID transactions, multi-partition transactional writes, or complex joins: ScyllaDB's data model does not support these
- ·Access patterns are not known at design time: ad-hoc queries without a defined partition key require ALLOW FILTERING and cause full partition scans
- ·Team does not have Cassandra/CQL data modeling expertise: partition key design mistakes are operational failures, not query optimization problems
- ·Data volume is modest enough to fit on a single PostgreSQL primary: the operational overhead of a distributed NoSQL cluster is not justified below millions of writes/day
Common misuses
- ·Treating ScyllaDB like a relational database with flexible query patterns: every production query must be designed around the primary key; ad-hoc secondary index queries are an operational anti-pattern
- ·Not encoding time or range into the clustering key for time-series data: without clustering key ordering, range queries require full partition scans instead of efficient slice reads
- ·Using ScyllaDB for small datasets (< 10M rows) where a single PostgreSQL instance would be simpler, cheaper, and more queryable
Consistency & Transactions
Scaling
Read scalability
Reads scale by adding nodes: the consistent hash ring distributes partitions evenly. Consistency level ONE allows a read to return from the nearest replica with minimal latency. QUORUM reads provide tunable consistency at the cost of additional replica coordination. Local reads (LOCAL_QUORUM) avoid cross-DC network hops in multi-datacenter deployments.
Write scalability
Writes scale linearly by adding nodes. Each node owns its partition ranges on the ring; writes go directly to the owning node without a coordinator bottleneck. The shard-per-core model means write throughput scales with both node count and CPU core count on each node. Discord documented storing trillions of messages on ScyllaDB; their Cassandra-to-ScyllaDB migration ran at up to 3.2 million messages/second.
Failure Behavior
Known failure modes
- ·Hot partition overload: a single partition key receiving disproportionate writes saturates the shard owning that partition while other shards are idle: partition key cardinality design is critical
- ·Large partition degradation: partitions exceeding 100MB cause compaction and repair operations to take excessive time; queries on large partitions scan more sstables and slow down
- ·Tombstone accumulation: frequent deletes generate tombstone markers that persist until compaction; reads that scan tombstone-heavy ranges incur tombstone GC overhead and latency spikes
- ·Repair lag: ScyllaDB relies on periodic repair operations (anti-entropy) to ensure consistency across replicas; falling behind on repair means replicas can serve divergent data indefinitely
- ·Compaction pressure: write-heavy workloads generate sstables faster than compaction can merge them; unbounded sstable proliferation degrades read performance as more files must be checked
- ·Coordinator timeout cascade: a slow or overloaded node causes coordinator timeouts to cascade: the client receives a timeout even if the mutation was applied on a quorum of replicas, leading to application-level retry storms
Bottlenecks
- ·Hot partition: a single high-cardinality partition key receiving all writes saturates the owning shard; distributing writes requires key design changes
- ·Read path tombstone scanning: deleted data leaves tombstones that must be scanned and discarded on reads until compacted: high delete rates cause read amplification
- ·Compaction I/O: SizeTieredCompactionStrategy merges sstables in bursts; on write-heavy nodes, compaction can consume significant I/O bandwidth and compete with client reads
- ·Cross-datacenter replication adds write latency for clients using cross-DC consistency levels; LOCAL_QUORUM avoids this at the cost of cross-DC divergence risk
- ·Schema migrations (adding columns) on large clusters require rolling restarts and can block on Paxos-based schema agreement across all nodes
Degradation patterns
- ·Write amplification during compaction on write-heavy nodes causes periodic I/O saturation; monitoring compaction pending tasks is the leading indicator before client latency degrades
- ·Replica divergence accumulates silently without repair: reads with consistency level ONE can return stale data indefinitely; repairs are the only mechanism to force reconciliation
- ·A slow node in a multi-DC cluster causes LOCAL_QUORUM writes to occasionally route to the slow node as a replica, elevating p99 latency; hinted handoff accumulates on the slow node
Recovery considerations
- ·Hinted handoff queues store mutations for temporarily unavailable nodes; hints expire after max_hint_window_in_ms and require repair to reconcile the divergent node after recovery
- ·Node replacement (replace address) allows a new node to bootstrap with a dead node's data from surviving replicas; bootstrapping from disk is faster than streaming for small clusters
- ·Snapshot-based backup requires flushing memtables to sstables (nodetool flush) before snapshotting; incremental backups via tabletsnapshot reduce backup time for large datasets
Operational Pitfalls
- ·Not monitoring partition sizes: a single large partition (>100MB) will not alert by default but silently degrades compaction and repair performance over time
- ·Choosing the wrong compaction strategy: SizeTieredCompactionStrategy (STCS) optimizes for write throughput but degrades reads under mixed workloads; LeveledCompactionStrategy (LCS) provides more consistent read performance at higher write amplification
- ·Using ALLOW FILTERING in CQL queries: this triggers full partition scans and should never appear in production query paths; all production queries must be satisfied by the primary key or a materialized view
- ·Not running nodetool repair on a schedule: ScyllaDB is eventually consistent at the storage layer; repairs are the mechanism for reconciling divergent replicas and must be completed within the gc_grace_seconds window to avoid permanent data divergence
- ·Setting consistency level ONE for writes when data durability matters: a node failure between ONE write and repair can cause data loss; LOCAL_QUORUM or QUORUM provides the minimum durability guarantee
Architecture Guidance
Common topology roles
Migration notes
- ·From Cassandra: wire-compatible CQL protocol means existing drivers work without modification; migration is a rolling cluster replacement (sstableloader or dual-write strategy)
- ·Data model migration from a relational store requires complete rethinking of access patterns: partition key must match the primary query predicate before data is loaded
- ·To ScyllaDB Cloud: managed service handles compaction scheduling and repair; self-hosted teams give up manual tuning control in exchange for reduced operational overhead
Advisor Guidance
When: scenario has write_heavy workload or IoT ingestion pattern
Design partition keys for even distribution: avoid monotonic keys; use composite partition keys that distribute across nodes by time bucket + entity ID
When: scenario requires ACID transactions or multi-entity transactional writes
ScyllaDB does not support multi-partition ACID transactions; use a relational database for transactional writes and ScyllaDB for append-only write-heavy storage
When: scenario is migrating from Apache Cassandra
Run nodetool repair on a schedule from day one; compaction strategy selection (STCS vs LCS) must match the read/write ratio of the workload
Comparison Factors
write throughput consistency
Best-in-class for sustained high-throughput writes with tight p99 bounds; shard-per-core eliminates GC-induced latency variance
operational complexity
High: partition key design, compaction strategy selection, repair scheduling, and hot partition monitoring require deep NoSQL expertise
query flexibility
Low: all queries must target the primary key; secondary indexes and ALLOW FILTERING are operational anti-patterns for production query paths
consistency guarantee
Tunable: configurable per operation from ONE (availability-first) to ALL (consistency-first); eventual consistency is the default trade-off
Managed Cloud Options
Enables Patterns
Basis
Discord's public migration case study provides concrete operational data; Seastar architecture and shard-per-core model are well-documented in ScyllaDB engineering posts