Redis Cache with PostgreSQL Fallback

Redis Cache with PostgreSQL Fallback An architecture diagram generated by Archify. Browser · Web / mobile client · Architecture component Browser Web / mobile client API Server · application logic · Backend API Server application logic Redis · read-through cache · Backend · Redis Redis read-through cache PostgreSQL · source of truth · Backend · PostgreSQL PostgreSQL source of truth HTTPS request read-through SQL on miss Backend Legend Frontend Backend Database

Cache-first read path

  • • Browser calls the API over HTTPS
  • • Redis is checked first; a cache hit answers without touching PostgreSQL

PostgreSQL fallback

  • • On a cache miss the API runs the SQL read
  • • PostgreSQL stays the durable source of truth