How Does Serverless Computing Work? - BunksAllowed

BunksAllowed is an effort to facilitate Self Learning process through the provision of quality tutorials.

Community

How Does Serverless Computing Work?

Share This
Serverless computing is event-driven FaaS, which involves provisioning, auto-scaling, and locating servers for efficient performance. It is important to note that serverless functions still run on servers, but with a third party managing them instead of the developer. An example of a traditional three-tier system with server-side logic is a website where users can search for and purchase textbooks. In serverless architecture, a client, load-balanced server, and database for textbooks are managed by a third party.
The configuration of a traditional architecture in which the server is provisioned and managed by the developer

A serverless architecture involves a shift in server and database structures, such as creating a cloud-provisioned API and mapping method requests to different functions. This allows for a more efficient application, with functions for each functionality and cloud-provisioned servers created based on demand. Additionally, a separate database may be created for searching and purchasing books, ensuring a more efficient and scalable system.
The configuration of a serverless architecture where servers are spun up and down based on demand

The online book store architecture diagrams differ in two ways: on-premises, where a single server needs load-balanced and auto-scaled by the developer, and cloud solution, where the application runs in stateless compute containers triggered by functions, and serverless, where services are separated.
Serverless computing differs from traditional server setup and infrastructure building by relying on third-party vendors for server maintenance. This difference impacts the overall application and development process, with the main differences being in application development and the independent processes used to create them.

Development

The development process for serverless applications differs from on-premise systems, with aspects like IDEs, source control, versioning, and deployment options established by developers either on-premises or with a cloud provider. A preferred method is to write serverless functions using IDEs like Visual Studio, Eclipse, and IntelliJ, and deploy them in small pieces to the cloud provider using the command-line interface. If the functions are small enough, they can be developed within the cloud provider's portal. However, most development environments have a limit on function size before requiring a zip upload. The command-line interface (CLI) is a powerful development tool that makes serverless functions and their services easily deployable, allowing developers to continue using their preferred development tools. The Serverless Framework tool can be installed using NPM.

Independent Processes

Serverless functions, also known as serverless microservices, are stateless and event-based, allowing each function to serve its own purpose and complete a process independently. This approach maintains modularity, allowing each function to represent one API method and perform one process. The Serverless Framework enforces smaller functions, focusing code and keeping it modular. Functions should be lightweight, scalable, and serve a single purpose. The idea of independent processes is preferred due to their flexibility and ability to adapt to different architectural styles and changes over time. This approach helps maintain modularity and focus on a single purpose.
A monolithic application is a single interwoven unit with a server-side application that handles all requests and logic associated with the application. This architecture model has several concerns, such as lack of understanding during development, inability to scale, limited re-use, and difficulty in repeated deployment. The microservices approach addresses these concerns by separating services into independent components, which are created, deployed, and maintained separately. This approach allows for easier and more efficient consumption and use of the application by other services, better scalability, and a reduced risk of single point of failure. Microservices are quicker to build and deploy, as they can be done independently without building the entire application. This makes development time quicker and more efficient, and allows for faster and easier development and testing.

Benefits and Use Cases

Developers and large businesses often face challenges in serverless architecture, such as granting cloud providers complete control over their service platform. However, there are numerous reasons and use cases that make this a beneficial decision.

Rapid Development and Deployment


Cloud providers handle infrastructure, maintenance, and autoscaling, reducing development time and making deployment easier. Developers are only responsible for the application, eliminating server setup time. AWS, Azure, and Google offer function templates for immediate executable function creation. Deployment becomes simpler with built-in versioning and aliasing for different environments, making it faster and more efficient. This makes development and deployment simpler and faster.

Ease of Use

Serverless solutions offer a significant advantage due to their ease of use, minimal ramp-up time, and cloud providers' services that simplify the implementation of complete solutions. The cloud environment allows for easy creation and provisioning of triggers for functions, requiring minimal maintenance. For example, the API gateway, managed by AWS, can be easily created and established as a trigger for a Lambda function. Serverless technology also offers testing, logging, and versioning, all managed by the cloud provider. These built-in features allow developers to concentrate on the code and application outcome.

Lower Cost


Serverless solutions charge per execution, not the entire application, ensuring you pay for what you're using. Cloud providers manage and autoscale the application's servers, offering a cheaper price than in-house costs. This means you pay for what you're using.

Enhanced Scalability


Serverless solutions offer scalability and increased availability due to third-party management of servers. This eliminates the time, money, and analysis required for auto-scaling and balancing. Cloud providers maintain compute capacity across availability zones and regions, ensuring the security and availability of serverless applications, protecting code from regional failures.


Netflix Case Study with AWS


Netflix, a leading video streaming service, has adopted a serverless architecture to automate media file encoding, backup validation, and AWS resource monitoring. To implement this, Netflix created triggering events in Lambda functions, synchronizing production actions to the disaster recovery site. They also improved automation through dashboards and production monitoring, demonstrating the effectiveness of the configuration through these events.

Happy Exploring!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.