Live data from Hacker News

Why SQLite is so great for the edge

blog.turso.tech

21–30 of 148 posts

Re: Why SQLite is so great for the edge

#21
post #19

I extensively used SQLite in a telemetry system for an electric race car. The car has an onboard computer, first a Raspberry Pi then a dual core Arm processor. Onboard code logs ~4000 messages a second into three SQLite databases. After a drive session a script merges the three databases into a single SQLite session log. The session log is decoded on a different computer to ~400 columns of time series data again stor…

This article isn't talking about the edge as embedded systems. It means cloudflare workers and the like.

Re: Why SQLite is so great for the edge

#23
> But WebAssembly goes way beyond browsers, and so does SQLite. Recent releases compile to WASI — a modular system interface for WebAssembly.

Wasm Labs group in VMware was involved with this.

See: "SQLite builds for WASI since 3.41.0" discussed at https://news.ycombinator.com/item?id=36054521

Re: Why SQLite is so great for the edge

#25
post #3

> It’s borderline impossible to compare it against networked database management systems like MySQL or Postgres, because SQLite is a library that operates on a local file — it bypasses all the costs incurred by the network, layers of serialization and deserialization, authentication, authorization, and more. Postgres can run locally, communicating via a Unix socket. You should try benchmarking this before stating tha…

I understood "networked database" to mean a client-server DB architecture. So that Postgres for example is running locally, but communicating with a local server.

Re: Why SQLite is so great for the edge

#26
post #18

What are the economics with SQLite on edge? Do I have to pay for a copy of the database in every edge location?

For FaaS and the like, I'd expect pricing schemes similar to cloudflare's https://blog.cloudflare.com/content/images/2023/05/Screensho...

This means you'd be paying per writes, reads and storage.

Re: Why SQLite is so great for the edge

#28
post #22

It's so insane that he links to a whole another post to clarify what he means by "the edge", and he struggles to state that in the first 5 paragraphs of it.

Well, the post "about the edge" also links to some announcement post there they "tried" to talk about the edge in more edgy details. Yet, it's like paragraph 67 on that 3rd post they were mention something about "the edge".

Re: Why SQLite is so great for the edge

#29
This no need to compile SQLite into your Cloudflare Worker. We provide it native on our platform as D1. And it gives you replication. https://blog.cloudflare.com/d1-turning-it-up-to-11/

Also, I think the idea of “edge” doesn’t make a ton of sense. What we really need is code and data that move around as needed for the best performance. See: https://blog.cloudflare.com/announcing-workers-smart-placeme...

What people call “edge” is a single optimization bringing code near the user. I think we should go far beyond that. Sure, use something like Cloudflare Workers for your “edge” needs (ie bringing your React app close to the end user/doing server side rendering). But don’t stop there because where data resides, what APIs you call are all going to matter.

That's the vision of something I called the "Supercloud": https://blog.cloudflare.com/welcome-to-the-supercloud-and-de...

Re: Why SQLite is so great for the edge

#30
post #14
post #10

Earlier quoted context omitted.

Poverty in terms of datatypes available to use.

Offhand, Date types are really strings in SQLite. Personally I'm not yet convinced that the normal SQL representation for what a 'date' object is matches real world use cases that well, or at least doesn't cover all of them. As a programmer, what I find I want is a 'moment' which retains the input specification. Possibly in a sanitized binary format that's not the literal text, but also isn't a single numeric value e…

> Offhand, Date types are really strings in SQLite.

It’s more that there’s no such thing as a date type, but that date and time functions can work with text or numbers, in a few different interpretations.

Documentation: https://www.sqlite.org/lang_datefunc.html.

Post reply on HN