2. Manage access to it through a server
There you go, you know have a database.
2. Manage access to it through a server
There you go, you know have a database.
2. Draw the rest of the owl
It uses mmap.
All databases that are any different than these two points are just bad.
This has real "draw the rest of the owl" energy.
How to make a DBMS? 1. Get a file 2. Make a DBMS
Complex when you want to
> 2. Manage access to it through a server
A database is only "easy" IF:
- Append only
- No real "delete" or "updates" just to reiterate the above.
- Only Sequential scan
- Only need simple iterator-per-row
- No maintain secondary stuff like indexes, so not need to coordinate changes
- No concurrency
- Fit in RAM, and I mean in few MB
- No need to deal with SQL, use his own DSL (sql is so bad! so much weird stuff!, but is ok to have something sql-ish like LINQ)
- No need to deal with recursive data types, only scalars
- Is only embebed
- No need auth or security validations
Ok, after making this list, I sure forgot some other tips to make this easy!
Obviously you'd have a file per column (or index), and use directories to represent tables.
This is the correct way of doing it and yet so few databases do it.
mmap is not a panacea, it improves specific access patterns by incurring specific costs, it's definitely not true that mmap is the right choice for all databases
Of course, depending on the other things of the list this is or not a major issue. Is more about how combining several ideas leads to a easy or complex implementation.
why does generating indexes at start-up not count as having indexes?
(asking because i do this all the time)
This system was rarely restarted, so in practice it didn't matter what it did at startup, as long as it didn't take more than a few minutes, but it did place some limitations on data size. (This was a 32-bit system and everything was memory mapped.)
There you go!
it feels correct, even though it's not a complete guide
(reliably persisting changes to disk is a big part of what dbs do, but is missing here)