Database Selection

Choosing the right database for your Memori deployment.

Decision Matrix

Use CaseDatabaseWhy
Development / prototypingSQLiteZero setup, file-based
Production (any scale)PostgreSQLBest concurrency, pooling, reliability
Existing MySQL infraMySQLNo new database to manage
Enterprise Oracle shopOracleLeverage existing licenses
Document-oriented needsMongoDBFlexible schema, horizontal scaling
CI / testingSQLiteFast, disposable, no dependencies

Feature Comparison

FeatureSQLitePostgreSQLMySQLOracleMongoDB
Concurrent WritesLimitedExcellentGoodExcellentGood
Connection PoolingN/ASQLAlchemySQLAlchemySQLAlchemyBuilt-in
Cloud HostingN/AManyManyOracle CloudAtlas
SetupNoneLowLowMedium-HighLow
DriverNonepsycopg2-binarypymysqloracledbpymongo

When to Use Each

SQLite — Development, prototyping, single-user apps. One writer at a time — not for multi-user web apps.

PostgreSQL — Recommended for production. Concurrent reads/writes, connection pooling, available on every cloud platform.

MySQL — Good if your stack already runs MySQL. No reason to add another DB.

Oracle — Only if you already have Oracle infrastructure and DBA support.

MongoDB — Only NoSQL option. Uses PyMongo instead of SQLAlchemy but integrates fully with Memori.

Migration: SQLite to PostgreSQL

Only the engine creation changes — all other Memori code stays the same:

Migration
engine = create_engine("sqlite:///memori.db")

After switching, run mem.config.storage.build() to create tables in the new database. Memori creates the same schema across all databases.

Setup guides: SQLite | PostgreSQL | MySQL | Oracle | MongoDB