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.

  • TehPers ( TehPers@beehaw.org ) 
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 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).