days
0
-9
hours
-2
0
minutes
-5
-8
seconds
-3
0
search
Part 3

The serverless cloud — Enabler of a collaborative economy

Bart Blommaerts

In the third part of his serverless cloud series, JAX London speaker Bart Blommaerts looks at serverless as an enabler of a collaborative economy.

This post was originally published on Bart Blommaerts’s blog: Daggie.be

In the first part of this series, I introduced the serverless architectural style. In the second part, I compared all major serverless providers. In this third and last part, I would like to look at serverless as an enabler of collaborative economy.

Collaborative economy

What is collaborative ecomomy?

Benita Matofska: The Sharing Economy is a socio-economic ecosystem built around the sharing of human, physical and intellectual resources.

It includes the shared creation, production, distribution, trade and consumption of goods and services by different people and organisations.

The last part of Benita’s quote: shared creation, production .. of services by different people and organizations makes a very nice use-case for the serverless style of building applications.

Your data

In this day and age, all companies have become IT companies, meaning a lot of data is gathered and stored somewhere. Often the usage of the available data changes over time. If data is not used for the benefit of the enterprise or its employees, does it still hold value? Wouldn’t it be great if we could turn cost into profit?

Thanks to its cost model (pay per execution), its focus on scalability (no risk of overprovisioning) and resilience, serverless enables companies to experiment with exposing their data:

  • Offering an API for others to consume
  • Enriching existing API’s with their data

Your ideas

Serverless also makes a lot of sense for companies that don’t want to expose their data, but have great or new ideas on how to use others data:

  • Combining data from multiple providers
  • Filtering and transforming data
  • New business cases beyond the scope of the original API

Example

I implemented a small and simple application that will consume data from different serverless cloud providers. Every “hop” in the system will parse its input and add some new data.

Component diagram

Description

Any client can post a JSON to the first function, made with Auth0 webtask. The body of the post request is simple:

{"temp":"42"}

The WebTask will parse that input, add some input of its own and POST request to an IBM OpenWhisk action. The body of this POST request:

{
  "hops": [
    {
      "provider": "Auth 0 Webtask",
      "start": "2016-08-24T20:32:03.629Z",
      "temperature": "42",
      "stop": "2016-08-24T20:32:03.629Z"
    }
  ]
}

To continue the chain, IBM OpenWhisk will POST the parsed JSON to a function on the AWS Lambda platform after adding a new “hop”:

{
  "hops": [
    {
      "provider": "Auth 0 Webtask",
      "start": "2016-08-26T18:38:25.021Z",
      "temperature": "44",
      "stop": "2016-08-26T18:38:25.021Z"
    },
    {
      "provider": "IBM OpenWhisk",
      "start": "2016-08-26T18:38:35.024Z",
      "temperature": "42",
      "stop": "2016-08-26T18:38:35.024Z"
    }
  ]
}

The Lambda, created with Serverless V1.0 Beta 2 will parse the input again and create items in an AWS DynamoDB:

The AWS DynamoDB table will stream events to another AWS Lambda that will log the content of the event to the logs of AWS CloudWatch:

The source code of all these components is available on GitHub.

Best practice

Obviously I wouldn’t recommend anyone to use a different cloud provider for every function. Choosing the right one will depend on your specific needs, goals and current cloud landscape. In the previous part of this series, you may find some tips on how to make a reasoned choice.

Acknowledgement

I would like to thank my Ordina colleague Ken Coenen for working with me on Collaborative Economy a few months ago.

 

Author

Bart Blommaerts

Bart is a passionate Application Architect, who believes closing the model-code gap is essential to make rapid, agile delivery sustainable. Bart has a strong focus on API design, reuse, automation and security. He is always looking for technical challenges. Bart also is the chairman of the different JWorks Competence Center Leads at Ordina.


Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of