15

Say you wanted a database inside a huge distributed JSON file that scaled vertically.

So that get("users.jane33"), pulls Jane33's profile.

Are there any specs for that? I've seen MongoDB, but no longer like its license.

I'm thinking a DHT with pointers, and raw data blobs. But would like to see what's already working.

top 32 comments
sorted by: hot top new old
[-] lntl@lemmy.sdf.org 6 points 9 hours ago

ext4 is a mature tool for this style workflow

[-] badmin@lemmy.today 7 points 10 hours ago

Yes. It's called a filesystem.

[-] bananabread@lemmy.zip 8 points 11 hours ago

Json is for humans, not for storage

[-] IMALlama@lemmy.world 1 points 1 hour ago

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.

[-] bignose@programming.dev 1 points 1 hour ago* (last edited 1 hour ago)

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.

[-] Ephera@lemmy.ml 13 points 14 hours ago

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/

[-] r4mp@lemmy.zip 12 points 15 hours ago

Maybe PostgreSQL with JSON Extension

[-] ViatorOmnium@piefed.social 12 points 15 hours ago* (last edited 15 hours ago)
[-] one_old_coder@piefed.social 2 points 15 hours ago

SQLite can do it too, but I've seen a lot of praise for DuckDB recently. The duck is worth trying.

[-] practisevoodoo@lemmy.world 1 points 9 hours ago

Json-ld and sparql?

[-] wet_bones@lemmy.4d2.org 6 points 15 hours ago

Jq is a non SQL JSON query language.

[-] TehPers@beehaw.org 2 points 13 hours ago

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).

this post was submitted on 29 Nov 2026
15 points (69.2% liked)

Programming

29423 readers
468 users here now

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



founded 3 years ago
MODERATORS