Using SQLite as Storage for Web Server Static Content

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
Stream - Scalable APIs for Chat, Feeds, Moderation, & Video.
Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.
getstream.io
featured
  1. monorepo

    lix (change control system) && inlang (globalization ecosystem for software built on lix)

    the types kysely implemented are crazy. even custom where clause like this one [0] are typesafe :O

    [0] https://github.com/opral/monorepo/blob/99356e577f558f4442a95...

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. kysely

    A type-safe TypeScript SQL query builder

    We also came around to dumping files into SQLite instead of dealing with the filesystem (and git) for the lix change control system. This article touches on problems we encountered: https://opral.substack.com/i/150054233/breaking-git-compatib....

    - File locking, concurrency, etc., are problems that SQLite solves

    - Using SQLite allows drumroll SQL instead of platform-dependent fs APIs

    - Using SQL queries is typesafe with Kysely https://kysely.dev/ (without the need of an ORM)

  4. apps

    Clace web applications (by claceio)

    Clace can be used to build hypermedia driven UI's, using Go templates and HTMX. https://clace.io/docs/develop/templates/#static-function gives the content hashed file name, the templates have to use that function. See https://github.com/claceio/apps/blob/f5566cea6061ec85ea59495... for an example, that game is running live at https://cowbull.co/

    Clace can also run containers, where the UI is served by the container. For example, Streamlit/Gradio based apps. In that case, Clace acts like an app server and reverse proxy to the container, no file name rewrites are done.

    Clace includes esbuild for being able to import npm packages as ES modules https://clace.io/docs/develop/javascript/. There is no support for any JS bundling.

  5. hashfs

    Implementation of io/fs.FS that appends SHA256 hashes to filenames to allow for aggressive HTTP caching.

    In terms of performance, the content hash based file name approach is easier to implement with SQLite storage. The content hash has to be generated just once during file upload, not every time the web server is restarted (or using a build step which does actual file renames). It is possible to do it dynamically for file system files (see https://github.com/benbjohnson/hashfs for a embedFS implementation), but the database makes it a bit easier.

  6. sqlite

    sqlite mirror (by smparkes)

    From Appropriate Uses For SQLite - https://www.sqlite.org/whentouse.html :

    > The amount of web traffic that SQLite can handle depends on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic ... The SQLite website (https://www.sqlite.org/) uses SQLite itself, of course, and as of this writing (2015) it handles about 400K to 500K HTTP requests per day, about 15-20% of which are dynamic pages touching the database. Dynamic content uses about 200 SQL statements per webpage. This setup runs on a single VM that shares a physical server with 23 others and yet still keeps the load average below 0.1 most of the time. See also: https://news.ycombinator.com/item?id=33975635

  7. wddbfs

    webdavfs provider which can read the contents of sqlite databases

  8. litestream

    Streaming replication for SQLite.

    If you mean how do backups, there are tools like https://litestream.io/ which help with SQLite backup to S3 (or other cloud storage)

  9. Stream

    Stream - Scalable APIs for Chat, Feeds, Moderation, & Video. Stream helps developers build engaging apps that scale to millions with performant and flexible Chat, Feeds, Moderation, and Video APIs and SDKs powered by a global edge network and enterprise-grade infrastructure.

    Stream logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Detox for i18n

    2 projects | /r/vuejs | 22 May 2023
  • What localizations options are there for NextJS static export builds?

    1 project | /r/reactjs | 19 May 2023
  • i18n support is not compatible with next export.

    1 project | /r/nextjs | 6 Apr 2023
  • introducing code-first-i18n (internationalization)

    3 projects | /r/dotnet | 5 Feb 2023
  • i18n and i18next: What's the difference?

    1 project | dev.to | 24 Jan 2023