Three years ago I had to learn Docker, two years ago – Kubernetes. Now – Serverless

Interview with Anton Chernousov from Yandex.Cloud

Anton Chernousov – developer advocate – came to Yandex.Cloud to deal with microservices popular in the Docker and Kubernetes industry. But his main professional passion is Serverless. We spoke with Anton and he explained why serverless platforms have a great future.


Why learn Serverless

The first program I was paid for was written in 2000. In the process, I realized there was a lot I didn’t know. The money received simply burned my hands, because I did not quite what was asked of me. I decided that I needed to educate myself, follow the industry, deeply study technology.

When I missed the appearance of Docker, I scolded myself, and then Kubernetes missed it. When a developer delves into the technology at the very start, sees how it develops, he becomes an expert much faster than those around him. And when a new technology goes mainstream, this developer’s knowledge is expensive. It is increasing its weight in the market.

Docker and Kubernetes are tools. Like any instrument, they don’t last forever. Each tool has a life cycle. As soon as we move into the high-tech field, the life cycle of the tool is greatly shortened. This is the angle I look at technology. That is why we have to keep an eye on what will be the next “new hammer” for the next 2-3 years. Three years ago I had to pay attention to Docker. Two years ago – on Kubernetes. Now we need to learn Serverless.

15 years ago we made CGI scripts in Perl. It was the same as writing a Serverless function today. We needed to take care of the physical server, Apache, we were constantly digging into the configuration. Now the cloud is responsible for the server, instead of Apache, you have a server that calls the runtime, and you only care about the script, which has become, in fact, a separate function. The idea is old, but the hammer is new. We didn’t come up with anything new, we just took the “hammer”, realized that we have new technologies that allow us to do everything more efficiently. Shifting risks to the cloud and dealing only with business logic is the coolest thing about Serverless! You only deal with business logic. This is a dream come true for many.

Should regular developers think about Serverless

When we look at what we are doing from the eyes of a developer, we will see that we are accepting data as input, then, from a business point of view, some magic happens to us, and then we give out other data at the output. Business gives money for this magic.

To put it very roughly: we implement a business process or support this business process, “ground” business ideas, taking into account technical constraints. We have the speed at which we must process the volume of data flowing through us. We ask ourselves questions like – how difficult will it be for us to write and further support the corresponding process?

But these are all our internal troubles. Business is interested in the cost of a specific process and the speed of its implementation.

Using Serverless, we can provide the business with a clear KPI, show the story: look, here is the input, here is the output, here is the function and here is its cost. In serverless technologies est the volume of the service that you consume and for which you pay. Calling a specific function costs specific money. You do not pay for some ephemeral servers that are somewhere and require cache every day. Everything is transparent, the cost is easy to calculate.

From this point of view, Serverless is a cool story of software development, not just coding, but a development approach. Business understands how much it will really cost. He understands how it will scale.

We wrote the code and rolled it out to the servers. No users came, and we continue to pay for the server. And if you came – how to scale? Well, you need to buy another server, you need to buy some more proxy / loadbalancer. We begin to take on all these problems as developers, and with serverless we refuse them, we take all these risks off ourselves and do not think about the number of servers.

For the developer, the work also becomes transparent. No matter how he writes the code, the function will still be small enough. There is no need to come up with a complex system of how to debug a large monolithic application.

There is one particular piece, and the whole business transaction takes place within it. Debugging and maintenance is made easier, which reduces the potential cognitive burden on the developer. Productivity rises.

How Serverless works in practice

It should be understood that this is still a fairly young instrument. And it has some limitations, like any tool.

Now, when I talk about serverless, I mean all subset of technologies:

– Function

This is some kind of custom engine that we create and which is limited in time. In an amicable way, this function should be stateless. And in this sense, she is beautiful. It can be scaled infinitely (within the cloud). Run as many variations as you like and withstand “any” load.

– State storage base

The second part is needed to make a complete application. When we handle a load, we need a place to store the state. There is a fork in it: an operational state and a long-term one. For a long-term state, databases are suitable. A whole class of databases has already appeared, which is called Serverless Database.

In Yandex.Cloud, this is the Yandex Database project, which had a serverless launch option last year. The load comes, it is automatically scaled, you pay only for the operations that you performed.

– Operational data management

And for this, of course, you need to operate in queues. It is necessary to accept data between functions, add RAM so that it is a common area. It can be a message queue.

Amazon has SQS, Yandex.Cloud has Message Queue. It works precisely in this ideology – a scalable Serverless solution.

– Storage

We take the load, process it with some engine, add it to RAM or a database. But the question arises of storing long-term unchanged information. Then we just put it in a repository that supports this protocol.

In Amazon, this is S3, as the progenitor, in Yandex.Cloud, it is Object Storage, which essentially repeats the S3 protocol. This is the ability to store both files and static information, and store backups for a long time.

– API

It is clear that separately scattered functions that are generated dynamically do not look very nice from the outside. All this must be packaged into an application and shown outside in a single form and managed like a single orchestra.

There is an API Gateway service. It allows us to declare outside the very API that we control, provide access to functions and associate the API call with a specific function.

Thus, we create a full-fledged application, our own system, which consists of a large number of separate components that scale separately by themselves. And then we can integrate this with various systems.

Why the whole market still hasn’t switched to Serverless

I see three points that influence the transition and push towards it.

The first is an increase in the wave load. A classic example: if you turn off the electricity in the city for a week, and then turn it on abruptly, then the load on the network will be monstrous, because all the refrigerators will turn on at the same time, everyone will start washing clothes. Therefore, it is turned on and off by individual houses and districts in order to spread the load on the system.

Digitalization has penetrated all areas like electricity. Imagine, Moscow woke up at the same time, everyone turned on their phones and looked at something on the news.

The more IT penetrates all systems, the more the wave load is felt. And this will push businesses and IT to use Serverless purely for pragmatic reasons. We want to withstand this wave load that comes and then disappears and then comes back again.

The second point is the colossal shortage of people in the labor market. To develop complex monolithic systems takes a long time to learn. And on the contrary, to write one function separately, you don’t need a lot of knowledge. We need a certain number of good specialists who will launch the process, but then people with lower qualifications will be able to do the bulk.

And the third thing is that the transition will begin when the cool programmers really begin to understand where they can apply it. For example, serverless is now very convenient to use for advertising campaigns that can be unpredictable in terms of load.

The guys set fire to the user base with the help of mailings and push notifications. Their users come to use some specific service, and this load, on the one hand, is predictable, and on the other, we do not know how much it will go viral and how many external users will come. We are consciously preparing for this load, we are ready to accept it, because we are highly qualified programmers, we thought, let’s use Serverless in this particular case. Because the cloud will scale it for us and take all the load.


Large companies are just beginning to see the enormous potential of the Serverless approach. The largest example I can talk about is Genotek. Genetic test data is processed in the cloud. A person “spits in a test tube”, his material is studied in the laboratory, and the obtained data is poured into the cloud. Since this is super-personal information, everything is built on the inside of security and the maximum level of paranoia. Some of the processes are implemented using the Serverless approach, data is processed on functions, and all this works in Yandex.Cloud.

Now in the Russian-speaking space there are few cases and practices of using Serverless – and I try to fix this within Yandex Serverless Ecosystem and the Serverless hub here on Habré. For example, recently I visited my mother and found a game book. There was such a series – “Dungeons of the Black Castle”. This is a fantasy novel played out with dice. You could take on the road and play on the train. Each paragraph of the book was numbered and contained an action. You controlled a character who walked through the book and completed tasks – saving the princess, fighting the dark lord.

I am making an application on this basis, I want to demonstrate some of the features of Serverless: storing state, transferring and storing data.

As a result, the popularity of Serverless is a matter of time and our desire for self-development.

What do you think of Serverless? Come to our community – there we constantly analyze various problems and tasks from the field of Devops, discuss things that will be useful both in interviews and in work.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *