3 ms·
Heh. OK for fun: They have a very finite amount of new articles a day and a little box on the page with personalized headlines. All these articles, in fact all
by recuter 5y ago
Heh. OK for fun:
They have a very finite amount of new articles a day and a little box on the page with personalized headlines. All these articles, in fact all the articles on BBC of all time ever, comfortably fit into ram if you are so inclined.
Those little linodes have fast enough SSDs, try playing around and use one of countless stress loaders to get a feel.
I've served hundreds of thousands of requests a second from a single server using Varnish. A well tuned beefy VPS would do tens of thousands.
How to "personalize"?
For example Varnish has this thing:
https://en.wikipedia.org/wiki/Edge_Side_Includes https://en.wikipedia.org/wiki/Edge_Side_Includes
https://varnish-cache.org/docs/6.0/reference/vcl.html https://varnish-cache.org/docs/6.0/reference/vcl.html
It will happily read whatever cookie you set and stitch together a remixed personalized page for all the BBC users in the world without a performance penalty much faster than your lambda cold starts.
CDNs sometimes let you hook into Varnish directly or expose something similar to essentially do exactly this.
The aim of the game of the guy who wrote that blog post is to reinvent something from the 90s, but worse, and blog about it.
- lostcolony 5y agoIt's not just new articles; it's also updates to existing. The idea then being you could put together a feed of updates of articles you expressed interest in, plus recommendations and such; this isn't what they're doing now, but it may be their long term goal and this is their path to it. I will 100% agree that what they describe in the link can be done trivially without lambda (they describe a single use case of regionalization, which doesn't even take anything special on the part of the CDN), but the point is I can easily see a future use case they're building towards, that I don't think those standards you mention will support.
- recuter 5y agoI don't get why not. How do you think this was achieved before lambda? Or even before aws? It is a news site not Facebook. The feed would only ever be a subset of all the articles in cache. It can itself be cached, there are only so many permutations. Different people will have different feeds, but there will be people with the exact same feed as you. Crunch those recommendations however you want wherever you want and spew them unto S3 at your leisure. Have your varnish cache sit on top of that. Set your personalized subscriptions via a cookie. Varnish on each request will decide which one out of n (probably n<10000) feeds to include in your html response, in under 2ms. This is all stateless. Have two servers in two regions. Done. Maybe you'll reboot them every couple of years.
- notyourday 5y agoBeen there, done that. Can confirm it works swimmingly. It is much more fun though: don't be clever. Just cache-bust on change.