Wednesday, 29 April 2015

Varnish as your API server

Over the coming weeks I will be looking at starting a little open source github based project where the aim will be to write up vcl or vmods that enable you to use Varnish and Couchbase to act as an API.

When the idea first came to me I thought I was going rather insane, but looking at the Varnish API Engine that is available now from Varnish-Cache I realized it wasn't as insane as I had imagined.

Obviously a solution like Varnish API Engine is for high end users, with plenty of cash to spend right now to replace a bunch of servers with a single instance, this engine can handle up to 20k calls per second. So if you have traffic that might be heading that way and your horizontally scaling is getting rather expensive this the kind of solution you need, you better head over to Varnish-Cache now.

I will not be reaching for these kinds of speeds but something far better than a bunch of horizontally scaled rails boxes can give you. This should be quite achievable and there are already a few vmods that are achieving a similar result

You might wonder why couchbase?

I am already familiar with Couchbase and it has master to master replication which is something quite handy under certain circumstances.... but that isn't important. Couchbase responds really quickly to multiple requests, which is going to be important as the api is going to be lean and my plan is to have the rules being served by the database then applied by the varnish engine.

We will have to see how well we can make that work.

On another note, if you aren't using varnish to accelerate your website you either have no traffic, or you probably should,

If you are interested in contributing to the work that I will be doing I would be happy to have the assistance, and will provide the github link as soon as I am not too lazy to get one.

If you are super keen why not comment?

No comments:

Post a Comment