ext4 is a mature tool for this style workflow
Yes. It's called a filesystem.
Json is for humans, not for storage
Tell that to postgres's json and json. But you're completely correct here, just because you can do something doesn't mean it's a good idea.
Json is for humans, not for storage
JSON is not for humans. If I pcan't write arbitrary multi-line comments](https://jsonfmt.org/guides/comments-in-json/) in the text file, it's not for humans.
JSON is, as described by the standard defining it, for computers talking to each other:
JSON is a […] syntax for defining data interchange formats.
If you want a format writable and readable by humans? We deserve better.
In principle, you're looking for a "document-oriented database": https://en.wikipedia.org/wiki/Document-oriented_database
CouchDB is what I usually see recommended as an alternative to MongoDB and might fit your bill (although I haven't worked with it yet): https://couchdb.apache.org/
Maybe PostgreSQL with JSON Extension
There's duckdb.
SQLite can do it too, but I've seen a lot of praise for DuckDB recently. The duck is worth trying.
Json-ld and sparql?
Jq is a non SQL JSON query language.
Maybe a different kind of solution to what you're looking for, but JSON-LD does this in a distributed (multi-system) manner. Maybe a little more distributed than you want, though.
Essentially, you can use IRIs (and IRI references) to point to specific objects/subtrees. The thing is, IRIs are usually dereferenceable as URLs that point to the object's value, so you'd use a HTTP client to fetch it in order to dereference the data.
It's used by Lemmy of course (and ActivityPub in general), and it's mostly designed when you have different people publishing JSON documents that want to link to each other.
More along the lines of what you're probably looking for is any NoSQL document database. You want to be able to set an index within the document that the database can use for fast lookups. There's a ton out there, so not much point listing them here when you can find lists online very easily.
Personally, I'd rather just use a SQL database for this though. To begin with, you wouldn't design your database to be a single, large, ever-growing JSON document, but rather several JSON documents (one per "object" being stored, like one per user). This allows your distributed database to split the load on requests coming in via sharding as well as help it quickly find what you're looking for (assuming your query is on an indexed key). SQL databases let you better structure the data you actually intend to query on (IDs, names, whatever), and you can put whatever other attached data you want as a JSON field (Postgres JSONB for example).
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev