Understanding Serverless Architecture: BaaS, FaaS, and Their Role in Cloud Computing
The article explains the evolution of server-centric models from IaaS, PaaS, and SaaS to modern Serverless concepts such as BaaS and FaaS, discusses their technical mechanisms, practical implementations with Flask, and surveys public, private, and packaging frameworks within the cloud computing ecosystem.
Since the rise of the Internet, servers have been the core component of network services, leading to three major service models: IaaS (Infrastructure as a Service), PaaS (Platform as a Service), and SaaS (Software as a Service).
IaaS provides hardware without software, PaaS bundles hardware and software for developers, while SaaS delivers a complete solution to end‑users.
The latest PaaS developments are BaaS (Backend as a Service) and FaaS (Functions as a Service), together referred to as Serverless. They do not keep continuously running custom services; instead, they share computing resources on a pay‑per‑use basis, similar to bike‑sharing.
BaaS does not store customer code; it offers shared generic logic that all customers can call, charging by API invocation and avoiding waste of provider resources.
FaaS, on the other hand, stores customer code, loads the relevant function on demand, executes it, and then unloads all resources, resembling the traditional PHP execution model.
Although FaaS appears to be a modern take on PHP, its forced function‑level execution model aligns well with micro‑service architectures and reduces resource consumption for providers, making it a cost‑effective solution for certain low‑end workloads.
To illustrate compatibility with existing Flask applications, the following code shows how a Flask service can expose two endpoints (/register and /specialize) so that it runs unchanged on a FaaS platform:
from flask import Flask, request, jsonify
app = Flask(__name__)
userfunc = None
@app.route('/register', methods=['POST'])
def register():
# Load all routes and return rule mapping
from .main import main as main_blueprint
app.register_blueprint(main_blueprint)
return jsonify(app.url_map._rules_by_endpoint)
@app.route('/specialize', methods=['POST'])
def load():
# Load a single endpoint on demand
body = request.get_json()
name = body['endpoint']
global userfunc
userfunc = imp.load_source(name)
return ""Serverless platforms can be grouped into three categories:
1. Public‑cloud Serverless: AWS Lambda, Microsoft Azure Functions, Google Cloud Functions, Webtask, Syncano.
2. Private‑cloud Serverless frameworks: Fission (Kubernetes), Funktion (Kubernetes), Kubeless (Kubernetes), Gestalt (DC/OS), IBM OpenWhisk (Docker), Iron Functions (Docker/Swarm/Kubernetes).
3. Serverless packaging frameworks: Serverless (Node.js), Apex (Go/AWS), Zappa (Python/AWS), Chalice (Python/AWS), Claudia.js (Node/AWS), Gordon (Python/AWS).
Examples of usage include AWS Lambda’s Zappa framework, which can package Flask or Django applications, and the open‑source Fission framework built on Kubernetes. Kubernetes itself consists of a master node (with apiserver, etcd, scheduler, controller‑manager) and worker nodes (with kubelet, proxy, Docker engine), enabling container orchestration for Serverless functions.
References:
"Adopting Serverless Architecture" – http://cloud.51cto.com/art/201703/534748.htm
"Introduction to Kubernetes" – https://blog.csdn.net/zhangjun2915/article/details/40598151
"Ten‑Minute Guide to Kubernetes Core Concepts" – http://www.dockone.io/article/932
"Kubernetes: The Definitive Guide"
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.