| Cool project. Have you known that PostgreSQL was initially written in Lisp? > By a process of elimination, we decided to try writing POSTGRES in LISP. We expected that it
would be especially easy to write the optimizer and inference engine in LISP, since both are mostly tree processing modules. Moreover, we were seduced by AI claims of high programmer productivity for applications written in LISP. > We soon realized that parts of the system were more easily coded in C, for example the buffer
manager which moves 8K pages back and forth to the disk and uses a modified LRU algorithm to control
what pages are resident. Hence, we adopted the policy that we would use both C and LISP and code
modules of POSTGRES in whichever language was most appropriate. By the time Version 1 was operational, it contained about 17000 lines of LISP and about 63000 lines of C. src: https://dsf.berkeley.edu/papers/ERL-M90-34.pdf It also had time travel (from the same paper): > Lastly, POSTGRES supports the notion of time travel. This feature allows a user to run historical
queries. For example to find the salary of Sam at time T one would query: retrieve (EMP.salary)
using EMP [T]
where EMP.name = "Sam"
> POSTGRES will automatically find the version of Sam’s record valid at the correct time and get the
appropriate salary.Regarding your project: > Databases are implemented as directories containing one file per table. PostgreSQL splits tables into 1 GB segments (1 segment is one file). This is done for filesystems that can't have large files. Isn't one file per DB too limiting in that regard? Are you aiming to be ACID compliant? Can you expand on 'versioned'? PostgreSQL achieves that with copy-on-write, did you take the same approach? I quickly looked over the code, it's been a while since I read some lisp. The on-disk representation seems to be just key value records where each record can be a sexp(?). Where is the relational part and do you plan to implement a query language? |
I'm aiming to be as ACID as makes sense for a project this scale, it's slowly getting there.
The disk format is straight Lisp, I want it human readable and easy to process. Versioning is a consequence of the log format and tracking the different versions in memory.
By relational I mean based on tables, or relations; take away SQL and it's more or less the same thing.
No query languages planned, I strongly prefer an API to a query language for interfacing with the database.