Zachary Kessin [email protected] Director of API Product Structure Mostly Erlang Podcast
Building a statup in which an API plays a key part is an increasingly common pursuit. People have used many technologies to build those APIs, including, Java, Scala, PHP, Ruby and many others. I will argue that using Erlang and Webmachine is a one of the best ways to build an API that is very semantically correct and reliable.
In our experience an API built around Webmachine can be very fast. In the modern world of internet mashups speed is not something to be dismissed. We have found that with an API based on WebMachine and using a ram based Mnesia backend or something similar we have generally found that our API has average response times have been less than 10ms, and often as low as 2-4ms.
Webmachine also provides these benefits, on small servers with high levels of concurrency. We have been able to bench mark an EC2 Medium instance serving about 800 requests a second due to Erlang's lightweight concurrency model. This enables an API to serve a large number of requests on cheap hardware. We have also found that when the system is overloaded it tends to degrade in a very predictable way. So when the system gets overloaded requests don't fail, they just get slower.
I will show how and why to use Webmachine to build a simple API that will respond to requests and even simply handle things like providing ETags for cache behavior, content negation and more.
I will develop an api end point that shows many features of the web with short pieces of code and how it can provide value to an organization.