HACKER Q&A
📣 dave_4_bagels

Elegant way to store chain of custody in DB WITHOUT BLOCKCHAIN


Hi Hn,

I'm building a tool to aid tracking cuttings of rare plants I've started cultivating via tissue culture during covid. For those who are interested, I've also started cultivating clones of endangered and rare redwood trees.

For a while I had a spreadsheet that I used to track the provenance of tissue samples from the field all the way through my lab processes into new sprouts / saplings. This quickly became a mess and broke down when I accidentally erased my sharpie markings when sterilizing lab equipment with isopropyl / bleach solution.

Postgres seems to be a horrible option for this kind of chain of custody problem. In essence I would like to have a system that can easily query the chain of previous "tissue sources" from a current sample. It seems like a proper "graph" database might be a better choice? Also, I understand that a tree or static data structure would be ideal for this - however I really prefer to use a database of some kind for this.

Ideally, I'd like to have a system that can generate info and store it in a pdf417 qr code that will be printed and affixed to samples, saplings, files etc in order to tie a digital record to each physical step of growing a plant from tissue sample to tissue culture and later to an actual plant with roots.

I'm a somewhat green developer and the front end of this problem is quite simple - however open to any cool ideas or request for collaboration!

Thanks!


  👤 tlb Accepted Answer ✓
Relational databases like Postgres are great for storing graphs! So-called "graph databases" have some performance advantages at really massive scale, like Facebook/Twitter scale where they have to scan all your friends for every page view. But unless you're doing millions of lookups per second, Postgres will work great.