Engineering Decisions · Middle · Question 1 of 14

A news feed serves 1M users, may lag by a minute, and every call to the upstream API is paid. What's the main approach?

Show the answer

Correct answer: A shared server cache with a TTL of about 60 seconds

Explanation

One shared entry means all users cost a single upstream call per minute, and the minute of lag is allowed. A browser cache fits personal data and saves repeat visits, but with 1M users each one still pays for an upstream call. Fetching on every visit fits data that must be exact, like a balance, and here it would multiply the bill for no benefit.

Further reading

Problem with a question

Engineering Decisions · Middle · question 1

Test yourself

Take the Engineering Decisions · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz