An introduction on how to design APIs, followed by a recipe using scala, and a REST server implementation in Akka and Spray.
This presentation looks at API design from two different angles. Firstly, from a API developer/user point of view, we define the API developer journey, we introduce and craft meaningful REST url paths and RESTful resources. Secondly, from an API implementation point of view, we dive into the mechanics of akka, and spray.
During the first part we highlight the process of value creation from idea to API design, which translate into the definition of fluent API paths where resources are concatenated, rendering in facts the elements of a streaming analytical pipeline into a set of concatenated resources accessible via the api. We highlight the importance of a meaningful semantic for the API design process and a good match between the value proposition and the resources exposed by the api itself. To render the concept clearer we take the example of a streaming api which collects and gathers readings from a set of jogging wrist bands connected to internet.
During the second part of the presentation, we focus on scalability, resiliency and availability of the solution. We introduce the concept of actor as basic processing element. We introduce the concept of location transparencies and hierarchical supervision when mapping actors to a cluster of computing resources. Finally we describe how to translate a url path into a set of routes, and how to dispatch and process the incoming json readings to the right analytical actors. This short overview gives an idea on the mechanics behind a real time, streaming api. And on how to implement api resources as asynchronous communicating actors, in order to provide a rudimental but effective streaming analytical engine.