How Cloudflare could make serverless the new standard

As part of their 10th anniversary, Cloudflare has made a revolutionary announcement regarding their serverless data processing technology. Many companies are just now thinking about switching to serverless and Cloudflare is ushering the next level!

Kenton Varda , Chief Engineer at Cloudflare, raved about the launch of his personal favorite Workers feature via Twitter back in late September. He said he hadn't been this excited about a release since Workers launched. After a year and a half, he said, the new feature is finally ready. The feature was officially announced as part of Cloudflare's tenth birthday: Workers should be able to cache its own data without additional databases in the future. The new "durable objects" are supposed to help with this.

Crossed out image of a server room

The problem with the databases

At first glance, the feature does not sound particularly innovative to the layman. Yet, it offers a first approach to solving a well-known disadvantage of serverless functions. Serverless is a technology that allows developers to write and deploy code without having to manage server or application interfaces (APIs) themselves. All of this is handled by the serverless provider. Well-known examples are AWS Lambda, Microsoft Azure, but also open source variants such as serverless. The entire architecture of a program then runs via their clouds. Therefore, this technology is often used to save costs. Provisioning, meaning the distribution of storage capacities and costs for servers during times with hardly any user traffic, are thus of little importance in budget planning. However, serverless functions do not have their own data (states). Therefore, they could not be stored permanently until now. This required an additional database. The disadvantages of databases in connection with serverless are:

  • Costs: serverless is mostly "pay per call" and "pay per runtime". Establishing a connection with databases is time-consuming and accordingly expensive.
  • Speed: slow connection setup to a DB can have an impact on the user experience (UX) and even lead to exclusions of serverless solutions for certain application fields. For example, this can be real-time collaborative tools such as Google Sheets and Airtable.
  • Location: Databases are always located in certain regions (e.g. Europe), so a user from another region will have longer access times.

 

Own states thanks to durable objects

Cloudflare's announcement promises nothing less than that architectures without their own server should now be able to store this data permanently. For this purpose, variables (durable objects) should be used in the code. These should always remain consistent between every function call at every location, even if millions of users are active at the same time. Critics fear that this technology is still unsuitable for certain fields of application. It is expected that "heavy data applications" with long runtimes, such as image processing pipelines, will have disadvantages in terms of speed and costs. In general, the announcement is being received positively, as serverless computing already allows developers to focus on the core product instead of worrying about managing and running servers or runtimes.

“The power to scale here without an insane infrastructure headache is amazing. One day, some kid is totally going to build a single-person billion dollar company from its mom's basement.

Automatically moving objects to be near the computation that needs it, is a long-standing dream. It's awesome to see that Cloudflare is giving it a try!”

 

New solution for known problem

Again and again, sticking points of serverless technology could be solved. Observability, i.e. the tracking and analysis of running processes, has long been a challenge with serverless services. Developing itself was a disadvantage at first too. Since you are dependent on the cloud operator and cannot manage and start a server yourself, there was initially no way to execute and develop the code locally on a 1-to-1 basis. Since then, solutions to these problems have already been found. Keywords here are state machines and cloud simulations on local PCs. Managing states is one of the biggest problems of serverless programming. With the promised features of Cloudflare we could be a good step closer to a solution. The Internet is therefore sure that the competition will soon follow suit.

Tweet by Kenton Varda about Cloudflare


DE