A Brief Introduction to five core policies of J2EE applications

Source: Internet
Author: User

ForJ2EEWe know that when developing an application, the decision in the architecture design phase will have a profound impact on the application performance and scalability. Now, when developing an application project, we are increasingly concerned with performance and scalability. Application performance problems are often more serious than application functions that are not rich. The former will affect all users, while the latter will only affect those users who happen to use this function.

As the owner of the application system, he has been asked to "do more with less money"-use less hardware, less network bandwidth, and shorter time to complete more tasks. J2EE is the best choice for providing components and general middleware services. To build a high-performance and scalable J2EE application, some basic architecture policies must be followed.

Cache)

In short, the cache stores frequently accessed data. During the entire lifecycle of an application, the data is stored in persistent memory or in memory. In the actual environment, a typical phenomenon is that in a distributed system, each JVM has a cache instance or one cache instance in multiple JVMs.

Cached data improves performance by avoiding access to persistent storage. Otherwise, excessive disk access and network data transmission will occur.

Copy

Replication allows you to create multiple copies of a specified application service on multiple physical machines to achieve greater throughput efficiency. Theoretically, if a service is replicated to two services, the system can process twice the request. Replication improves performance by reducing the load of each service by means of multiple instances of a single service.

Parallel Processing

Parallel Processing Splits a task into simpler subtasks and can be executed simultaneously in different threads.

Parallel processing improves performance by leveraging the multi-thread and multi-CPU features of the J2EE layer execution mode. Compared to processing tasks with one thread or CPU, processing multiple subtasks in parallel allows the operating system to allocate these subtasks in multiple threads or processors.

Asynchronous Processing

Application functions are generally designed to be synchronous or serial. Asynchronous processing only processes the very important part of the task and then immediately returns the control to the caller. Other part of the task will be executed later.

Asynchronous processing improves performance by shortening the time that must be processed before the control is returned to the user. Although you have done the same thing, you do not have to wait until the entire process is completed to continue sending requests.

Resource Pool

The resource pool technology uses a set of prepared resources. Unlike the relationship between requests and resources, these resources can be shared by all requests. The use of resource pools is conditional and you need to measure the cost of the following two methods:

A. Maintain A set of costs that can be shared by all requests

B. The cost of re-creating a resource for each request

When the former is smaller than the latter, it is efficient to use the resource pool.

I hope this article will introduce the five core policies in J2EE, which will help you.

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.