---
title: "Databases and storage · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/databases-and-storage
updated: 2026-10-21
licence: "All rights reserved"
---

# Databases and storage

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

> We pick PostgreSQL and SQLite for data, Redis or Valkey for caches and jobs, and an open ORM. Postgres search, SeaweedFS and sharp or Pillow do the rest.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/databases-and-storage">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

## Recommended

- [Use PostgreSQL for the main database](https://agentwranglers.se/playbook/stack/databases-and-storage/postgresql): Keep the main business data of a web app in PostgreSQL, on a major version with more than 12 months of support left.
- [Use SQLite for a small or embedded database](https://agentwranglers.se/playbook/stack/databases-and-storage/sqlite): Use SQLite when one server process owns the data. Examples are a small site, a phone app, a test suite or a local tool.
- [Use Redis 8 or Valkey for caches and queues](https://agentwranglers.se/playbook/stack/databases-and-storage/redis-or-valkey): Run Redis 8 or later, or Valkey, for caches, rate limits and job queues. Never run Redis 7.4 to 7.8, whose licences are not open source.
- [Use a mature ORM for database code](https://agentwranglers.se/playbook/stack/databases-and-storage/orm): Write database code with Prisma in TypeScript and SQLAlchemy in Python, or with the Django ORM inside a Django project. Keep one ORM per codebase.
- [Use the migration tool that comes with your ORM](https://agentwranglers.se/playbook/stack/databases-and-storage/migration-tool): Change the schema with the migration tool of the ORM you use, which is Prisma Migrate, Alembic for SQLAlchemy or Django migrations.
- [Use PostgreSQL search first and OpenSearch when it falls short](https://agentwranglers.se/playbook/stack/databases-and-storage/full-text-search): Build search on PostgreSQL full-text search first. Add OpenSearch only when a measured need fails in PostgreSQL.
- [Use the S3 API for files and SeaweedFS to host them](https://agentwranglers.se/playbook/stack/databases-and-storage/s3-api): Keep uploads and other files in object storage reached through the S3 API, with the endpoint and bucket in settings. Host it yourself on SeaweedFS.
- [Use BullMQ or RQ for background jobs](https://agentwranglers.se/playbook/stack/databases-and-storage/background-jobs): Run slow or retried work in background jobs with BullMQ in Node.js or RQ in Python, both on Redis or Valkey.
- [Use sharp or Pillow to process images](https://agentwranglers.se/playbook/stack/databases-and-storage/image-processing): Resize, turn upright and re-encode images with sharp in Node.js or Pillow in Python, and use no other image library.

## Avoid

- [Avoid MongoDB as the default database](https://agentwranglers.se/playbook/stack/databases-and-storage/avoid-mongodb-default): Do not pick MongoDB Community Server as the main database of a new web app.
- [Avoid the MinIO community edition](https://agentwranglers.se/playbook/stack/databases-and-storage/avoid-minio-community): Do not start new self-hosted object storage on the MinIO community edition, and plan a move off it.

- Previous: [Web frameworks](https://agentwranglers.se/playbook/stack/web-frameworks)
- Next: [Testing and code quality](https://agentwranglers.se/playbook/stack/testing-and-code-quality)
- [All chapters](https://agentwranglers.se/playbook/stack)
