Single-tiered
Performs all tasks
Not modular
Legacy technology
On-premises/On a Mainframe
Expensive to host/maintain
Long-lasting, yet perishable
Contains many layers
Difficult to modularize
Messy when applied directly to bare metal
There can be a "smell"
Separate the application tiers
Create microservices
Upgrade legacy technology
Re-write application code
Move to "the cloud"
Serverless Architecture is an event-driven system that uses remote functions (via a BaaS or a FaaS product) without concern for the operations of the containers that execute the code.
No Ops required*
Developers focus on code
Triggered by internal or external events
Built-in API Gateway
Costs nearly nothing
'use strict';
const catNames = require('cat-names');
function getCatName(event, context, callback) {
callback(null, { payload: `Your cat name is ${catNames.random()}.` });
}
module.exports.getCatName;
Responsible for one specific task
Lightweight and fast
Re-usable
Deployed independently
Stateless
Not dependent on other services
Look for functionality that has the fewest dependencies executable by an event:
Cron jobs
Background services
Calls to APIs
Maintenance scripts
Logging/analytics
Message bus
As more functionality is removed, less compute power is needed for the monolith. Re-engineering a small core is now more manageable and less expensive.
Modernization doesn’t have to be a one-time effort.
Serverless architecture facilitates gradual changes and results in a more immediate reduction in complexity and cost.