Skip to content

Default to opening files in mutable mode, special option for immutable files #419

@simonw

Description

@simonw

One of the original ideas behind Datasette was that serving immutable data makes everything way easier. Two examples: You don't have to worry about SQLite concurrency and you can bundle the database inside a Docker container and deploy it to immutable hosting. See The interesting ideas in Datasette for more on this.

I'm beginning to see a much stronger case for being able to serve mutable data as well.

SQLite is actually perfectly capable of handling reads against a database that is also being written to, even if the writes are coming from another process. https://www.sqlite.org/wal.htm

There are all kinds of interesting use-cases which Datasette is currently unsuitable for due to its insistence on immutable databases. Some examples:

  • Continually run Datasette against a SQLite database updated by another process, e.g. Firefox bookmarks
  • Projects where a cron runs every X minutes and writes new entries gathered from other sources to SQLite
  • Tail a log file, write those log updates to a SQLite file, view recent log entries in Datasette

This is also relevant to #417, Datasette Library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions