Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data partitioning/Column families #15

Closed
marvin-j97 opened this issue Dec 18, 2023 · 1 comment
Closed

Data partitioning/Column families #15

marvin-j97 opened this issue Dec 18, 2023 · 1 comment
Labels
breaking enhancement New feature or request epic

Comments

@marvin-j97
Copy link
Collaborator

marvin-j97 commented Dec 18, 2023

Column families/partitions are the missing piece to having a great storage engine. Each column family is its own partition inside the LSM, but all share the same journal, enabling atomic writes. So each column family is physically stored separately from the others. Compaction then looks at each partition instead, never mixing tables of different partitions. It's like a big meta-LSM tree, instead of using multiple trees, which don't have atomic semantics, unless putting another super structure on top. That super structure will be the new LSM tree which contains partitions basically. Compaction may even be set differently for each column family.

image

When creating no column family, everything gets put into the "default" column family.
Creating column families is pretty simple, you add a new memtable. Dropping a column family is simple. Delete its memtable and all the segments inside the partition. The journal needs to be handled accordingly, because flushing one column family doesn't necessarily mean the others are flushed too. And if the column family was deleted, the journal should not flush parts to the partition at all.

There needs to be new semantics for writing to a column family:

  • insert(col_family, key, value)
  • remove(col_family, key)
  • batch() ... needs col_family support

https://github.com/facebook/rocksdb/wiki/Column-Families

Example use cases

  • One partition could be an index in a relational database for example, so writing a row into "default" also atomically inserts/updates rows inside "index-1" (https://github.com/facebook/mysql-5.6/wiki/MyRocks-data-dictionary-format)
  • Dropping the index just drops the column family "index-1", which is a O(1) operation
  • another example would be locality groups in Bigtable and column families in RocksDB and Cassandra
@marvin-j97 marvin-j97 added enhancement New feature or request epic labels Dec 18, 2023
@marvin-j97 marvin-j97 pinned this issue Dec 18, 2023
@marvin-j97
Copy link
Collaborator Author

marvin-j97 commented Jan 6, 2024

Unbenannt-2022-12-03-1556
Architecture first pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request epic
Projects
None yet
Development

No branches or pull requests

1 participant