From the perspective of cost, Java microservice and cost

Source: Internet
Author: User

From the perspective of cost, Java microservice and cost

In recent years, microservices have been sought after for their good flexibility and scalability. Many companies have begun to adopt microservice architectures or transform existing single systems into microservices. IBM has also recently opened up the lightweight Java microservice application server Open Liberty. But is developing microservices using Java really the best choice? Elliot Forbes, a senior engineer from JPmorgan, analyzed the problem from the perspective of cost and compared it with microservices in other languages.

The team where Elliot was located initially developed a single system using Java. Their production environment has a total of 12 servers, with 20 to 30 instances deployed on each server, and each instance uses 8 GB of memory. In this way, a total of TB to TB memory is consumed. Later, they split a single microservice into five microservices and used containers to deploy microservices. Each container runs a microservice. Because it is based on JVM, at least 1 GB of memory is required. The original single instance used 8 GB memory. After splitting it into microservices, it only needed 5 GB to 6 GB memory, saving at least 2 GB memory.

But things won't be that simple. One of these microservices is responsible for providing REST APIs externally, which is the most critical part of the entire system. To improve availability, they deployed four instances in Europe, North America, and Asia. As a result, this microservice uses a total of 12 GB of memory, so the overall memory usage has increased a lot. Java Communication Group 669823128

What if I used the Go language instead of Java to develop microservices? The memory of each microservice can be reduced from 1 GB to 64 mb. Therefore, the microservice deployed with 12 instances only needs MB of memory, this is less memory than a single Java microservice instance.

Assume that microservices are deployed on the Google cloud platform. According to the GCP charging standard, the hourly fee for 1 GB of memory is between 1 cent and 2 cents, and the annual fee is about $87 to $175, in this case, 12 GB memory costs at least $1000 a year. Five microservices cost at least $5000 a year. If the Go language is used, the number is about $500, which is an order of magnitude less.

However, Elliot also explains that the cost is only one of the many factors to consider when using microservices. In addition to costs, you also need to consider the applicability of development languages and other issues. However, for large enterprises, they have a large number of microservices, and the cost is still an important factor. After all, they may save millions of dollars in a year.

Java Communication Group 669823128

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.