Live data from Hacker News

Show HN: NoSQL, but it's SQLite

gist.github.com

11–20 of 48 posts

Re: Show HN: NoSQL, but it's SQLite

#11
> Built with o1.

Yes, yes, database with AI written code. NoSQL with a database that can't be trusted with your data? I. have. seen. this. before. To quote a classic:

> I suggest you pipe your data to devnull it will be very fast

In defense of the database that video was about, I worked as a software architect for the company which became the first commercial user of it, Eliot hilariously didn't want to accept money for support at first. Good old days. However, around 2015 when all three large open source SQL databases --- SQLite, PostgreSQL, MySQL -- added JSON support I felt there was no more need for these NoSQL systems, though.

Re: Show HN: NoSQL, but it's SQLite

#17
post #10
post #6

Earlier quoted context omitted.

Why ??

How do you query json with SQL server like let's say you have one data point like this { "id": 42, "quantity": 12, bla bla bla And you want rows where this column has quantity and quantity ≥ 20 How do you do it if you encode everything as base 64?

You slap a full text index on the base64 string. There's only a finite number of base64 substrings for the un-encoded substrings "id", 42, etcetera, so you first filter on those. Then you decode those full strings into json and do the final filtering application side. Easy!

Re: Show HN: NoSQL, but it's SQLite

#18
post #12

Couchbase mobile has been doing this for over a decade and early versions of membase 15 years ago were using a sqlite backend as a noSQL JSON datastore

I'm using something like this for a small personal project that's only going to have a couple of users. Basically, just an app for myself and my girlfriend for all of the various restaurants, movies, recipes, tv shows, locations, etc. that we plan to go to/do at some point in the future. It's basically just a glorified todo list that uses APIs (TheMovieDataBase, OpenStreetMap, etc.) to grab additional metadata and images to present everything nicely

I want us both to be able to make notes/add ratings to each item, so the set of tables looks like this:

    - TodoItems
    - Notes
    - Ratings
Where every TodoItem can have multiple Ratings/Notes attached. Because each of the TodoItems is going to be of a different type with different metadata depending on the type of item (IMDB/TMDB id, image url, GPS location), and I want it to be extensible in future, its schema has ended up looking like this:

    CREATE TABLE TodoItems (
      id INTEGER PRIMARY KEY NOT NULL,
      kind TEXT NOT NULL,
      metadata BLOB NOT NULL
    );
With SQLite's json manipulation functions, it's actually pretty pleasant to work with. As it grows I might end up adding some indexes, but for now the performance seems like it will be fine for this very low traffic use case. And it makes deployment and backups incredibly simple.

Re: Show HN: NoSQL, but it's SQLite

#19
post #10
post #6

Earlier quoted context omitted.

Why ??

How do you query json with SQL server like let's say you have one data point like this { "id": 42, "quantity": 12, bla bla bla And you want rows where this column has quantity and quantity ≥ 20 How do you do it if you encode everything as base 64?

have col names id, quantity, json and greaterthan20

Re: Show HN: NoSQL, but it's SQLite

#20
post #12

Couchbase mobile has been doing this for over a decade and early versions of membase 15 years ago were using a sqlite backend as a noSQL JSON datastore

Postgres added native support for JSON in 2012. People have been using RDBMS to store denormalized data and even as a key-value store for way longer than that. In fact, it's very hard not to do that
Post reply on HN