- serverless integration platform
Serverless computing is a cloud usage model that allows developers to focus on running applications without having to worry about building or operating servers. With the widespread adoption of cloud services such as Amazon Web Services (AWS), it has become a standard choice in modern infrastructure design.
However, there are many practical questions, such as "Will the server completely disappear?" and "How is this different from traditional cloud (virtual servers)?", and in many cases, the criteria for deciding whether to implement it are unclear.
This article provides a thorough explanation of serverless architecture, including its mechanisms, advantages, and disadvantages, comparing them to traditional server configurations. Using major AWS services as examples, we've organized everything from specific design patterns to adoption criteria from a practical, real-world perspective.
Serverless computing is a cloud model that allows users to run applications without being aware of the existence of servers. By having cloud providers handle physical and virtual infrastructure operations such as OS patching and capacity adjustment, developers can concentrate on implementing business logic.
The term "serverless" does not mean that servers physically disappear. In reality, servers are running in the cloud provider's data center, but the complex management process is "abstracted" so that it is not visible to the user.
In traditional configurations, users were responsible for everything from OS selection and middleware configuration to load-based scaling design. In contrast, serverless computing provides these services as managed services. Taking AWS Lambda as an example, developers only need to "upload their code" and don't need to worry about the number of servers running in the background or their maintenance.
The biggest advantage of adopting serverless computing is that the scope of responsibility for operation and maintenance (the point of responsibility division) shifts significantly to the cloud provider.
While the burden of infrastructure management will be dramatically reduced, this does not mean that design considerations will no longer be necessary. In practice, correctly understanding that "server management will be reduced, but the responsibility for code efficiency and security design still rests with the user" is key to preventing discrepancies between expectations and reality after implementation.
Unlike the traditional "always-on, on-demand" model, serverless computing operates on a dynamic mechanism of "running only when and as needed." This explanation will cover the three pillars that support this mechanism.
The foundation for serverless computing is "event-driven" architecture. It automatically executes processes triggered by "changes" that occur within the system.
This mechanism allows developers to run the system simply by defining "what happens (trigger) and what to do (action)."
This "action" is handled by FaaS (Function as a Service). In this model, exemplified by AWS Lambda, applications are managed not as a huge monolith, but in units of "small functions" that have specific functionalities.
If developers register their functions (program code), the cloud provider will allocate resources such as containers only at the moment of execution and immediately release them once processing is complete. This frees developers from the "preparation of the execution environment," such as booting the OS or preparing the runtime.
The true value of serverless computing lies in its direct connection to operational flexibility and cost savings.
The easiest way to understand the characteristics of serverless architecture is to compare it with other execution environments. The biggest difference lies in the "infrastructure management layer."
With on-premises or IaaS (such as Amazon EC2), users are responsible for managing the physical or virtual "box."
In contrast, serverless architecture entrusts the maintenance and management of the "execution environment itself" entirely to the cloud provider.
Container environments like Amazon ECS/EKS package applications and enhance portability, but the concepts of "resource allocation (how much CPU/memory to use)" and "cluster operation" still remain.
Serverless architecture even abstracts away the concept of containers. The user's concern narrows further from "container specifications" to "function execution."
However, containers excel in systems with long processing times and complex dependencies, so the general rule of thumb is to use serverless if you want to minimize operational burden, and containers if you prioritize flexible customization and portability.
The differences in the scope of responsibility for each model can be summarized as follows:
Implementing serverless computing is more than just "outsourcing infrastructure management"; it brings about dramatic changes in business speed and cost structure. The main benefits are as follows:
The biggest advantage is being freed from the so-called "server maintenance." Applying OS security patches, runtime updates, and planning for hardware replacements due to hardware aging—all of these tasks, which were previously essential in traditional environments, become the responsibility of the cloud provider.
Engineers can redirect resources previously spent on "system maintenance" directly to "value creation," such as developing new features or improving the user experience.
Serverless computing renders the concept of pre-planned capacity a thing of the past. From a few requests to tens of thousands of spikes, the cloud automatically adjusts resources in milliseconds. Users don't need to set auto-scaling thresholds or worry about the number of servers based on load test results.
This solution simultaneously addresses both the risk of the site crashing due to excessive traffic and the inefficiency of maintaining an excessive number of backup servers.
Serverless billing is a system where you pay for the "work (execution)" performed, rather than the "existence" of the server.
Serverless computing is not a panacea. Its unique execution model presents new challenges that were not considered in traditional server configurations.
The biggest technical limitation of serverless computing is "cold start." As a consequence of the mechanism that releases resources when there are no requests, there is a delay (latency) when running the system after a long period of inactivity, waiting for the environment to start up.
In web applications where real-time performance is crucial, and in situations where initial delays that could lead to user abandonment are unacceptable, designing with this characteristic in mind is essential.
Serverless computing truly shines when it's tightly integrated with the proprietary managed services provided by cloud providers. A configuration centered around AWS Lambda, combined with Amazon DynamoDB and EventBridge, maximizes development efficiency, but makes migration to other clouds (such as Google Cloud or Azure) difficult.
Because it relies on unique API specifications and connection rules between services, systems that prioritize "portability that allows switching to another company at any time" require careful consideration, compared to introducing an abstraction layer or exploring container technology.
Because the system becomes a "collection of small functions," troubleshooting becomes more difficult. The traditional "tracking logs within a single server" approach is no longer effective. Requests flow across multiple services such as API Gateway, AWS Lambda, and databases, requiring distributed tracing techniques to pinpoint the source of the failure.
Ensuring "observability," which involves visualizing the entire request process using tools such as AWS X-Ray, is a prerequisite for stable operation.
The success or failure of serverless computing depends on its compatibility with the workload (processing characteristics). Instead of simply applying serverless to everything, use the following criteria to assess its suitability.
This is a case where the inherent strength of serverless architecture is utilized, as resources are only activated when an event occurs.
This is a case where the limitations of serverless architecture (execution limits and cold starts) become a bottleneck.
Serverless architectures are built not on a single service, but on a combination of multiple managed services with different roles. Here, we organize the key services that form the core of the design by "role."
This is the execution environment that acts as the command center for serverless systems.
Without needing to be aware of the server's presence, programs are executed triggered by specific events (such as API requests or file creation). AWS automatically controls everything from scaling to accommodate increases and decreases in requests to destroying the execution environment, allowing users to focus solely on writing the "business logic (code)."
This service acts as the "gateway" to the system.
It accepts external HTTP requests and securely forwards them to backend services such as AWS Lambda. It provides a full range of managed functions necessary for API operation, including authentication, authorization, and request flow limiting (throttling).
This is a storage location that does not require server management to maintain "state (data)".
It's the glue that connects disparate services into a single, cohesive system.
Designing serverless architecture is like putting together a puzzle of managed services. Here are two classic patterns that are frequently used in practice.
This is the most versatile configuration and is well-suited for "synchronous processing," which involves returning an immediate response to a request.
This configuration provides stable performance while minimizing operational effort, making it ideal for new services with unpredictable traffic or reservation sites that experience high traffic during specific time periods.
This pattern involves triggering heavy processing in the background based on events such as "file uploads." It is suitable for "asynchronous processing" that does not keep users waiting.
There is no need to keep a batch server running 24 hours a day, and large-scale data processing can be achieved with costs only incurred for the amount of processing actually performed.
Serverless computing is a powerful tool, but blind adoption can be counterproductive. Before deciding to implement it, evaluate your company's situation from the following two perspectives.
Serverless eliminates the need for "server management," but instead requires "advanced distributed design."
Serverless pay-as-you-go pricing means "0 yen" when there is no access, but the cost can skyrocket in proportion to the number of requests.
Serverless computing is a powerful model that frees you from server management and allows you to focus on development, but it's not a panacea. While it offers benefits like automatic scaling and pay-as-you-go pricing, it also has limitations such as inherent latency and design complexity. When implementing it, it's essential to calmly assess the characteristics of your workload and make the right decisions about which AWS services to use in the right places.