its not better than any other db; but u know what, its something I made
This is a project, where i try to build a db from scratch in goLang. my aim? to build postgreSQL; ohh u mean realistically? to reach as near as possible to sqlite.
Benchmarks: /dev/bench
- Append only upserting / deletion
- greedily searching for key in reverse
- segmenations
- Compaction (file replacement based)
- CI (tests & benchmark tracking)
- Indexing & Snapshots
- ./golphin set key value
- ./golphin get key
- ./golphin delete key
- dont know yet.
- [DONE] Working on Indexing now: I'll start with creating the index on every run, and then optimize this by saving snapshot in a tmp file
- TUI for state to live in memory; currently cli makes the memory
- Create a daemon (background running service), like a server maybe -- note this is postgres
- How does sqlite works? its serverless u know.
Currently we have an append only disk storage + hashmap cache ie.
| Operation | Time Complexite | Space Complexity | Storage type dependent |
|---|---|---|---|
| Insert | O(1) | O(1) | DISK |
| Update | O(1) | O(1) | DISK |
| Delete | O(1) | O(1) | DISK |
| Read | O(1) | O(1) | Cache (in-memory) |
| Range Read | Θ(n) | O(1) | Cache (in-memory) |
| Compaction | O(n) | O(1) | DISK |
since this is not sorted we are now introducing Binary Search Trees
| Operation | Time Complexite | Space Complexity | Storage type dependent |
|---|---|---|---|
| Insert | O(logn) | O(1) | DISK |
| Update | O(logn) | O(1) | DISK |
| Delete | O(logn) | O(1) | DISK |
| Read | O(logn) | O(1) | Cache (in-memory) |
| Range Read | Θ(2 * logn) | O(1) | Cache (in-memory) |
| Compaction | O(n) | O(1) | DISK |
:love: from parthkapoor