Live data from Hacker News

Json-Base – Database built as JSON files

github.com

21–30 of 189 posts

Re: Json-Base – Database built as JSON files

#21
post #7

Sounds like how MongoDB was born. I believe that has made a lot of people very angry and been widely regarded as a bad move.

Was my first thought as well. Mongo stores things as BSON rather than JSON but that feels more or less like an implementation detail.

Re: Json-Base – Database built as JSON files

#22
post #18

I work on a system with a JSONB column with 11k unique paths with no schema. I created some tools to generate jsdoc which is a start, but please no.

Are there tools which will scan a body of JSON and and generate all the unique paths? Is it common to do this?

Re: Json-Base – Database built as JSON files

#23
post #11

I don't mean this negatively, but I'm having trouble thinking of a real-world use case for this. Can anyone add some?

Looks a bit like https://github.com/typicode/lowdb, which I've used for a few production-ish usecases in the past.

Specifically for storing the results/state of a set of manually-executed management scripts. The scripts needed to query the data from previous executions, do some stuff, and store the output. Think poor mans version of terraform.

Everything was dumped in a git repo that was shared across a few people. It was a quick and dirty solution to manage some alpha customers before the "real" system came online.

Re: Json-Base – Database built as JSON files

#24
So much pessimism! Not sure if the author is here, but it would be interesting to hear what makes this different from, say, Lowdb.

Also, the writing in the README feels sloppy, which doesn’t inspire confidence. For example, you might want to decide if it’s called jsonbase, JSON-base, JSONBASe, Json-Base, JSON-Base, json-base or jsonDB.

Re: Json-Base – Database built as JSON files

#26
post #16

Someone at my old company basically did this and put it into production. The first problem he encountered was that multiple connections couldn't both be using the database at a time without clobbering each other. "No problem," he thought, this is a good use case for micro services. A service sitting on top would ensure that there was only one operation being performed at a time. Next, his problem was that the databas…

AFAICT (not being Node-fluent) this doesn't even use atomic file writing strategies :| So yeah, all of these are pretty likely to happen with this lib.

Just use SQLite, people. Even JSON-in-SQLite is still likely to be an improvement.

Re: Json-Base – Database built as JSON files

#27
post #18

I work on a system with a JSONB column with 11k unique paths with no schema. I created some tools to generate jsdoc which is a start, but please no.

Are there tools which will scan a body of JSON and and generate all the unique paths? Is it common to do this?

It's pretty easy to do. Also, a common interview question. :)

Re: Json-Base – Database built as JSON files

#29
post #10

It's all fun and games until this ends up in somebody's production environment.

And there's never a serious consequence to the ones who did it. By then they switched to a new position somewhere else. Like most prima donnas. And this shows that deep, deep down they know they are fake.

Re: Json-Base – Database built as JSON files

#30
post #12

JSON file as backend, So can I directly edit the JSON file?

Bind does something like this (but not with JSON).

You have to run a “freeze” command before editing the database directly (so it can flush the current version of the database, and redirect writes to memory + log), and then “thaw” so it can read your changes and apply the log of updates to it.

Post reply on HN