Hacker News new | past | comments | ask | show | jobs | submit login

Wonder why SQLite was chosen over a key value store. Seems he wanted reads by id and no other columns so a relational db seems unnecessary?



Could have, yeah. Could have also just have created a temporary table in mariadb.

SQLite has the benefit that it's a single file though, and you can do cool things with that. Such as copy it, share it, etc.


I'd just like to put an opposite vote on the scale and say that SQLite is such an excellent default choice for this and you were right to do it this way. I can't really see why people argue for databases which have the "relationality" feature deliberately removed.


Maybe I'm old school but I would just stuff that kind of data in a struct. It should be real, real small as a packed binary tree. just mmap the file and be there. If you're never writing to it, or only write to it via filesystem full-file overwrites, you can lay it out most conveniently in memory. We did a similar thing with the sparse matrix data for the Netflix prize back in the day - in a database it was 6gb, in C structs it was ~600mb.

Of course I do respect the encapsulation of the existing SQL query basis but there is sometimes a time for something even more compact.


Yeah tempting for sure. I tried to resist it on the basis that I already have a bunch of similar solutions in the system, and while they're fast and effective, they're also always a bit of a headache to maintain and debug; and this isn't something that is extremely space constrained.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: