Choosing the right backend for each subsystem depends on your scale, latency requirements, operational budget, and feature needs. This guide compares options across every backend category in the Lexigram ecosystem.
Backend Best For Key Trade-off memoryDev, single-process, low-traffic No persistence, lost on restart, not shared across processes redisProduction caching, rate limiting, pub/sub Requires Redis server; O(1) ops, TTL, persistence optional memcachedSimple key-value, high throughput No persistence, no replication, no data structures
Note
For production deployments, redis is the recommended default. Use memory for testing and local development. Memcached is a viable choice if you only need a simple, fast cache and already operate a memcached cluster.
Backend Best For Key Trade-off meilisearchTypo-tolerant search, quick setup Less mature than ES; smaller ecosystem elasticsearchComplex queries, large-scale analytics Heavy ops overhead, resource hungry typesenseLow-latency instant search Smaller community, fewer integrations sqlite/postgres ftsSimple full-text, no extra infra Limited relevance tuning, basic feature set
Backend Best For Key Trade-off localDev, single-server file storage Not distributed; no CDN, no durability guarantees s3General object storage, high durability Egress costs, eventual consistency (some regions) gcsGCP-native, strong consistency Slightly higher cost than S3 in some tiers azureAzure-native, AD integration Lock-in to Azure ecosystem r2Zero egress fees, S3-compatible Newer, smaller ecosystem
Backend Best For Key Trade-off memoryDev, testing, single-process No durability, lost on restart redisSimple queues, low-latency No delivery guarantees beyond “at most once” by default rabbitmqReliable delivery, complex routing Ops overhead, needs Erlang runtime kafkaHigh-throughput, event streaming, replay Heavy ops complexity, higher latency per message sqsManaged queues, AWS-native Lock-in, polling cost at scale
Backend Best For Key Trade-off sqliteEmbedded, single-server, dev No concurrent writers, limited ALTER TABLE postgresProduction — most applications Heavier resource footprint than SQLite mysqlRead-heavy workloads, replication Weaker JSON/array support than Postgres
Backend Best For Key Trade-off mongodbFlexible schemas, document store No joins, weaker consistency dynamodbManaged, auto-scaling, AWS-native Query patterns must be designed upfront, cost at scale firestoreReal-time sync, GCP-native Limited query capabilities, vendor lock-in
Note
PostgreSQL is the recommended default for most projects. It handles relational and JSON workloads well. Choose SQLite for embedded or dev use. Reserve NoSQL backends for specific use cases (high-volume time series, real-time sync, flexible schemas at scale).
Backend Best For Key Trade-off memoryDev, small datasets (<10k vectors) No persistence, lost on restart pgvectorPostgres-native, integrated with SQL data Limited index types, slower at scale qdrantHigh-performance vector search, filtering Requires separate service pineconeFully managed, serverless Vendor lock-in, egress costs
Tip
If you already use PostgreSQL, pgvector is the easiest path. For production RAG at scale, Qdrant offers the best balance of performance and self-hosting flexibility. Pinecone is ideal when you want zero ops, but watch for egress costs.
See the Packages reference for installation and configuration details for each backend.