Java's persistent application in grid: Integration Approach (II.)

Source: Internet
Author: User

In this architecture, all JPA operations are used in place of data grids, and JPA operations typically use SQL for databases. This includes all the queries and all the updates. Fundamentally, we use the data grid to completely replace the database. Along with the JP QL transformation Support, although the data store is specialized in the middle-tier operation, we can still continue to use JPA for our design API. For systems, there is no need for long lasting storage, which is an ideal state. If you ask for more storage or query performance, you can simply increase the server to grid.

Database--rely on the data grid

Even if all query and update execution goes against the data grid, it is still possible to integrate into a persistent storage database. In this framework, the grid is responsible for passing the operational performance of the grid to the database. For example, entering an object into the grid will cause the database to be insert. The advantage of this architecture is that the data can still be used frequently, and updates are returned to the database and can be reported for purposes and so on. Ideally, grid operations will not be synchronized to the database, which can significantly weaken productivity. Asynchronous writing updates to the database can preserve the sensitivity of the grid and support persistent storage requirements.

Mix and match--Multiple structures

So far, we've treated the data grid as a repository of JPA, and we think that JPA is the API standard at the top of the data grid. The differences between this framework are not obvious. For a new object, it boils down to the configuration to see if JPA is written first on the database and then written to the data grid, or whether it is simply written on the grid. The logic for handling updates and deleting operations is the same as above. As we can see, the query operation is similar to this. If we can set up how to read, enter, and query the entity based on an entity, we can mix the schemas. Consider the interaction between the memory and the application. In such an application, you can get a "persistent" entity. But you will also get a brief entity. For a persistent entity, the entity-level architecture allows JPA to use the data grid as storage.

modifying JPA by Data grid

If it goes well, it is possible to combine JPA with the data grid, and to improve the productivity of the system by providing fast access to data management in the middle tier. But they also provide metrics for JPA applications, which are more measurable than normal methods.

In the traditional sense, increasing the application rate of JPA applications requires increasing the number of servers on the application cluster and distributing the work evenly using the download balance. But when you increase the size of the cluster, you find that the size of the cluster is limited by you, limiting what it can store without the need to introduce channels and connections between processes. Updating and then sharing data can be passed to all clustered servers to determine that the JPA storage does not contain stale data. For a cluster that accompanies n servers, this means that each update will produce N-1 information. When you increase the number of servers in the cluster, the rate at which each server handles a single synchronization update (N-1) 2 increases as any one update occurs, and each server must communicate with all other servers. What's worse, with the growth of the cluster, each server has to spend a lot of available processing time to resolve the new arrival update information. Those non-linear communication and update processing costs mean that the traditional methods of clustering JPA applications can work well with memory, and they are limited to clusters of small to medium models.

By having a shareable copy, the data grid resolves the communication problem, which comes from accessible objects for all servers. An update operation is not dependent on passing information to all servers, because it can keep up with changes the next time they need to update the object. In a data grid, with upgradeable point-to-point communication architectures (that is, you can break bottlenecks without the need for central information), an update relies on communication to the server, a server that stores objects, or a server that stores backups. In this case, the communication costs of accessing a single synchronization update for each server can be described in linear function C (N), and C is a continuous reflection of the number of replicas (basic and backed up). The cost of this linear update means that scaling up the cluster by using a data grid is likely to enable the evaluation of JPA applications, as well as higher productivity.

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.