-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
QuickPizza isn't perfect! It has a few problems:
- Backend:
- If too many HTTP requests hit the service, latency grows to the sky.
- Type? Performance issue.
- Why? There is a global lock in the in-memory database, used by all requests.
- How to find it? With metrics and traces (once we have them).
- How to fix it? By not coupling everything with the same lock (some ops are more critical than others).
- Name generation is unpredictable and slow.
- This is triggered every time someone asks for a recommendation.
- Type? Performance issue.
- Why? Someone added a non-critical check in the core flow of the app.
- How to find it? Ideally, with tracing (once we add it).
- How to fix it? Removing the check.
- In-memory database should store only the last ten pizza recommendations, but it stores them all.
- This data is used in the admin panel.
- Type? Performance issue (memory leak).
- Why? Someone didn't think it was that important to set this limit.
- How to find it? With metrics.
- How to fix it? Refactoring the implementation to only store the last ten recommendations.
- If requirements are too strict and can't be fulfilled, we return a random recommendation after a few tries.
- Type? Functional issue.
- Why? This edge case isn't handled properly.
- How to find it? With Checks/Thresholds.
- How to fix it? If a good recommendation can't be generated, return an error.
- If too many HTTP requests hit the service, latency grows to the sky.
- Frontend:
- If the recommendations API is under load, no feedback is given to the user (e.g., loading spinner)
- And they can retry manually as many times as they want (putting even more load on the backend)
- If the recommendations API is under load, no feedback is given to the user (e.g., loading spinner)
Peek.2023-06-22.14-08.mp4
- The Quotes API blocks rendering.
- Type? -
- Why? We make a call to this API on the onMount() section, and we block rendering until it finishes.
- How to find it? With the disruptor, when running on Kubernetes, if we inject some delay, it is very easy to see.
- How to fix it? We could add a loading spinner. But, in this case, given that this request isn't part of the core flow (it is just a random quote that we show), we should render other parts of the site even if this endpoint is slow.
Peek.2023-06-22.15-08.mp4
Metadata
Metadata
Assignees
Labels
No labels