{"repo":"jauhararifin/dbshark","free":true,"listed":false,"github":"https://github.com/jauhararifin/dbshark","clone":"git clone https://github.com/jauhararifin/dbshark.git","description":"A very simple embedded Btree-based key-value database inspired by BoltDB","language":"Rust","stars":14,"topics":["btree","database","key-value","rust"],"license":null,"category":"databases-storage","readme_excerpt":"DBShark DBShark is an embedded key-value B+tree-based database inspired by boltdb. [!WARNING] This project is a work-in-progress. Some of key features are: - Embedded - Key-value store - Range query - Serializable isolation level - Crash-safe - Transactions are atomic - Allow rollback - Concurrent read transaction - Write transactions are exclusive Limitation: - Currently, it's only working for linux - No delete operation yet - Only allow single instance Design So, dbshark is a key-value store database I built using btree. Nothing fancy here - it supports the usual stuff you'd expect: you can have one write transaction or multiple read transactions running at the same time (yeah, it's serializable). You can do inserts, lookups, and range queries, pretty much like you'd use a BTreeMap in Rust. I made it durable by using WAL and taking snapshots every now and then. Really, there's nothing new about the design - I pretty much followed what they teach in the CMU database series. B+Tree Let me tell you how the btree part works. The whole database is basically made up of buckets. Each bucket is a btree, and there's one root btree that keeps track of all the other buckets. Each page in the database is about 4KB (you can change this if you want), and every node in the btree is just a page in the main database file. The keys and values are just bytes - nothing special about them. We sort the keys by comparing the bytes one by one. Sometimes you might have a key and value that's too bi","default_branch":null,"files":null,"tree":[],"storefront":"/r/jauhararifin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jauhararifin/dbshark/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}