Ad Code

Responsive Advertisement

Advantages and Disadvantages of server-less computing

 

How to save time and cost with the advantages and disadvantages of server-less computing?




In order to solve the business problems faced, developers usually need to spend a certain amount of time to write the code, and then to the operation and maintenance engineer to ensure normal operation, the whole process is much longer than the development time. Because the operation and maintenance engineer not only has to know how to run the code written by the developer on a specific computer, but also to ensure that they run smoothly in the subsequent work-this is like a never-ending task. Why not leave this part of the work to others?

In the development of the past 20 years, many innovations in the IT field-virtual machines, cloud computing, containers-do not have to think too much about the underlying physical machine on which the code runs. In recent years, server-less computing has also become more and more popular. It does not need to know any hardware or operating system on which the code is running, because all of these are provided by the service provider.



Nowadays when people talk about server-less computing or server-less architecture, they are referring to "function as a service", in which the customer only writes the code that handles the business logic and uploads it to the supplier. The supplier is responsible for related hardware supply, virtual machine and container management, as well as tasks such as multi-threading.

Server-less services are event-driven, which means that the code is only called when the request is triggered. Vendors only charge for the time it takes to execute the code, not for physical or virtual servers that are maintained. These services can be created as pipelines or application components to interact with other code running on containers or traditional servers.

Advantages and disadvantages of server-less computing




Server-less computing has two obvious benefits: developers only need to focus on the business goals of the code, not infrastructure issues; and companies only pay for the computing resources they actually use, rather than buying physical hardware or renting idle cloud services.

This is particularly advantageous for event-driven applications. For example, an application may be idle most of the time, but under certain conditions must handle many event requests at the same time; or there is an application that processes data from IoT devices with limited or intermittent Internet connections. In both cases, traditional methods need to provide a powerful server capable of processing peaks, but this server is not fully utilized in most cases. With server-less architecture, you only pay for the server resources you actually use. Server-less computing is also suitable for certain types of batch processing, such as uploading and processing a series of individual image files and sending them to another node of the application.

The most obvious disadvantage of server-less is that they are not suitable for long-term tasks. Most server-less vendors will not let the code execute for more than a few minutes, but every time the service is started, it will not retain any data from the previously running instance. Please also note that server-less code may take up to a few seconds to start-this is not a problem for most use cases, unless your application requires low latency.

Server-less also has some other shortcomings, which may be related to the manufacturer. The current server-less market is dominated by large commercial cloud providers, which means that once developers use tools from vendors, it is difficult to switch if they are not satisfied. Moreover, because too much server-less computing is performed on the vendor's infrastructure, it is difficult to integrate server-less code into internal development and testing pipelines.

Server-less stacks


Server-less stacks

 

Similar to the situation in many software fields, the server-less era has witnessed the evolution of software stacks that combine the different components required to build server-less applications. The server-less stack contains the locale in which the code is to be written, the application framework that provides the structure for the code, and the trigger for the platform to start the code.

These contents vary depending on the supplier, and there are some differences. For example, for development languages, AWS Lambda supports Node.js, Java, Go, C#, and Python, but Azure only supports JavaScript,  and F Regarding triggers, many of AWS Lambda are for the AWS platform, such as Amazon Simple Email Service and AWS Code Commit; Google cloud services can also be triggered by general HTTP requests.

Server-less databases

Server-less databases


The disadvantage of server-less computing is that there is no persistent state, which means that the values ​​of local variables will not be saved. Therefore, any persistent data that the code needs to access must be stored elsewhere, and most server-less vendors provide databases that can interact with it.

Unlike other services, data in a server-less database is stored indefinitely. By configuring the cluster, all maintenance, patching, backup, replication and expansion of the database will be completed automatically, thus greatly saving cost. Function as a service, you only need to pay for the actual computing time used, and you can flexibly adjust resources according to your needs.

The three major server-less providers all provide their own server-less databases: Amazon has Aurora server-less and DynamoDB, Microsoft has Azure Cosmos DB, and Google has Cloud Fire-store.