How Google Taught Me to Cache and Cash-In
highscalability.com
How Google Taught Me to Cache and Cash-In
1–10 of 25 posts
Re: How Google Taught Me to Cache and Cash-In
#2Didn't seem to answer the #1 question I had in my mind - how do they cache votes for logged-in users? Do they, say, cache a generic front page and then apply the user's prior voting choice via JS? Or do they cache the page only for the general public, and for logged-in users just cache their voting history and generate it on-the-fly?
However they do it, they do a damn good job. I'm always impressed by how responsive Reddit is, along with the other highly dynamic / high load sites like Digg, etc. They manage to stay up and running fine even with all that going on; but just a link on their front page to someone's blog, which should be almost static, crushes that server into goo. Shows the power of good design!
Re: How Google Taught Me to Cache and Cash-In
#3Re: How Google Taught Me to Cache and Cash-In
#4Seems to mainly be about Reddit. Didn't seem to answer the #1 question I had in my mind - how do they cache votes for logged-in users? Do they, say, cache a generic front page and then apply the user's prior voting choice via JS? Or do they cache the page only for the general public, and for logged-in users just cache their voting history and generate it on-the-fly? However they do it, they do a damn good job. I'm al…
Re: How Google Taught Me to Cache and Cash-In
#5Seems to mainly be about Reddit. Didn't seem to answer the #1 question I had in my mind - how do they cache votes for logged-in users? Do they, say, cache a generic front page and then apply the user's prior voting choice via JS? Or do they cache the page only for the general public, and for logged-in users just cache their voting history and generate it on-the-fly? However they do it, they do a damn good job. I'm al…
Load a static page from cache wherever possible. If the user performs a vote, or submit, or what have you, write it to the database, but just perform the update on the user's local page in the DOM.
Re: How Google Taught Me to Cache and Cash-In
#6I wonder if anyone's gone the next step and written updates to the caches directly, leaving out the database write from the critical path.
Re: How Google Taught Me to Cache and Cash-In
#7Seems to mainly be about Reddit. Didn't seem to answer the #1 question I had in my mind - how do they cache votes for logged-in users? Do they, say, cache a generic front page and then apply the user's prior voting choice via JS? Or do they cache the page only for the general public, and for logged-in users just cache their voting history and generate it on-the-fly? However they do it, they do a damn good job. I'm al…
In the past my strategy was basically that. Load a static page from cache wherever possible. If the user performs a vote, or submit, or what have you, write it to the database, but just perform the update on the user's local page in the DOM.
You could load a generic page and then apply their votes by AJAX or something but that doesn't strike me as being any more efficient for the DB than just generating the page.
Re: How Google Taught Me to Cache and Cash-In
#8Earlier quoted context omitted.
In the past my strategy was basically that. Load a static page from cache wherever possible. If the user performs a vote, or submit, or what have you, write it to the database, but just perform the update on the user's local page in the DOM.
Yeah, that's what you'd do as the user makes a vote. But how would you load the page in the first place? The front page is different for each user, as they've likely voted up and down numerous links on it. You could load a generic page and then apply their votes by AJAX or something but that doesn't strike me as being any more efficient for the DB than just generating the page.
Re: How Google Taught Me to Cache and Cash-In
#9Seems to mainly be about Reddit. Didn't seem to answer the #1 question I had in my mind - how do they cache votes for logged-in users? Do they, say, cache a generic front page and then apply the user's prior voting choice via JS? Or do they cache the page only for the general public, and for logged-in users just cache their voting history and generate it on-the-fly? However they do it, they do a damn good job. I'm al…