3 ms·
On the topic of PostgreSQL and git. As crazy as this sounds, I once entertained the idea of writing a VCS that used PostgreSQL's large object facility for stori
by quectophoton 3y ago
On the topic of PostgreSQL and git. As crazy as this sounds, I once entertained the idea of writing a VCS that used PostgreSQL's large object facility for storing the data. I always have PostgreSQL installed on my personal devices so communication would be through Unix Domain Sockets anyway (or through a gigabit LAN in worst case). And the transactions and SQL interface (for metadata) were just that tempting.
But I realized pg_largeobject (1) chunks data to around 2kB per chunk, and (2) stores each chunk on its own row, and (3) each row uses "oid" type as identifier, which is just 32 bit long. It's probably large enough for anything I would ever need, but for some reason I don't feel comfortable with only 32 bits as primary key.
- pstuart 3y agoNot entirely crazy. The creater of SQLite has done just that: https://fossil-scm.org/home/doc/trunk/www/index.wiki https://fossil-scm.org/home/doc/trunk/www/index.wiki
- wodenokoto 3y agoYou probably already know of fossil, which is based on SQLite, but just in case, I’ll share a link with you: https://sqlite.org/whynotgit.html https://sqlite.org/whynotgit.html
- galaxyLogic 3y agoWhy not git? Specifically as relates to the current discussion?
- entropicdrifter 3y agoAssuming that the full 32 bits are used, that means there can be up to 4,294,967,295 chunks. 4,294,967,295 * 2 = 8,589,934,590 KB So, around 8.5 TB. Unless your hypothetical VCS is for a large library of videos, you should be fine