1. Serverless and FaaS
Serverless is a cloud computing concept, i.e., Serverless Computing:
Serverless suggests that the cloud user simply writes the code and leaves all the server provisioning and administration tasks to the cloud provider.
All server-related configuration and management tasks are handed over to cloud providers, users don't need to spend much energy managing Server (or cloud resources), hence called Serverless
And FaaS (Function as a Service) is the key to Serverless:
The core of Serverless is FaaS (Function as a Service), but cloud platforms usually also provide Serverless frameworks to meet specific application requirements such as BaaS (Backend as a Service). Therefore, it can be simply understood as:
Serverless computing = FaaS + BaaS

Cloud functions provide conventional computing, supplemented by specific BaaS product ecosystems (such as object storage, databases, messaging mechanisms, etc.), users focus on implementing their function logic, greatly simplifying cloud programming
Sounds somewhat mystical, don't know when it will become reality, in fact, to this day (2020/7/5) there are already many relatively mature FaaS products on the market
2. FaaS Products Already on the Market
AWS Lambda
Amazon launched AWS Lambda service as early as 2015:
AWS Lambda - Run code without thinking about servers. Pay only for the compute time you consume.
A cloud computing service product that directly runs code without considering server (management and configuration), billed according to compute time used
That is to say, developers only need to upload code, Lambda can automatically handle everything required for code operation and high availability scaling:
Just upload your code and Lambda takes care of everything required to run and scale your code with high availability.
Main application scenarios include:
-
Data processing
-
Real-time file processing: such as creating thumbnails, converting video codes, processing logs, etc.
-
Real-time data stream processing: such as tracking user access metrics
-
Machine learning: preprocessing data before feeding into machine learning models
-
Backend: handling Web, mobile, Internet of Things (IoT) and 3rd party API requests
Also provides free trial package for small customers:
-
AWS China (Ningxia) Region Free Tier: 25GB NoSQL database + 1 million requests per month cloud function permanently free
-
AWS Overseas Region Account Free Tier: Same configuration, permanently free
Alibaba Cloud FC
Alibaba Cloud also provides FaaS solution, called Function Compute:
Function Compute - Alibaba Cloud Function Compute is an event-driven fully managed computing service. Through Function Compute, you don't need to manage servers and other infrastructure, just write code and upload. Function Compute will prepare computing resources for you to run your code in an elastic and reliable manner, and provide log query, performance monitoring, alarm and other functions. With Function Compute, you can quickly build any type of application and service without management and operations. Moreover, you only pay for resources actually consumed by code execution, no cost when code is not running.
Application scenarios are as follows:
-
Low-cost cross-border file transfer: large-scale file synchronization
-
File processing: such as compressing/decompressing, transcoding, adding watermarks to files uploaded to OSS
-
Frontend CI/CD system: Webhook notification triggers cloud function, uploads frontend code repository to OSS, goes through CDN deployment
-
Log ETL processing: processing and delivering data
-
Smart home appliances: smart home, App getting weather, environmental index
-
Small and medium websites: such as building serverless website based on Function Compute + wordpress
Also provides free package for small customers (1-10 person team):
But free quota is not very transparent, and does not rule out the possibility of charging fees in the future
P.S. Additionally, Alibaba Cloud's OSS seems to have no free quota, trial needs attention
Tencent Cloud SCF
Tencent Cloud's FaaS product is SCF (Serverless Cloud Function):
Cloud Function SCF - Cloud Function (Serverless Cloud Function, SCF) is a serverless execution environment provided by Tencent Cloud for enterprises and developers, helping you run code without purchasing and managing servers. You only need to write core code using languages supported by the platform and set conditions for code execution, then you can run code elastically and securely on Tencent Cloud infrastructure. SCF is an ideal computing platform for scenarios such as real-time file processing and data processing.
4 main promoted application scenarios:
-
Real-time file processing: such as audio/video transcoding
-
Data ETL processing: concurrent analysis and processing for big data sets (ETL is a typical Extract-Transform-Load data processing process)
-
Mobile and Web application backend: implement backend services in the form of cloud functions
-
AI inference prediction: after AI model completes training, provide inference services externally
Says there's a certain free quota per month, but outbound traffic is not free, trial needs caution
3. What Has FaaS Brought to Frontend?
With FaaS, it means being able to:
Directly run backend code without considering servers and other computing resources and service scalability, stability and other issues, even supporting facilities such as logs, monitoring, alarms are out-of-the-box
That is to say, launching a simple backend service (such as API aggregation, data orchestration) no longer requires experienced professional backend engineers to help:
-
Choose technology stack
-
Consider scaling mechanism under high concurrency
-
Estimate peak traffic, pre-allocate resources (apply for machines)
-
Go through CI/CD process
-
Access monitoring, operations system
We only need to provide a piece of code, the FaaS solution carefully developed by cloud providers helps us choose the best practice for the technology stack corresponding to the programming language, dynamically scale computing resources based on actual needs based on built-in scaling mechanism, easily deploy services to public network, and provide reliable monitoring and alarm guarantees
Feed FaaS a function, and a highly available service can be launched. (Simple) The professionalism requirements for service API development are lowered, frontend has greater room for play, including but not limited to:
-
BFF (Backend For Frontend)
-
SSR (Server-Side Rendering)
-
End-cloud integrated development
BFF
Backend For Frontend (BFF) (User Experience Adaptation Layer) concept is not new:
One backend per user experience
That is to say:
BFF is oriented to specific user experience, implemented and maintained by the frontend team implementing this part of UI (i.e., UI and corresponding BFF are responsible by the same team)
As early as 2018 (or even earlier), some teams began BFF exploration and practice based on Node.js, with frontend module developers responsible for completing some API development work on the corresponding BFF layer
With BFF layer, backend engineers can focus on business domains, but puts higher requirements on frontend engineers: need frontend-type full-stack engineers, and with BFF layer development, requirements are getting higher (scalability, stability, etc.)
The emergence of FaaS solves this problem well, BFF concept upgraded to SFF (Serverless For Frontend), encapsulating the backend service framework part with higher professionalism requirements into FaaS solution, transferring availability guarantee work outside business logic in BFF from frontend engineers to cloud providers' backend domain experts, each more professional and efficient
SSR
SSR (Server-Side Rendering) is also not a novel concept:
Generate complete HTML pages on the server
Saves network overhead of client's second request for data, and performance burden of rendering view templates, helps accelerate first screen loading. But SSR also faces problems similar to BFF, starting a Demo-level SSR rendering service is not difficult, but launching a highly available SSR rendering engine is by no means easy
FaaS makes high availability requirements for services within reach, stateless template rendering work is especially suitable for cloud functions to complete
P.S. Some Serverless Side Rendering solutions have already appeared in the community, such as ykfe/ssr
End-Cloud Integrated Development
That is frontend-backend integrated development, in a single project, can complete frontend presentation requirements and also handle data services
What's the difference from previous PHP, Java Web whole site development? Going around in circles back to the starting point?
Obviously not, main differences are:
-
Frontend-backend layered decoupling: frontend-backend integrated, but not overly coupled
-
Frontend project as main body: not like PHP, Java Web with backend part as main body
-
Not limited to Web, also applicable on mobile
Integration is reflected in:
-
A set of development/debugging environment based on cloud IDE, seamless development experience
-
Focus on frontend part, (almost) don't need to care about backend service deployment, operations
P.S. Currently there are also FaaS+React/Vue integrated development frameworks, such as midwayjs/midway
4. Future Possibilities
Facing the future, FaaS may also bring these changes:
-
More and more free/cheap solutions for small customers: such as mini program cloud, IoT development packages, etc.
-
FaaS-based Web service frameworks and traditional Web service frameworks tend to unify: applications based on traditional Web service frameworks can migrate over at low cost
-
Different frontend rendering methods such as SSR, CSR/NSR become configuration options for Web frontend frameworks: can flexibly switch between different rendering modes, even mix and use
-
Frontend enters full cloud R&D mode: FaaS popularization and BaaS ecosystem maturity accelerate SSR, BFF popularity, pulling frontend development from local environment to cloud
Are you ready?
No comments yet. Be the first to share your thoughts.