We have an app with two distinct parts: a publish console and then a
read-only view part. The views account for over 99% of our traffic,
and the content doesn’t change very much. We want to build a HA
system for our views.
The obvious first step is to split out the publishing from the
viewing. I’m wondering what’s the best way to handle data on the view
servers though. The two ideas I’ve had both involve using
ActiveResource…the first is to run the view server as a caching
server, with its own small sqlite database. When a request comes in,
it looks to see if it has the data. If so it just builds and returns
the page. If not, it makes an ARes request to our main servers, gets
the data, and sticks it in its own db before serving it up. When data
changes on the server, we just send an HTTP DELETE to the view server
to expire the cached content.
The other idea I had was to bypass a db on the view server, and stick
a regular HTTP caching server in between the view and publish servers.
This way a view server only makes HTTP requests, and squid (or
whatever) handles the actual caching.
I’d appreciate any thoughts on perceived pros and cons of these two
approaches, and I’d certainly love to hear any other ideas.
Pat