What exactly are Serveless?
-
As the name implies, Serverless means Serverless computing, a product of cloud computing, which is not a specific technology, but a set of ideas. There are several ways to interpret Serverless in the industry:
- In some cases it can be read as a software architecture approach, often referred to as
Serverless
architecture - In other cases, it may represent a product form called
Serverless
product
- In some cases it can be read as a software architecture approach, often referred to as
The Serverless architecture means that the server-side logic implemented by the developer runs in a stateless computing container, is triggered by events, is fully managed by a third party (such as a service operator), and its business-level state is recorded by the database and storage resources used by the developer.
When it comes to Serverless products, it means no need to understand, manage services, use on demand, pay for use. In fact, Serverless products can also include storage, computing and other types of products, and a typical computing product is the form of cloud function.
Cloud functions, or FaaS (Function as a Server), together with BaaS(Backend as a Server), can be called Serverless products. By combining these products, developers can build their own business server architecture.
Advantages of the Serverless architecture
Reduce o&M requirements
Serverless is a very simple outsourcing solution.
Serverless
This decouples applications from servers, eliminating the need to estimate resources and purchase and configure servers before services are online.Serverless
It also further reduces the workload of the underlying o&M. After the services are online, there is no need to worry about server o&M, but all the services are handed over to the cloud platform or cloud vendors.
Reduce development costs
IaaS
(Infrastructure as a Server) andPaaS
Platform as a Server exists on the premise that Server and operating system management can be commoditized.Serverless
The result of being another service is that entire application components are commoditized.
Ability to scale
Serverless
One obvious advantage of the architecture is that “horizontal scaling is fully automated, flexible, and managed by the service provider”. The biggest benefit from basic infrastructure is that you only pay for the computing power you need.
Easier administration
Serverless
The architecture is significantly simpler than the others. Fewer components means less overhead for your administration.
“Green” calculations
- According to Forbes magazine, typical servers in commercial and enterprise data centers provide only 5 to 15 percent of average maximum processing power output. This is undoubtedly a huge waste of resources. As the
Serverless
The emergence of architecture allows service providers to provide our computing power to maximize real-time needs. This will allow us to use computing resources more efficiently.
Serverless technology features
Different from the previous Serveless architecture, the technical features here refer specifically to computing products in Serveless products, namely cloud functions, which include the following technical features
1. Event driven
- Cloud functions are event-driven, or event-triggering functions
Serverless
Applications are not always online like native [listening-processing] applications, but start on demand- The definition of an event can be very rich, once
http
A request, a file upload, a database record change, a message sent, and so on can all be defined as events
2. Single event processing
- Triggers an instance of a cloud function that starts, handling only one event at a time
- You can focus on the business without having to worry about high concurrency and reliability in your code
- High concurrency of services is achieved through the high concurrency capability of cloud function instances
3. Automatic elastic compression
- Due to the event-driven and single-event nature of cloud functions, cloud functions support high concurrency through automatic scaling
- According to the actual number of events or requests, the cloud function automatically elastic appropriate processing instances to bear the actual traffic volume
- When there are no events or requests, there are no running instances and no resources
4. Stateless development
- Cloud functions may scale to 0 at runtime, depending on business elasticity, and cannot hold state data in the runtime environment
- In distributed development, applications need to be kept stateless in order to scale horizontally
- You can leverage external services or products, such as databases or caches, to preserve state data
Application scenarios of Serverless
The Web application
Serverless
The architecture supports various static and dynamic Web applications. For example, RESTful API request actions (get, POST, etc.) can be mapped toFaaS
The function. throughFaaS
Automatic elastic expansion function,Serverless
Web applications can quickly host high-traffic sites.
Mobile Internet
Serverless
Application byBaaS
Interconnect different back-end services to meet business requirements and improve application development efficiency. The front-end connects to mobile terminals through the automatic elastic expansion provided by FaaS, making it easier for developers to cope with sudden traffic growth. Under the FaaS architecture, applications exist in the form of functions. The relative independence of each function logic makes it easier to update applications, resulting in a shorter time to develop, test, and launch new features.
Internet of Things (IoT)
- Internet of Things (IoT) applications need to connect to a huge number of different devices. Different devices need to continuously collect and transmit data to the server.
Serverless
Architecture can help iot applications connect to different data input sources.
Multimedia processing
- Video and picture websites need to process and convert the pictures and video information uploaded by users. However, this multimedia transformation is not done all the time, but only when certain events occur, such as when users upload or edit pictures and videos. through
Serverless
Event-driven mechanism, users can trigger the processing logic when a specific event occurs, thus saving the cost of computing resources in idle time, and ultimately reducing the cost of o&M.
Data and event flow processing
Serverless
It can be used for real-time analysis and processing of some continuous event flows and data flows, real-time filtering, transformation and analysis of events and data, and then trigger the next processing. For example, it analyzes the logs of various systems or social media information in real time, and records and generates alarms for key information that meets specific characteristics.
System integration
Serverless
The functional architecture of the application is well suited for system integration. Instead of developing and operating a complete application for some simple integration logic as in the past, users can focus more on the required integration logic and only write the code logic related to integration, rather than a complete application. The distributed architecture of function application makes the addition and change of integration logic more flexible.
All of the above can be built and deployed on a normal container cloud platform, but with Serverless’s higher level of abstraction and encapsulation, we can develop build and deploy faster, and services can be better behaved, bringing us closer to our vision of a code – only, server-free world.
Why use itServeless
?
- Server ess is the inevitable course of cloud computing development
- Most ideas and technologies don’t come out of thin air, obviously
Serveless
The application ofThe liberation of the production.Serverless
The mode encapsulates almost all the underlying resources and system operation and maintenance work, making it easier for developers to use the cloud infrastructure, with most of the focus on the business level and faster delivery time.Serverless
Can reduce the cost, reflected in the computing resources and human cost two levels. Flexible scaling and pay-as-you-go transform computing resources from a fixed cost to a variable cost, reducing the workload and labor ratio by eliminating the need to focus on the underlying architecture.
Current status and limitations of Serverless
Full reliance on third parties, vendor lock-in
- The platform provides
Serverless
The architecture gives a player, such as AWS Lambda, the AWS specified services it needs to run, such asAPI gateway
.DynamoDB
.S3
And so on, once this service is used to develop complex systems, it will stick to AWS, and the paid computing is left to the operators, and it will feel like being strangled. It’s also the main reason that people are more or less afraid to actually put their own online services, soFew have actually landed. - High migration costs. Different platforms have event-triggering mechanisms that are specific to their own platforms, resulting in high migration costs.
Cold start slow & High frequency trigger scenario
Serverless
The technology is triggered by an event, and when the application is not running, it goes into a “sleep state”. When the next request comes, the application needs to be enabled for a certain period of time, known as a “cold start”Cold start times vary depending on the development language.Node.js
Applications are fine, but Java and C# with virtual machines can take a long time, so you can combine some means to wake up your application periodically. If the application is running continuously for a long period of time, processing a large number of requestsServerless
The model is not really suitable because the billing can be very high.
Toolchain (lack of debugging, development, logging tools)
- There have been
Serverless
Friends of relevant practice should be able to feel this deeply, but it is also caused by the lack of ecological maturity, ifServerless
As apps become more and more popular, this pain point will gradually disappear.
conclusion
There are a lot of people who are both bullish and bearish on Serverless, but there is no doubt that Serverless applications still have a long way to go in production.
Reference article:
From IaaS to FaaS — The Past and present of the Serverless architecture
Basic concepts of Serverless
The Original vision, present and future of Serverless
You should know this when we talk about Serverless
Advantages and disadvantages of the Serverless architecture
Serverless (Middle) : The pros and cons of the Serverless architecture
🏆 issue 7 | all things can be Serverless technology projects