←back to thread

Sqlite3 WebAssembly

(sqlite.org)
506 points whatever3 | 4 comments | | HN request time: 0.603s | source
Show context
TiredGuy ◴[] No.41851263[source]
So after downloading from the official downloads page and stripping away all the mjs files and "bundler-friendly" files, a minimal sqlite wasm dependency will be about 1.3MB.

For an in-browser app, that seems a bit much but of course wasm runs in other places these days where it might make more sense.

replies(8): >>41851337 #>>41851618 #>>41851622 #>>41851724 #>>41851840 #>>41852258 #>>41854092 #>>41855860 #
coder543 ◴[] No.41851724[source]
1.3MB seems perfectly reasonable in a modern web app, especially since it will be cached after the first visit to the site.

If you’re just storing user preferences, obviously don’t download SQLite for your web app just to do that… but if you’re doing something that benefits from a full database, don’t fret so much about 1MB that you go try to reinvent the wheel for no reason.

If the other comment is correct, then it won’t even be 1.3MB on the network anyways.

replies(1): >>41851925 #
1. telotortium ◴[] No.41851925[source]
A megabyte here, a megabyte there, pretty soon you’re talking about a really heavyweight app.
replies(3): >>41852353 #>>41852576 #>>41856577 #
2. zdragnar ◴[] No.41852353[source]
Given how hefty images are, a full database doesn't seem too bad for the purpose of an "app" that would benefit from it, especially when compression can being the size down even lower.
3. littlecranky67 ◴[] No.41852576[source]
We are past the stage where every piece of JS has to be loaded upfront and delay the first meaningful paint. Modern JS frameworks and module are chunked and can be eager/lazy loaded. Unless you make the sqlite DB integral part for your first meaningful page load, preloading those 1.3MB in the background/upon user request is easy.
4. Dylan16807 ◴[] No.41856577[source]
By the time you have a good reason to add this library, I think you're already in heavyweight app territory.