AWS Lambda real world example — Spreash integrations

The story about an ideal fit

Spreash
3 min readNov 24, 2015

You’ve probably already heard about a new Amazon product — AWS Lambda. It lets you forget about servers and concentrate on services. Of course not all the scenarios fit into this paradigm and this article is about the case that fits ideally.

First let me take my chance and introduce Spreash. This is a spreadsheet platform aimed to easily create dashboards integrated with whatever you might need to integrate and beautifully visualized. For example you can simply feed data from Google Analytics or Yahoo Finance (updated in near real time) to you spreadsheet, visualize data, compute additional metrics and mix data from different sources. Finally you end up with a dashboard that you can simply open and watch or share.

Spreash … should not limit you in what you can do

The key thing about Spreash is it should not limit you in what you can do. That is why it looks like a spreadsheet when you are editing a document — because spreadsheets are so flexible. It is crucial for us that integrations and visualizations will not be limitations as well. Visualizations are off topic for this article so let me get deeper into integration.

One option to integrate a spreadsheet is to provide an API to open a specific document and update it. That is what we consider to provide as well but is not the primary option due to its obvious limitations. What we wanted to achieve is every spreadsheet function is an integration. Whenever you would like to get a current quote for Apple stocks using Yahoo Finance you just type =yahoo.quote(“AAPL”) and get the current Apple price in a spreadsheet cell. Of course no other system is aware that you typed anything so it is Spreash who should initiate a call to Yahoo Finance and insert the data received into the spreadsheet.

An example of a Spreash document

Spreash itself knows nothing about Yahoo Finance — it can call something that has a predefined interface. So we ended up with the following: any new integration is a service in the internet and should register on Spreash a unique name for it (‘yahoo.quote’ in our example), a URL that will be called and a period of time — how often Spreash should call the method to get updated data. In our example it makes sense to make a calling period something small (seconds) to get information feeding in near real time. In other cases it can be hours or just a one time call (for example if the function only makes some calculations and so should be only called whenever its parameters change).

You have very transparent unit economics and you do not have to pay extra money for or shut down the integrations that are not popular but still have their users. And you are ready to scale if your integration gets popular

An integration service would usually be a rather small service that either performs all calculations internally or calls the platform being integrated and transforms input and output parameters to what Spreash expects. This is where we come up to an ideal fit with AWS Lambda. Lambda offers a way to create such a service avoiding a need to rent a server or VPS to host it. That makes adding an integration easier and makes economics better as you only pay for real service consumption to Amazon. If you charge users for your service you have very transparent unit economics and you do not have to pay extra money for or shut down the integrations that are not popular but still have their users. On the other side you are ready to scale if your integration gets popular.

--

--