• 1-(508)-353-8254
  • info AT thefieldcto.com
The Field CTO The Field CTO
  • Home
  • Resources
    • Podcasts
    • Articles/Blogs
    • Videos
    • Reports
    • Future Proofing IT
  • Consulting Services
    • AIOps Workshop
    • Observability Workshop
    • Product Advisory
    • GTM Messaging
  • About Us
  • Contact Us
  • June 2, 2020
  • Andy Thurai
  • Applications, Blogs

Serverless in the Enterprise: Building Stateful Applications

Share this...
Share on Facebook
Facebook
Email this to someone
email
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Share on Reddit
Reddit

Cloud native applications allow enterprises to design, build, deploy and manage monolithic applications in more agile, nimble ways. These applications accelerate business value while driving greater operational efficiencies and cost savings through containers, a pay-as-you-go model, and a distributed runtime.

However, current serverless implementations (namely, Function-as-a-Service, or FaaS for short) are unable to fully manage business logic and state in a distributed cloud native solution, which creates inefficiencies in hyperscale applications. What is required is a “stateful” approach to serverless application design.

At its core, serverless computing holds enormous promise as it helps enterprises:

  • Concentrate on application development instead of worrying about infrastructure. With serverless, cloud runtime will automatically scale as needed.
  • Write once and run it anywhere, without worrying about manipulating the full stack. Full-stack engineers are very expensive to hire and retain.
  • Scale the infrastructure for high-intensity cloud workloads with near-zero latency and pay for only the time it was used.

With that said, the most widely-used serverless model — FaaS — has limitations. When serverless functions execute, they generally lose computational context that then needs to be restored. Distributing this context across millions of short-lived, serverless hyperscale instances is extremely hard and might require durable external data storages or message queues. As a result, mimicking the hyperscale at the application-layer level is a hard problem to solve. And if this can’t be solved, the app scaling can’t be automated – which limits the true elasticity of the application.

sponsor logo

Sponsor NoteLightbend is a leading enterprise software and services company helping Global 2000 companies stay ahead in the digital economy. Our customers gain competitive advantage from the scalability and resilience of stateful cloud native applications and “always-on” insights of real-time streaming data.

Unfortunately, a lot of enterprise use cases need to be stateful — such as long-running workflows, human approved processes, and e-commerce shopping cart applications. Workflows, in general, require some sort of state associated with them. Pure serverless functions can’t provide that, since they exist for short durations. Obtaining the application state is most commonly solved by either frequenting database access or saving the state at the client. But both are bad ideas from a security perspective, as well as from the perspective of scaling the database instances.

What Is Stateful Serverless?

Imagine this scenario: Your organization builds an e-commerce platform where developers can focus on inventory management, competitive pricing, delivery management, and customer experience; instead of writing a lot of infrastructure code to manage seasonal, regional, and situational usage spikes.

Sounds incredible, right? What makes this possible is a stateful serverless model that scales the application layer and preserves the state of a cloud native application — instead of just scaling the infrastructure layer, as offered by FaaS. A smart way to distribute state is to replicate and persist data (that is, co-location of state and behavior). And not just the current state, but the full history of all states and events that led up to the current state.

So, in case of failure, a service can self-heal by replaying the events to reach the current state from any previous state. In particular, the Cloudstate version of the stateful serverless model — which is a combination of stateful serverless, event sourcing, and Akka — is not only stateful at any given moment, but it is self-healing and recovers from any disaster to the current state quickly without any external simulation.

Scaling a database or replicating a cache system can hit huge data volumes fairly quickly. By event sourcing, functions can hydrate — or catch up — to the current state while starting up. This means there is no need for a round trip to an external, durable data store for every event processing — it can be self-sufficient. These distributed functions become the true extension of an application with ZeroOps. Depending on the demand, the application can now be truly elastic and expand in the cloud with limitless bounds.

Managing State: A Silver Bullet for Enterprises in the Cloud

A stateful serverless approach allows enterprises to build complex workflows without a need for a roundtrip to the database. If you are using a patchwork series of function chains in your serverless design, have functions triggering other functions, have lots of queues in the workflow, or frequent database connections, then you need to rethink your design using stateful serverless. As of this writing, there are a few popular frameworks to consider including Cloudstate, Azure Durable Functions (based on Dapr), and RIFF.

Even though these functions are designed to stay alive for longer periods — days or even months — you will get charged only for the time the function executes and not while it is waiting for something to happen. These functions also execute quickly, as there is no on-demand provisioning overhead. They will run in “sleep mode,” wake up when an orchestration function invokes it, perform its job in the workflow cycle, preserve the state, and transition back to sleep. The billing is based on the time it executed, and the memory used, not while it was in sleep mode — a true consumption-based pricing model.

Conclusion

Stateful serverless can enable enterprises to rapidly scale their application layer effortlessly in a cloud native environment (both in public and private cloud variations), much the same way current serverless models scale the infrastructure layer. And while a cloud-specific implementation by the cloud provider can help with that specific cloud, you need to select tools — such as those mentioned above — that can help in a hybrid situation.

It is time to take your cloud native enterprise applications to the next level. Distributed enterprise applications need to maintain state, self-heal, recover from disasters quickly, and scale both at the infrastructure and application layers with minimal dependency on a centralized database. This will eliminate bottlenecks in the application flow and allow your applications to hyperscale.

If you would like to explore this architecture in greater detail, download a copy of Build Stateful Applications by Jonas Bonér, creator of Akka and CTO at Lightbend, and get started building stateful enterprise applications.

This article was originally published in TheNEWSTACK on Jun 2, 2020 – https://thenewstack.io/serverless-in-the-enterprise-building-stateful-applications/

Share this...
Share on Facebook
Facebook
Email this to someone
email
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Share on Reddit
Reddit
Prev PostHow To Rise Above The ITOps Chaos Using AI
Next PostWhy Infusing AI Into IT Operations Is More About The Data Than About AI Itself

Recent Posts

  • Achieving Reliable Observability Part 1 – Making Cloud-Native Observability More Robust
  • What is AIOps? – AI for IT operations explained
  • Comprehensive observability is core to future-proofing your IT infrastructure
  • Report: GigaOm Radar for Cloud Observability
  • AIOps vs Observability vs Monitoring – What Is The Difference? Are You Using The Right One For Your Enterprise?

Categories

  • AI
  • AIOps
  • API
  • APMDigest
  • Applications
  • Blogs
  • Business
  • Cloud
  • Forbes
  • Observability
  • Oracle
  • Podcasts
  • Reports
  • Uncategorized
  • Videos
  • youtube

Discover

  • Home
  • Blogs
  • About Us
  • Contact Us

Explore

  • Webinars
  • Talks
  • Articles
  • Videos
  • Podcasts
  • Reports
  • Lightboard Videos
info@thefieldcto.com Drop Us a Line
1-(508)-353-8254 Call Us Now
Copyright 2020 © The Field CTO. All Rights Reserved.
theFieldCTO websites use cookies to deliver and improve the website experience. See our cookie policy for further details on how we use cookies and how to change your cookie settings.
ACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

CookieDurationDescription
cookielawinfo-checbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

SAVE & ACCEPT