Job Recruitment Website - Immigration policy - Wei Fu: Savior of Java EE or Gravedigger?
Wei Fu: Savior of Java EE or Gravedigger?
Some people say that Java is really bloated and often "makes a mountain out of a molehill". But the shortcomings of PHP and Node.js extensions are too obvious. Small applications can be done, but big applications can't be played. In addition, there are too many excellent frameworks in JavaEE field to solve the problem of development efficiency. In fact, using a framework such as Spring is as efficient as PHP. In the Internet age, many Java developers do not develop Web applications based on Servlet and EJBs, and WebLogic and WebSphere will only exist in the stock system of large companies. Internet company's Java is Tomcat's world.
So, can microservices completely make up for the shortcomings of JavaEE? For JaveEE, what role does microservice play, a rescuer or a grave digger?
At the beginning of the birth of Java, some giant companies, including IBM, BEA and Oracle, saw the huge business opportunities that Java, as an excellent Web programming language, might bring to them. So how do you make money through a programming language? The answer is to use this language to build extremely complex servers, so that those big companies spend a lot of money to buy these servers. Then followed by JavaEE specification, JSR specification, and server middleware such as WebLogic and WebSphere. Large packages are deployed on these servers, which run slowly and consume a lot of memory. Development and debugging based on these containers is a nightmare for developers. As compensation for them, they get rich rewards from their employers.
Because of the huge cost, few companies can support Java for a long time at a reasonable cost. If you want to build a website in Java, you must pay a lot of money to run these servers, even if you only use Servlet containers. For a long time, enterprises and companies have been using Java, because only these big companies can afford millions of dollars in server fees and pay high salaries for those enterprise-level developers.
RodJohnson released the Spring framework in 2003, and Spring provided IoC and POJO support to help developers escape from EJB. In this way, the development efficiency is greatly improved, and a large number of developers turn to Spring, leaving EJB aside. Application server developers have seen this, and they have provided some features in JavaEE5, which can reduce the burden on developers. Unfortunately, Spring is sought after all the way, and people almost confuse it with the JavaEE container. It still runs in JavaEE Servlet containers, which follow the design of ten years ago, without considering multi-core CPU and NIO.
Meanwhile, PHP is catching up. PHP uses less memory and resources and is supported by many companies. Some CMS platforms, such as WordPress, Drupal and so on. , are all built based on PHP, attracting a large number of PHP developers. However, although PHP is still the most popular programming language today, it also has its own shortcomings. The running speed is not very fast, and it is difficult to expand horizontally.
RyanDahl started the Node.js project in 2009, which supports asynchronous non-blocking and event-driven I/O. If the threads of the server are used properly, Node.js can greatly improve the response speed, and the throughput of a single server can rival that of a JavaEE server cluster. Node.js is a good work, but it also has its own limitations. Node.js is difficult to extend and integrate with legacy systems.
Undertow appeared in 20 14, which is a non-blocking Web server based on Java. According to the test results of #, on a Dell server worth $8,000, it can handle millions of requests per second, while Google needs a cluster to handle one million identical requests. It is lightweight, its core only needs 1M memory, and it also includes an embedded server, which uses less than 4M heap memory.
LightJavaFramework based on UndertowCore is a microservice container, which supports design-driven and code generation, runtime security and runtime verification.
JavaEE Vendors Many years ago, JavaEE vendors, such as Oracle and IBM, spent hundreds of millions of dollars to develop application servers (WebLogic and WebSphere) and sold them to large organizations for millions of dollars. But now these servers can't be sold, because JBoss quickly seized the market share, and Oracle's support for JavaEE is also declining: #/story/16/07/02/1639 241/Oracle-May-have-stop-funding-and-development.
With the increasing attention to micro-services, it is difficult for these application servers to sell well because they are more suitable for deploying a single application. One application contains hundreds of EJBs. It took 45 minutes to test a line of code changes on WebLogic.
JavaEE customers
From the customer's point of view, it is not worthwhile to spend a lot of money on these servers, because what JavaEE promises may not be true. An application developed for WebSphere cannot be deployed on WebLogic, so you need to spend more money to upgrade the server, because the vendor may no longer support the old version of the server, and such an update will cost you millions of dollars. So some smart people can't help but ask, why deploy applications on these behemoths? Why package an application as an ear package or a war package instead of a jar package? Why can't we break down large applications into smaller blocks so that they can be deployed and expanded independently?
Microservice
Micro-service is the antidote to these problems. Wikipedia defines microservices as "a style of software architecture. Complex applications consist of independent processes that interact with each other using language-independent APIs. These process services are small in scale and highly discrete, focusing on a small task and using modular methods to build systems. " Micro-service architecture makes it easier to build applications, which are split into individual services and can be arbitrarily combined. Each service can be deployed independently or combined into an application. These services may also depend on other applications. It speeds up the development of services, because as long as the interface is defined, services can be developed in parallel.
Microservices are flexible and extensible. Microservices are not only dependent on a single server and deployment, they can be distributed to multiple machines, or to multiple data centers and any other available areas. If one service fails, another service can be started. Because the whole application is decomposed into micro-services (small services), some popular services can be easily extended horizontally.
If you have used COM, d COM, CORBA, EJB, OSGi, J2EE, SOAP and SOA, you will know that services and components are nothing new. One of the biggest problems that enterprises encounter when using components is to rely on large hardware servers and run many applications on the same server. We have EJB, war package and ear package, as well as various component packages, because server resources are too expensive, we should make the best use of them as much as possible.
However, judging from the development in recent years, the previous methods are somewhat outdated. Operating system servers are constantly changing, and virtual resources can be published as components, such as EC2, OpenStack, vagger, Docker, etc. The world has changed. Micro-service architecture has seen this trend, and hardware, cloud technology, multi-core CPU and virtual technology are also developing. We should change the previous development methods.
When starting a new project, don't use the EAR package or the WAR package. Now we can run the JVM in Docker. Docker is just a process, but it can work like an operating system. Docker runs on the operating system in the cloud, while the operating system in the cloud runs on the virtual machine, which runs on the Linux server. These servers do not belong to anyone, but are shared by many strangers. What if there is a rush hour? Simple, use more server instances. This is why Java microservices should run in a separate process, not in a JavaEE container or servlet container.
Microservices generally provide API endpoints based on HTTP/JSON. This can be easily integrated with other services (open source or closed source) as long as these services provide HTTP/JSON interfaces. Services can be consumed and combined in a more meaningful way. Amazon (or other companies) EC2, S3 and other services are the best examples. Infrastructure will become part of the application, and they are programmable.
Applications using micro-service architecture should be modular, programmable and composable. Microservices can be replaced with each other. Some parts of the application can be rewritten or improved without affecting the whole application. If all components provide programmable APIs, the interaction between microservices will become easier (never trust those microservices that cannot be accessed through curl).
With the popularity of microservices, many vendors have begun to try to turn their JavaEEWeb services into microservices, so that they can continue to sell their outdated products. APIGateway is one of these vendors.
JasonBloomberg is the chairman of Intellyx. In an article, he pointed out the difference between traditional Web services and micro-services, and questioned the trend of traditional Web services changing to micro-services:
#/Danger-Microservice-Cleaning-Obtaining Value-Stripping-Publicity
Micro-service is not a Web service in enterprise service bus, nor a traditional service-oriented architecture, although it follows some basic concepts of SOA. Fundamentally, microservices are different from SOA because the whole environment has completely changed.
The environment of micro-service architecture has no boundaries: end-to-end, cloud-based applications run on a fully virtualized and containerized infrastructure. Containers componentize applications and services, and DevOps provides a framework for IT infrastructure to help the development, deployment and management of automation environment.
Although containers are not necessary for microservices, microservices can easily run in containers. Moreover, it is not a wise choice to deploy non-microservice code in containers.
Container technologies such as Docker have been regarded as the best companion of microservices to some extent. Containers are the smallest subset of resources that run microservices. Docker simplifies the development of microservices and makes integration testing easier.
Containers are helpful for microservice development, but they are not necessary. Docker can also be used to deploy stand-alone applications. Micro-services and containers can be well integrated, but micro-services contain much more than containers!
conclusion
In recent years, the style of application development has been changing, and micro-services have become more and more popular. Large companies split large applications into small applications that can be deployed separately, and these small applications are deployed in containers in the cloud. LightJava is an open source microservice framework, which provides many features for these microservices running in containers. It supports design-driven, and developers only need to focus on business logic, and the rest can be handled by frameworks and DevOps processes. Then the problem is coming. what do you think?
- Previous article:202 1 National University of Singapore application conditions
- Next article:Where can I get a visa to go to America?
- Related articles
- Do I need a visa to apply for a Hong Kong account in Sri Lanka?
- Can I work while studying in New Zealand? What should I pay attention to?
- How to read Australian English?
- How about Hongye International Travel Service Co., Ltd.
- How many kilometers is it from Chongzuo to Youyiguan?
- Liu Zige married a married coach who was 23 years older than himself. Did the coach build a swimming base for her?
- My family composition is 100 words.
- Do you think they are all from China? Actually, I changed my nationality a long time ago.
- What is an American wedding visa K3?
- Postal Code of Immigrant Village, Daya Bay West Zone, Huiyang District, Huizhou City