Web Request with Redis Cache Fallback

Web Request with Redis Cache Fallback A sequence diagram generated by Archify. HTTP request read cache miss query data rows set cache 200 JSON Request Cache fallback Response Browser · client · Sequence participant Browser client API · request handler · Sequence participant API request handler Redis · cache · Sequence participant Redis cache PostgreSQL · source of truth · Sequence participant PostgreSQL source of truth Legend request return async trace default message

Happy Path

  • • Browser calls the API over HTTP
  • • The API is the only participant that talks to Redis or PostgreSQL
  • • Activation bars show how long the API owns the request

Cache Fallback

  • • A cache read against Redis comes back as a miss
  • • Only then does the API query PostgreSQL as the source of truth
  • • The API writes the fetched rows back into Redis before responding