4 ms·
> indexes them in a local SQLite DB. I don't really understand this. I've been in computing for 45 years now. Programs come and go. I store files I want to kee
by WalterBright 6y ago
> indexes them in a local SQLite DB.
I don't really understand this. I've been in computing for 45 years now. Programs come and go. I store files I want to keep in the most generic format practical. Storing a file in some program's special format is not a good plan for reading it 40 years from now.
For photos, I store them as jpgs in folders named after the year. Within those folders, there might be sub-folders named with a topic, like "disneyland" or "christmas". I'll "tag" photos by selecting a name for the jpg, like "bob and sue.jpg".
If more is needed, I'll just add a "notes.txt" file in the folder, with whatever text seems appropriate.
I have no worries about ascii text becoming unreadable, and few worries about jpgs becoming unreadable.
- mholt 6y agoPlease don't misunderstand, with your 45 years of computing experience. :) (which I highly respect) I never said the files are stored in sqlite. They are just indexed in sqlite. The files are stored on disk like normal.
- peterwwillis 6y ago> Please don't misunderstand If there's one thing people will always do regardless of age, it's that.
- Retric 6y agoMetadata is more useful with older photos. Right now it’s obvious who’s in them, but in 40 years being able to just put names to faces can be difficult.
- WalterBright 6y agoI just note their names in the file name. If there are too many, I make a copy of the photo, bring it up in an image editor, and type the names of the people next to their heads. It works like a champ.
- ForHackernews 6y agoTBF SQLite format is also extremely unlikely to become unreadable: https://www.sqlite.org/fileformat2.html https://www.sqlite.org/fileformat2.html
- phoe-krk 6y agoSQLite is an ubiquitous and well-tested piece of software that is going to stand the test of time and survive the next twenty years. There are very few pieces of software that I am able to praise like that with a clean conscience; SQLite is definitely one of them though. You might find it worthwhile to read e.g. about its memory allocation strategy, or its testing strategy. Also, I don't think that the image files themselves are stored in the SQLite DB file; likely just their indices and metadata.
- WalterBright 6y ago> likely just their indices and metadata notes.txt will work just fine, then, even for several thousand photos. I don't see a need for a database until you've got far more than that. The tree file system works tolerably well as a "database". As for searching, I know how to use "grep" and "locate".
- joshuamorton 6y agoTags are more flexible than folders. An actual index let's you search by tag. Folders don't let you search for all photos of your mother, or in 1987, or in Alabama, or some combination thereof. Folders are a limiting api and we shouldn't limit ourselves to strictly hierarchical organizational structures for non hierarchal data.
- WalterBright 6y agoI know, but folders work perfectly fine even up to a few thousand files. It doesn't take me long to find a vacation picture from 1966, for example. I look in the 1966 folder, which doesn't have a lot in it. The preview thumbnails from file explorer quickly let me hone in. It'd take me far more time to set up a proper tag database than I'd save looking things up. It's still infinitely better than a random shoebox with random snapshots in it.
- sokoloff 6y agoLooking up something by its clustered index is indeed pretty easy. That's not the only access pattern into most data sets, which is where tags can be handy. I agree with your last two points, as my family's digital photos are also stored in a fairly similar clustered index style where you have to know the date at least pretty closely to start your search unless you want to scan "all Thanksgivings" [which itself is just a series of clustered index lookups]
- e_y_ 6y agoIt would be easy enough to use the SQLite DB for normal read/write and search, and also save a human readable .txt dump periodically such as when making backups, or asynchronously on every save.
- zeroxfe 6y agoBits rot. If you want your data to last the next 40 years, plan for spending a few hours every 5 years migrating your storage. It's a far better plan than trying to predict what the world will be like 40 years from now.
- WalterBright 6y agoAbsolutely. I buy new drives every year or so and copy the stuff forward. Many of my 10+ year old drives no longer function.
- megablast 6y ago45 years experience, and your first thought is that they are being stored as a binary blob in a database??
- WalterBright 6y agoYes. Binary file formats are common (like Microsoft Outlook, pdf files, etc.), and are very fast to read/write. Text files have to be parsed. I've written lots and lots of dumpers for binary file formats generated by other programs.
- mholt 6y agoOof, I feel the trauma on this one. I've been bitten by too many binary file formats that I don't care to store aggregate amounts of content in them (unless it's just metadata).
- kristopolous 6y agoCreating a cadence that also stores the data in EXIF isn't really that hard if that's your concern. You could even get SQLite triggers to do external calls to update the tags if things change. This is all pretty trivial.