DEV Community

Cover image for Cache, Store, and Serve All in One: Manage Your Website with SQLite Power
Víctor García
Víctor García

Posted on

2 1 1 1 1

Cache, Store, and Serve All in One: Manage Your Website with SQLite Power

Query is a one-file system that uses SQLite to cover most of the full-stack development and infrastructure needs for small websites.

Query Mental Model

This is a mental model to guide you when working with Query.

  1. I do not need a database server (PostgreSQL or MySQL), as I can connect to my SQLite databases remotely using the Query APIs, the CLI, and the functions.
  2. I do not need a JavaScript runtime (NodeJS, Deno, or Bun), as Query offers its own.
  3. I do not need a JavaScript backend framework (NextJS, Remix or Astro), as Query provides functions to serve Pages and APIs.
  4. I do not need a caching system (Redis) for my function, as Query caches them in SQLite and serves them.
  5. I do not need a storage system (S3) for my assets, as Query stores them in SQLite and serves them.
  6. I do not need a scaffolding tool to generate code, as Query offers its own.
  7. I do not need to develop a back office admin area, thanks to the Query generator, as I can build one just by executing a command.
  8. I can deploy in a couple of seconds to Query.
  9. I can distribute it in multiple regions, thanks to Fly.io and LiteFS.

The following links are related to each mental model concept.

[1] Query API
[1] Shell
[1] Functions

[2] Query JavaScript Runtime
[2] Runtime Compatibility

[3] Functions
[3] File-System Based Router

[4] Query Cache Control

[5] Query Generator

[6] Assets

[7] Query Generator
[7] Query Generator Templates

[8] Query Function CLI
[8] Query Assets CLI

[9] Fly.io
[9] LiteFS

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (1)

Collapse
 
harshthedev profile image
Harsh Singh

Great article! I am working on an open-source DSL which will give superpowers to SQLite. Here is the article I wrote: dev.to/harshthedev/meet-rayql-a-sc...

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay