Ben Kraan

  • 12/06/2018
  • 3 minuten leestijd
Avatar

TechNight: Serverless Microservices

It was a hot summer evening in Rotterdam on Wednesday the 30th of May. As temperature was high and the air was moist the evening summer sun didn't withhold it being crowded at this TechNight in our office at Developers.nl. This talk focusses on AWS Lambda and how to create serverless microservices with it.

After guests started dripping in and we all had some lovely Chinese food, it was time for this evenings presentation. With all the fuzz about being on the cloud and microservices in technical media, it was nice to have a speaker who had some insights in implementing this in his company. Is it a hype? Are we all going there? Is this the boat companies (think) they might miss? Will we still be speaking about it in 5 or 10 years, or will we think back about how silly we were then? Or is it just history repeating?

Our guest speaker Amer Grgic, CTO at tevreden.nl, can give the answer. The talk is called 'Serverless Microservices. The architecture used is AWS Lambda. He started with the evolution in which many company's concern might be recognized. Going from a big monoliths to microservices. And if that is not enough already we will migrate from microservices being deployed on the cloud to only have functions on the cloud.

AWS Lambda is a cloud solution that offers to run these functions without provisioning or providing servers. At tevreden.nl for example, it is nice for solutions for having scheduled jobs. The advantage of using a solution like this is that your company doesn’t have to care about maintaining server racks and system engineers, it is all done for you. Scalability is endless and you only pay for the time and resources when your code uses computing power. This explains why scheduled jobs are so good for this. Why you should be maintaining a 17 inch rack when running a scheduled job a few times a day?

The costs for using AWS are calculated by the number of executions of your function, the allocated memory and the estimated execution time. However this all sounds great, there are some limitations to this. There is maximum amount of execution time on the cloud, disk space is limited to 512MB so as is memory usage.

Demo

In our first demo we see the web based interace of AWS lambda. Here we have an editor for our functions. Also ASW lambda comes with a command line interface. For the examples in the presentation the AWS Api gateway is used, storage is proved by AWS S3 storage, Flask used to build the API. And last but not least Zappa is used as our deployment tool.

Our first example is a Hello World function. Zappa is used in the AWS CLI for deployment, simple command like 'zappa deploy [dest]' and 'zappa update' are used here. After each deploy or update an URL is provided to test our function. An endpoint test tool can be used for this.

Another demo being shown is using the Rekognition from AWS which is a service providing image and video analyses.

For this we use our S3 storage to get an image and have a face recognition function done, which is one of the features of the AWS Rekognition package. The function will fetch the latest image from the S3 storage and call the facial recognition function provided by Rekognition and shows the name of the person in the image. For the demo we Google at an image from superstar Beyonce and upload it to the storage. After running the AWS function the output shows us the name of the Artist. To test the knowledge of the Rekognition package, our speaker makes it a little bit harder. This time an image of the Dutch infamous artist ‘Gordon’ was uploaded. And after running the AWS lambda function the output does amazingly shows his name.

Questions

After this demo it is time for questions from the audience.

There is a question about being dependent on the AWS infrastructure. Well, Amer says, isn’t it all about being on the cloud when you choose for this solution. But there is one option, there is get-faas, this is a self-hosted Lambda server. It can also be used in combination with Docker. Another question is about support. Does AWS give this for free? The answer is no. You have to pay for support. Our speaker tells they don’t frequently use it.

Now we have a question about the AWS Lambda API. How often does it change and more importantly gets deprecated? Amer says they didn’t had an issue with that since there since is backwards compatibility has been very good so far. Someone from the audience notes that on the internet there are complaints about the lack of tooling provided by AWS lambda. Our guest speaker concurs that some developers require local environments to test/develop on with the advent of cloud technologies.

My thought about this tech night from a Java developers perspective was that is was very interesting for anyone with no or some basic knowledge of developing functions in the cloud. It was a great introduction and showed me the capabilities of AWS lambda. I think we will be seeing this more in the near future