DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Scylla


Scylla is an open-source distributed NoSQL database. It is a C++ rewritten implementation of Apache Cassandra. Scylla is compatible with Cassandra, and uses the same protocols (Cassandra Query Language and Thrift) and same file formats (SSTable). It is optimized for workloads that requires low latency and high throughput, in addition to Apache Cassandra's high availability, scalability and fault-tolerance guarantee. Scylla uses a shared-nothing model and shard-per-core architecture, where each thread executes on its own CPU core, memory, and multi-queue network interface controller. Cross-core communication is carried out by explicit asynchronous, message passing with the Seastar networking library.[06]

Source Code
https://github.com/scylladb/scylladb[02]
Developer
Country of Origin
IL
Start Year
2014 [30]
Project Types
Commercial, Open Source
Written in
C++
Supported Languages
C#, C++, Go, Java, JavaScript, PHP, Python, Ruby, Rust
Derived From
Cassandra
Compatible With
Cassandra
Operating System
Linux
License
AGPL v3
Twitter
@ScyllaDB[05]

Database Entry

Scylla


Scylla is an open-source distributed NoSQL database. It is a C++ rewritten implementation of Apache Cassandra. Scylla is compatible with Cassandra, and uses the same protocols (Cassandra Query Language and Thrift) and same file formats (SSTable). It is optimized for workloads that requires low latency and high throughput, in addition to Apache Cassandra's high availability, scalability and fault-tolerance guarantee. Scylla uses a shared-nothing model and shard-per-core architecture, where each thread executes on its own CPU core, memory, and multi-queue network interface controller. Cross-core communication is carried out by explicit asynchronous, message passing with the Seastar networking library.[06]

History[07][06][08]


Scylla project is started in 2014 by an Israel startup Cloudius Systems (rebranded as ScyllaDB Inc.), lead by Avi Kivity and Dor Laor. , and is released as open source in 2015.

Checkpoints[09]


Scylla supports non-blocking checkpoints through per-node backup procedures, which include full backup/snapshots and incremental backup. Snapshots are taken by the snapshot operation provided by the nodetool utility, while the incremental backup option can be configured in the configuration file. Automatic unnecessary backup cleaning is not implemented.

Compression[10]


Scylla uses Apache Cassandra chunked compression on SSTable files. Three dictionary-based compression algorithms are provided: LZ4 (default), Snappy, and DEFLATE. Data needs to be decompressed before being processed during query execution.

Concurrency Control[11][12]


Scylla does not support ACID transactions as in RDBMS. However, CQL has a BATCH statement that allows multiple update statements belonging to a given partition key be applied in isolation (note that batches are not a full analogue for SQL transactions). Besides, in UPDATE, INSERT, and DELETE statements, modifications belonging to the same partition key are performed atomically and in isolation. Scylla implements Multi-Version Concurrency Control (MVCC) for partition mutation. Internally, versions are represented by an ordered list of states, where each state is a delta of current mutation.

Data Model[13][04]


Scylla uses the same data model as Apache Cassandra, which represents data in key-value pairs (like row in RDBMS), and organizes a collection of rows as a column family (like table in RDBMS). One or more column families are contained in a keyspace (like database in RDBMS). It is encouraged that one application should use one keyspace.

Foreign Keys[13]


Indexes[14][15]


Scylla supports both primary key and secondary key indexes. For primary index, Scylla hashes the key and finds the corresponding partition in the consistent hashing ring; within the partition, Scylla finds the row in a sorted data structure (SSTable). For secondary indexes, Scylla maintains an index table for the secondary index keys, where the value for each key is the (primary) partition keys associated with the secondary key. Whenever a secondary index is queried, Scylla first retrieves the partition keys using the secondary index, then retrieves the records with those partition keys returned by the first step.

Isolation Levels[16][17]


Scylla does not support ACID transactions as in RDBMS. However, CQL has a BATCH statement that allows multiple update statements belonging to a given partition key be applied in isolation (note that batches are not a full analogue for SQL transactions). Besides, in UPDATE, INSERT, and DELETE statements, modifications belonging to the same partition key are performed atomically and in isolation. Scylla has a roadmap for supporting CQL Light-Weight Transactions (LWT) in 3.x.

Joins[18]


Each SELECT statement only applies on one single table.

Logging[19][20]


Scylla writes a commitlog for each write request coming in. Before the mutation is applied to the MemTable, the commitlog that contains the data in the mutation is written to disk to guarantee the durability.

Query Execution[21]


Scylla is designed as a shard-per-core architecture, where all shard runs in parallel. Full table scan queries on Scylla can be made parallel by using the partitioner and token function.

Query Interface[22][23]


Scylla uses Cassandra Query Language (CQL) as the Query Interface. Besides, drivers for the following languages are provided: C++, C#, Go, Java, Node.js, PHP, Python, Ruby, and Rust.

Storage Architecture[24][25]


Scylla is a disk-oriented DBMS, storing data in SSTable file. Scylla also supports in-memory tables, which reduces read latency for mostly read workloads.

Storage Model[26]


Scylla stores data in a sequence of rows.

Storage Organization[27]


Scylla stores data in Sorted-String Tables.

Stored Procedures


System Architecture[14][28]


Scylla uses a shared-nothing model. Nodes in the cluster are organized in a decentralized consistent hashing ring and data is partitioned into shards by the key across all nodes. Scylla uses a shard-per-core architecture, where each thread for a shard executes on its own CPU core, memory, and multi-queue network interface controller. Cross-core communication is carried out by explicit message passing. Scylla also uses replicas for fault-tolerance.

Views[29]


Scylla supports Materialized Views in version 2.0 as an experimental feature. Whenever the base table is updated, the materialized view table will be automatically updated. Materialized View tables are distributed as normal tables and scale as well as normal tables. However, there are still limitations in the current experimental release, including but not limited to lack of local locking and local batch log.

Citations

30 sources
  1. ScyllaDB For Real-Time AI scylladb.com
  2. GitHub - scylladb/scylladb: NoSQL data store using the Seastar framework, compatible with Apache Cassandra and Amazon DynamoDB · GitHub github.com
  3. Welcome to ScyllaDB Documentation | ScyllaDB Docs scylladb.com
  4. ScyllaDB - Wikipedia wikipedia.org
  5. https://twitter.com/ScyllaDB twitter.com
  6. ScyllaDB | Modern NoSQL Database Architecture scylladb.com
  7. scylladb/version.hh at master · scylladb/scylladb · GitHub github.com
  8. NoSQL Database Company for Data Intensive Apps - ScyllaDB scylladb.com
  9. Backup your Data | ScyllaDB Docs scylladb.com
  10. SSTable Compression | ScyllaDB Docs scylladb.com
  11. scylladb/partition_version.hh at 8210f4c982396aba127cfc2511998c502bed39b5 · scylladb/scylladb · GitHub github.com
  12. Data Manipulation | ScyllaDB Docs scylladb.com
  13. Data Definition | ScyllaDB Docs scylladb.com
  14. ScyllaDB Ring Architecture - Overview | ScyllaDB Docs scylladb.com
  15. Global Secondary Indexes | ScyllaDB Docs scylladb.com
  16. Data Manipulation | ScyllaDB Docs scylladb.com
  17. The Real-Time Database for AI | ScyllaDB scylladb.com
  18. Data Manipulation | ScyllaDB Docs scylladb.com
  19. scylladb/db/commitlog/commitlog_entry.hh at 1891779e646d770aa825ecdd8f3a8e60847d3ca9 · scylladb/scylladb · GitHub github.com
  20. ScyllaDB scylladb.com
  21. Efficient full table scans with ScyllaDB 1.6 - ScyllaDB scylladb.com
  22. ScyllaDB scylladb.com
  23. ScyllaDB CQL Drivers | ScyllaDB Docs scylladb.com
  24. ScyllaDB scylladb.com
  25. ScyllaDB SSTable Format | ScyllaDB Docs scylladb.com
  26. SSTable Data File | ScyllaDB Docs scylladb.com
  27. ScyllaDB scylladb.com
  28. ScyllaDB Architecture - Fault Tolerance | ScyllaDB Docs scylladb.com
  29. Materialized Views preview in ScyllaDB 2.0 - ScyllaDB scylladb.com
  30. Initial commit github.com
Revision #10