News for hackers. Stuff that matters.
Re:IndexedDB is completely broken in latest Safari by throw_m239339 on Tuesday June 15, 2021 @08:28AM (#27514287)
> Because it’s actually very good!

It's built on top of Sqlite in Firefox, it isn't "low level". Give me Sqlite directly instead of that horrible stuff.

Re:IndexedDB is completely broken in latest Safari by crubier on Wednesday June 16, 2021 @03:46AM (#27525975)
What you say is the equivalent of saying « assembly is higher level than JavaScript because someone implemented a virtual machine that runs assembly code, in JavaScript in the browser ».

Just because someone used this technique for some technical reason does not change the fact that indexedDb is an API, is not built on top of SQLite, and is lower level, because you could build SQL databases on top of it.

Re:IndexedDB is completely broken in latest Safari by crubier on Tuesday June 15, 2021 @08:38AM (#27514375)
This is an implementation detail. The fact is that indexedDB API is lower level than SQL.
Re:IndexedDB is completely broken in latest Safari by throw_m239339 on Tuesday June 15, 2021 @08:50AM (#27514549)
> This is an implementation detail. The fact is that indexedDB API is lower level than SQL.

Why do you keep on claiming that? No it is not lower level than SQL. It's trivial to implement IndexedDB on top of of a SQL database. Good luck doing the other way around and that's the whole point of things. SQlite does everything IndexedDB does and more.... indexedDB isn't lower level, it's just more basic and limited. I have yet to see a SQL database equivalent to SQlite implemented on top of IndexedDB.

Re:IndexedDB is completely broken in latest Safari by crubier on Wednesday June 16, 2021 @03:42AM (#27525942)
indexedDb is an API. This API is more primitive and limited than SQL. This API is basically a key value store with indices and transactions. This is what many SQL databases are implemented on top of (Postgres for example).

So yes it is absolutely possible to implement a SQL database on top of indexed DB, and that would be the architecturally logical thing to do.

The fact that Firefox goes the other way around is an implementation detail. What they did is called « emulation »: run a low level interface on top of a higher level one. This technique is very common and does not mean that the abstraction levels of API are suddenly magically reversed. It’s just an implementation detail of the architecture.

You can run NES code in an emulator in JavaScript on the web. Does this make NES assembly higher level than JavaScript ? No.

Re:IndexedDB is completely broken in latest Safari by throw_m239339 on Wednesday June 16, 2021 @03:50AM (#27525989)
> indexedDb is an API. This API is more primitive and limited than SQL. This API is basically a key value store with indices and transactions. This is what many SQL databases are implemented on top of (Postgres for example).

SQL isn't an API. It's a language. Something to query a SQL database in the browser would constitute the API (thus WebSQL). You are mixing up language and API here. That's your first mistake.

> So yes it is absolutely possible to implement a SQL database on top of indexed DB, and that would be the architecturally logical thing to do.

And it's trivial to implement indexedDB over Sqlite, in fact, that's what Firefox did.

Where is the other way around? Where are RDBMS implemented on top of indexedDB?

> The fact that Firefox goes the other way around is an implementation detail.

No it isn't. It demonstrates my point entirely, that it is trivial to implement indexedDB on top of Sqlite, which makes Mozilla developers a bunch of hypocrites for not letting developers access an Sql layer directly.

Re:IndexedDB is completely broken in latest Safari by crubier on Thursday June 17, 2021 @05:14AM (#27537637)
Ok, look, I disagree.

I'll let you try to reconcile yourself about why "Mozilla developers are a bunch of hypocrites". I presented to you a very straightforward explanation that does not imply bad intent from an entire group of people.

I am sorry that this explanation does not fit your world view.

To me, what you say is the equivalent of saying « assembly is higher level than JavaScript because someone implemented a virtual machine that runs assembly code, in JavaScript in the browser ».

Just because someone at Mozilla used this technique for some technical reason (it is indeed often easier to emulate low level stuff on top of high level stuff, rather than the opposite) does not change the fact that IndexedDB is an API, is not built on top of SQLite, and is lower level than any API based SQL.

Re:IndexedDB is completely broken in latest Safari by hitekker on Tuesday June 15, 2021 @01:21PM (#27518491)
"Lower level" is a basic software engineering shorthand for minimal abstraction.

https://computersciencewiki.org/index.php/Higher_level_and_l...

IndexedDB builds on top of SQLite, so it's considered "higher-level", not lower level.

Re:IndexedDB is completely broken in latest Safari by crubier on Wednesday June 16, 2021 @03:43AM (#27525953)
Indexeddb is not built on top of SQLite. IndexedDb is an API. This API is more primitive and limited than SQL. This API is basically a key value store with indices and transactions. This is what many SQL databases are implemented on top of (Postgres for example).

So yes it is absolutely possible to implement a SQL database on top of indexed DB, and that would be the architecturally logical thing to do.

The fact that Firefox goes the other way around is an implementation detail. What they did is called « emulation »: run a low level interface on top of a higher level one. This technique is very common and does not mean that the abstraction levels of API are suddenly magically reversed. It’s just an implementation detail of the architecture.

You can run NES code in an emulator in JavaScript on the web. Does this make NES assembly higher level than JavaScript ? No.