There’s a new approach to app development ripe with misconceptions and more buzzwords to translate to business sponsors. Industry analysts call it serverless, but it’s also known as backend as a service (BaaS), function as a service (FaaS), cloud-native architectures, or microservices—just to name a few. Whatever you call it, this approach is giving developers new freedom to focus on frontend functionality and deliver better, more innovative user experiences and ultimately establish value faster. Let’s discuss the pros and cons of serverless in enterprise architectures.
Handwritten Text Recognition for manuscripts and early printed texts
What serverless means for enterprise apps
1. What Serverless Means for
Enterprise Architecture
Sumit Sarkar
Chief Research Officer
2. Objectives
• What is Serverless?
• What are its Building Blocks?
• What Does Serverless Mean for Enterprise Apps?
• Design Considerations for a “Serverless” App
4. No clear definition?
With serverless computing, developers rely on
cloud-based servers, infrastructure, and operating
systems. The fact is, even though it’s called
serverless, servers are still involved. But, as a fully
managed service, the setup, capacity planning,
and server management are invisible to you
because they’re handled by the cloud provider. In
a traditional environment, developers must provision
and configure servers, install operating systems, and
continually manage the infrastructure. With a
serverless architecture, you’re free to create, manage,
and deploy apps that scale on demand—without
worrying about infrastructure. (Microsoft)
What is serverless computing?
Serverless computing allows you to build
and run applications and services
without thinking about servers. Serverless
applications don't require you to
provision, scale, and manage any
servers. You can build them for nearly any
type of application or backend service, and
everything required to run and scale your
application with high availability is handled
for you. (AWS)
What is Serverless computing?
Serverless lets you write and deploy code without the
hassle of managing the underlying infrastructure. It
enhances developer productivity by helping focus on what
matters the most — building great applications and
abstracting away the rest. Zero server management, no
upfront provisioning, auto-scaling to meet traffic demands,
and paying only for the resources used are just some of
the benefits of serverless computing. (Google)
5. Common Misconceptions
• Not just Functions as a
Service (FaaS)
• Doesn’t mean “no
servers”
• Not a specific technology
• Not “NoOps”
8. Let’s unpack this…
• Cloud-Native
• Not client-side (although can have client-side components)
• Not installed software
• Provisioned on-demand
• Fully redundant, load balanced
• Auto-scales
9. Let’s unpack this…
• For Implementing Application Logic
• Integrations with various backend systems and cloud services
• Functions to respond to events
• Services such as a data store, file repo, etc.
• Messaging
• Etc.
10. Let’s unpack this…
• Focus on the app, not servers
• No provisioning
• No managing
• No scaling concerns
17. Cloud Functions (a.k.a FaaS)
• Single, stateless, atomic functions that scale
• Write single function to implement a piece of business logic that is
invoked by the client application or some event
• Each function scales independently based on its needs
• Typical application may have tens or hundreds of cloud functions
18. Microservices
• Emphasis on “Micro”
• Very small, lightweight, single-purpose services
• Typical application may have several different microservices
• Easy to maintain
• In serverless context, are written in a way that the server
infrastructure (e.g. transport, ports, etc) is hidden from the
developer
19. Cloud Services
• No-code services that implement some backend application need
• Examples:
• Cloud Data Store
• File Store
• User management
• Integrations with data sources and SSO providers
• Any service that helps the developer implement their application
without thinking about servers.
20. Events – The Glue
• Logic responds to events
• Inside application
• External Events
• Examples:
• Before creating a new entity
• After deleting an entity
• In response to an HTTP endpoint
• In response to a client-side event, such as Geofencing
• Still in early stages
21. Cloud Functions
function onRequest(request, response, modules) {
var slack = modules.slack;
slack.chat.postMessage({
token: '<some_token>’,
channel: '@somechannel’,
text: request.username + ’ just entered the store’,
as_user: true,
username: 'storebot’
}, function(err, data) {
// Handle callback error or result
response.complete();
});
}
23. Delivering Value
• Focus on Value
• What do apps provide that’s different
• Spend more time on what provides business value, less time on technical
hurdles
• Focus on Experience
• Thinks about the client experience
• Builds the “UX” first
• Offloads complex app functions to cloud services, cloud functions, and
microservices.
• No need to worry about resource and scaling needs
24. Caution: Not an excuse to write bad code
for (i = 0; i < SOME_LIMIT; i++) {
for (j = 0; j < SOME_OTHER_LIMIT; j++) {
for (k = 0; k < SOME_THIRD_LIMIT; k++) {
// do something
}
}
}
25. High Productivity
• No Provisioning
• Fewer bottlenecks waiting on IT/DevOps
• Small, atomic units of code and configuration-based services lend
themselves to frequent, low-risk iterations
• Conducive to agile/lean methodologies
29. Source: 2018 Fiddler survey of independent developers by Progress
Dev Sentiment Survey
30. Survey Methodology
The target group was existing Fiddler users, which included two segments—
those who selected website development/debugging (further referred to as
Web developers) and mobile application development/debugging (further
referred to as Mobile developers) in the Fiddler download drop down menu.
Each of the two segments received a separate targeted survey.
Sample size – successfully conducted interviews (full completes) is 4,478 for
Web and 560 for Mobile.
Confidence level – 95% Statistical error – max. +/- %
31.
32. Q: How many web, mobile or both apps will your team be asked
to deliver in the next 12 months?
40. Focus on UX and Value First
• Design your user experience
• Build the logic that gives your app its value
• Extend the app with Serverless components
41. Federate Remote Sources
• Use serverless functions, data integration services, or microservices for
external data access or remote API access
• Serverless becomes your single interface for all your external systems
• Simplifies communication layer in client app
42. Think Small, Think Modular
• Each unit (function, microservice, cloud service) should do one job.
• Avoid monoliths. Avoid large, complex microservices.
• Group common tasks together
43. Think Stateless
• Serverless functions and microservices are ephemeral
• Scale up / Scale down as needed
• No guarantees that a single instance will be running at any given time
• Functions and services themselves are stateless
• Server-side *state* should be managed using a cloud datastore or
key/value store
44. Weakness
• Testing, Debugging is Difficult
• Resource Limits per Invocation
• Cold Start Up can Create Higher Latency
• Shared Code Libraries
• Some Approaches Better for Greenfield
46. Wrap-up
• Enable developers to focus on apps, not infrastructure
• Focus teams on app’s business value and user experience
• Enable high productivity by removing infrastructure, transport, and
protocol concerns
• Introduce app strategies that dynamically scale for digital apps
• Have a serverless mindset:
• Backend services as an extension of your app
• Small and modular
• Stateless and ephemeral
Research focused on appdev teams and goal is to learn more about EA
“There has to be a server somewhere”
Not Lambda, Kubernetes or Docker (rather those are enablers to serverless architecture)
Role of Ops will change in serverless arch, but doesn’t alleviate need
“Cloud washed”
Installing software misses point of serverless / cloud-native (based on following points)
Cloud enables this to be possible
Wrapper for legacy code
anything that requires high level performance processing
EA perspective on governernance?
Serverless allows application developers to focus on the application logic rather than what kind of resources are needed to run the application.
Example of having two app functions. 1 is data integration function that makes a request to REST API and returns data and #2 is password hashing algorithm for user auth. Each has very different perf needs. #2 is expensive and requires a lot of CPU which has different needs than data request to external system waiting for reply. Benefit is separately scaled (scale up / down) based on app needs.
Been around since 2012, invoked via SDK (hides server http, ports, routing, etc) or HTTP – refer to BaaS
Not unique to serverless – serverless+microservices have very specific characteristics
keep as small as possible to take advantage of individual scaling characteristics, so keep focus on single task.
With microservices, developers don’t know what’s going on under the hood, nor do they care if that service is powered by functions or FaaS. Functions are the building blocks, while the service provides the API.
FaaS is a compute option for building Microservices.
Messaging Notification, Email, Push, etc
Glue of Serverless Architecture
Examples on when to invoke – You want to know when Amazon or Walmart delivery guy is in your kitchen, geofencing event can trigger notification to you and launch a video in your phone.
Expecting a lot more use cases in next 3-5 years in event space (Consortium to standardize event message passing)
UX – fail fast customer reference
Triple for loop which is grossly inefficient and expect serverless to correct mistakes. It works well for scaling / managing resources for well performing apps, but not magic to solve bottlenecks in imperative programming.
Small -> make small changes to code to reduce risk and introduce bugs.
Some people say EAs are out of touch w/ devs; and vice versa.
Start w/ POV of app and prototype UI w/ dev control in contrast w/ ”citizen devs”
1 interface provides data virtualization
No need for separate REST, SQL Server, or Salesfroce communication layer
Each -> helps to get scaling benefits and reduces risk with code changes
Functions and microservices themselves should be designed in stateless manner
Maturity of tooling, not specific to serverless – new paradigm
Resource limits per invocation is valid, so requires good programming
Cold Start Up can create higher latency (frequency of use)
Shared code libraries – valid for AWS