Part 3: Building the App & Caching for Data Latency
Navigation: β Part 2: Optimizing Dockerfiles with Multi-Stage Builds | Part 4: Full-Cycle CI/CD β From Local Hooks to AWS ECR β
Key Takeaways
Platform engineers: Standardise your cache connection patterns. Always use a middleware to automatically generate deterministic cache keys for GET requests.
SREs on-call: Stop silent cascading failures. If your upstream provider goes down, a stale cache fallback prevents your app from crashing.
First-timers: Understand the app flow first. Don't fetch the same data twice. If a user asks for character data, fetch it once, store it in Redis, and serve subsequent requests instantly.
How Our Application Works
Our application is a Python Flask REST API . Its primary job is to aggregate data from the external Rick & Morty API ( https://rickandmortyapi.com/api ).β¦