SSTables 3.0 File Format
Vladimir Krivopalov
Software Developer at ScyllaDB
About me
A software developer with over 10 years of experience
currently working on ScyllaDB.
Areas of expertise include server-side networking services,
secure gateway for remote desktop access, reverse proxy for
web and many others. Hold an MS degree in applied
mathematics from the Tomsk State University, and enjoy
modern C++, high performance, open source and cutting-edge
technologies.
Introduction
Introduction
SSTables is a Cassandra format for storing data on disk.
▪ ka (since Cassandra 2.1)
▪ la/lb (since Cassandra 2.2)
▪ ma/mb/mc (since Cassandra 3.0)
Supported today (ka/la)
Coming in Scylla 3.0 (mc)
Old SSTables Format
Old SSTables Format
Old formats, ‘kX’ and ‘lX’, are identical in how they store data:
Partition
Cell Cell Cell
Old SSTables Format
Cell
<clustering key value>:<column name>
<column value>
Old SSTables Format
What are the problems with this format?
▪ Not aligned with CQL, same-row cells not grouped
▪ Lots of data duplication - repetitive clustering keys and column
names across cells, timestamps, TTLs, etc
▪ Ad-hoc solutions that look like hacks (e.g., row markers)
▪ Linear search through promoted index for wide partitions
New SSTables Format
New SSTables Format
Partition
Row
Cell Cell Cell
Row
Cell Cell Cell
New SSTables Format
▪ Internal representation aligned with CQL model
▪ Variable-length integers and delta-based encoding
▪ Information about columns is stored in Statistics.db
▪ Inherent row attributes (row marker -> liveness info)
New SSTables Format
✓ Noticeable disk space savings (10-80% smaller data files)
✓ Easier (means faster) processing of rows
✓ Files don’t depend on schema
✓ Binary search through index: O(log n) instead of O(n)
• Is not supported in Scylla 3.0 - work in progress
What Does It Mean For Users
What Does It Mean For Users
▪ Files from Cassandra 3.x can be imported natively to Scylla
▪ Consider disabling compression for lower latency
▪ No reason to use compact tables any longer
▪ Better performance and disk space savings!
What Does It Mean For Users
In 3.0:
▪ Writing and reading SSTables 3.0. Old formats supported too.
▪ Upgrade of old SSTables to new format through compaction.
In 3.x (future releases):
▪ Binary search through promoted index on sliced reads.
▪ Caching of promoted index blocks.
▪ Write in new format only (reading old formats still supported).
Thank You
Any Questions ?
Please stay in touch
vladimir@scylladb.com
@argenetix

Scylla Summit 2018: Scylla Feature Talks - SSTables 3.0 File Format

  • 1.
    SSTables 3.0 FileFormat Vladimir Krivopalov Software Developer at ScyllaDB
  • 2.
    About me A softwaredeveloper with over 10 years of experience currently working on ScyllaDB. Areas of expertise include server-side networking services, secure gateway for remote desktop access, reverse proxy for web and many others. Hold an MS degree in applied mathematics from the Tomsk State University, and enjoy modern C++, high performance, open source and cutting-edge technologies.
  • 3.
  • 4.
    Introduction SSTables is aCassandra format for storing data on disk. ▪ ka (since Cassandra 2.1) ▪ la/lb (since Cassandra 2.2) ▪ ma/mb/mc (since Cassandra 3.0) Supported today (ka/la) Coming in Scylla 3.0 (mc)
  • 5.
  • 6.
    Old SSTables Format Oldformats, ‘kX’ and ‘lX’, are identical in how they store data: Partition Cell Cell Cell
  • 7.
    Old SSTables Format Cell <clusteringkey value>:<column name> <column value>
  • 8.
    Old SSTables Format Whatare the problems with this format? ▪ Not aligned with CQL, same-row cells not grouped ▪ Lots of data duplication - repetitive clustering keys and column names across cells, timestamps, TTLs, etc ▪ Ad-hoc solutions that look like hacks (e.g., row markers) ▪ Linear search through promoted index for wide partitions
  • 9.
  • 10.
    New SSTables Format Partition Row CellCell Cell Row Cell Cell Cell
  • 11.
    New SSTables Format ▪Internal representation aligned with CQL model ▪ Variable-length integers and delta-based encoding ▪ Information about columns is stored in Statistics.db ▪ Inherent row attributes (row marker -> liveness info)
  • 12.
    New SSTables Format ✓Noticeable disk space savings (10-80% smaller data files) ✓ Easier (means faster) processing of rows ✓ Files don’t depend on schema ✓ Binary search through index: O(log n) instead of O(n) • Is not supported in Scylla 3.0 - work in progress
  • 13.
    What Does ItMean For Users
  • 14.
    What Does ItMean For Users ▪ Files from Cassandra 3.x can be imported natively to Scylla ▪ Consider disabling compression for lower latency ▪ No reason to use compact tables any longer ▪ Better performance and disk space savings!
  • 15.
    What Does ItMean For Users In 3.0: ▪ Writing and reading SSTables 3.0. Old formats supported too. ▪ Upgrade of old SSTables to new format through compaction. In 3.x (future releases): ▪ Binary search through promoted index on sliced reads. ▪ Caching of promoted index blocks. ▪ Write in new format only (reading old formats still supported).
  • 16.
    Thank You Any Questions? Please stay in touch vladimir@scylladb.com @argenetix