Drive Redis from the database change stream, so a cached value is dropped the moment its row changes instead of whenever its time to live happens to run out.
Invalidating from application code works right up until a second service writes the same row. The batch job, the admin tool, the migration you ran once: none of them call your invalidate helper, and none of them know they were supposed to.
name: orders
connectors:
- name: orders-db
type: source/postgres
host: "${POSTGRES_HOST}"
port: "${POSTGRES_PORT}"
database: "${POSTGRES_DATABASE}"
user: "${POSTGRES_USER}"
publication: "${POSTGRES_PUBLICATION}"
slot_name: "${POSTGRES_SLOT_NAME}"
secret_refs:
- { field: password, ref: postgres-password }
- name: redis-out
type: sink/redis
# required config: /connectors/redis
routes:
- from: orders-db
to: [redis-out]
Not every connector in this pair ships yet. The spec is what it will be · check the roadmap for dates.