We need a relational database that supports complex queries and full-text search. The team has strong SQL experience and needs ACID guarantees for financial transactions.
Use PostgreSQL 16 as the primary data store with pg_trgm for full-text search.
PostgreSQL pg_trgm full-text search does not meet latency requirements for the product catalog search feature. Users expect sub-100ms results with typo tolerance and faceted filtering.
Add Elasticsearch 8 as a read-optimized search index alongside PostgreSQL. PostgreSQL remains the system of record; Elasticsearch is populated via CDC (Change Data Capture).
Regulatory requirements mandate a complete audit trail of all financial transactions. The current approach of database triggers is fragile and does not capture intent.
Implement event sourcing for the payments domain using Apache Kafka as the event store, with PostgreSQL projections for query models.