Did you know that most serverless workflows in the wild consist of stateful functions, i.e., they need to access/modify some state??

city traffic

This is most impressive as serverless platforms are designed and optimised for stateless functions, i.e., tasks whose output only depends on the input they receive. The reason for that is that new instances of stateless functions can be spawned (or existing instances can be terminated) without any coordination, which makes autoscaling one of the most appealing features of serverless. Advantages include: infinite scalability, automatic adapation to current loads, scale-to-zero, on-demand billing, efficient handling of flash crowd effects.

How can developers realise stateful workflows using only stateless functions? Well, they hide state access inside the functions, which reach external services (nosql databases, in-memory key-value stores, etc.) behind the scenes.

Indeed, cloud providers encourage this pattern, since it allows them to bill twice the service provider: once for the use of the serverless platform, and then another for the use of such external persistence services. As a bonus to the cloud providers, this also creates a double lock-in, since Application Programming Interfaces (APIs) and libraries for serverless/external services are typically non-interoperable across different providers.

How does it work in the MARVEL framework?

In the project H2020 MARVEL we are not only relying on cloud resources for the execution of real-time analytics, but we also target the edge and fog layers. There, it may be inefficient or technically impossible to use external services for state access, therefore tailored solutions will have to be devised for serverless computing to be deployed for smart city applications.

You can find out more about our architecture here.

What is serverless computing?

Serverless computing is a cloud computing execution model in which the cloud provider allocates machine resources on demand, taking care of the servers on behalf of their customers. “Serverless” is a misnomer in the sense that servers are still used by cloud service providers to execute code for developers. However, developers of serverless applications are not concerned with capacity planning, configuration, management, maintenance, fault tolerance, or scaling of containers, VMs, or physical servers. Serverless computing does not hold resources in volatile memory; computing is rather done in short bursts with the results persisted to storage. When an app is not in use, there are no computing resources allocated to the app. Pricing is based on the actual amount of resources consumed by an application. It can be a form of utility computing.

Serverless computing can simplify the process of deploying code into production. Serverless code can be used in conjunction with code deployed in traditional styles, such as microservices or monoliths. Alternatively, applications can be written to be purely serverless and use no provisioned servers at all. This should not be confused with computing or networking models that do not require an actual server to function, such as peer-to-peer (P2P).

Source: Wikipedia

Was this helpful? Feel free to reach out using the MARVEL contact form or to find and talk to us on Twitter and LinkedIn.

Blog series is organized by:  Claudio Cicconetti from the CNR team

Key Facts

  • Project Coordinator: Dr. Sotiris Ioannidis
  • Institution: Foundation for Research and Technology Hellas (FORTH)
  • E-mail: marvel-info@marvel-project.eu 
  • Start: 01.01.2021
  • Duration: 36 months
  • Participating Organisations: 17
  • Number of countries: 12

Get Connected

Funding

eu FLAG

This project has received funding from the European Union’s Horizon 2020 Research and Innovation program under grant agreement No 957337. The website reflects only the view of the author(s) and the Commission is not responsible for any use that may be made of the information it contains.