Entries tagged db | Hugonweb Annotated Link Bibliography

Django SQLite Production Config

https://blog.pecar.me/sqlite-django-config

# yourproject/settings.py
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "OPTIONS": {
            "transaction_mode": "IMMEDIATE",
            "timeout": 5,  # seconds
            "init_command": """
                PRAGMA journal_mode=WAL;
                PRAGMA synchronous=NORMAL;
                PRAGMA mmap_size = 134217728;
                PRAGMA journal_size_limit = 27103364;
                PRAGMA cache_size=2000;
            """,
        },
    }
}

Lightstream sqlite replicator

https://litestream.io

Continuously stream SQLite changes to AWS S3, Azure Blob Storage, Google Cloud Storage, SFTP, or NFS. Quickly recover to the point of failure if your server goes down.

Simplify: Move code into database functions

https://sive.rs/pg

Keep as much logic in the database, using constraints, stored procedures, and functions (Postgres even lets you write them in Python) as possible.

This reduces duplication of logic between the DB and external code, and allows the external code to change without issue.

TigerBeetle OLTP Database

https://tigerbeetle.com

Interesting architecture for a database specialized for OLTP. Single threaded, and each record is just 128 bytes to fit in a CPU cache line!