`
wbj0110
  • 浏览: 1588380 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

How to Distribute Java Application on Multiple JVMs

阅读更多

Overview

Distributing your Java application on multiple JVM allows to process more user requests just by adding servers. This article tells how to do it.

Introduction

Java Application In a Single JVM

As business grows, applications must process increasing number of user requests. The amount of load that a single-JVM application can process has a hard limit. The limit is set by the capacity of the server the application is running on. Once this limit is reached, the application cannot process more requests.

Distributing Java applications on multiple JVMs allows applications to handle increasing load by using combined power of multiple servers.

Benefits of Distributing Java Applications

Distributing a Java application on multiple JVMs has three main benefits: processing more user requests just by adding servers, increasing application availability, and reducing request latency.

A Java application that can run on multiple serves, or a cluster, can process more requests because each server handles its own share of the load. The combined processing power of the cluster is much higher than the capacity of a single server, and it increases as more servers are added to the cluster.

Distributed Java applications provide better availability by running multiple application instances. Even if a single server fails, applications running on other servers continue to process user requests.

Java applications running in a cluster offer reduced latency by handling lesser load as compared to a single large JVM instance, and by having shorter garbage collections resulting from smaller heaps.

Architecture for Distributed Java Applications

To distribute a Java application on multiple JVMs, three things are necessary:

  1. A single source of truth such as a database
  2. A clustered cache such as Cacheonix
  3. A load balancer

Database

Distributed Java Application on Multiple JVMs

A single source of truth such as a database ensures that application data is stored reliably even if the application servers fail. In addition to the durable storage, the database provides applications shared access to the persistent application state.

Though the database plays an important role of a reliable transactional storage, this role also makes it a main bottleneck in the distributed application. As the number of application servers grows, they become increasingly stuck in waiting for responses from the database.

Cacheonix

Cacheonix enables horizontal scalability and consistent access to shared data.

Cacheonix makes sure that the application can scale horizontally by removing the database bottleneck. It significantly reduces the number of requests to the database by keeping all frequently accessed data in memory of a large clustered data store. Cacheonix creates this store by partitioning and distributing cached data so that each JVM carries a piece of the bigger cache.

Because application threads are running on separate JVMs, they cannot access their shared data directly anymore. Cacheonix provides consistent access to the shared data. When the data is updated on a single JVM, Cacheonix distributes data modifications reliably to all JVMs, even when servers fail or join the cluster. Without consistency, applications will be dealing with data conflicts caused by missed updates, which is usually a serious problem.

Load Balancer

A load balancer in front of the cluster makes sure that all servers receive fair share of user requests. A hardware load balancer is usually a best option as it provides maximum performance. Companies such F5 and Cisco are known for good hardware load balancers. If your budged cannot afford a hardware load balancer, an Apache server running a combination of mod_proxy, mod_rewrite and mod_redundancy can be another option.

Conclusion

An architecture combining a load balancer, Cacheonix and a database allows developers to create scalable and fast Java applications by distributing them to multiple JVMs.

分享到:
评论

相关推荐

    [Deployer:149026]Deploy application WebContent on myserver.

    标题中的 "[Deployer:149026]Deploy application WebContent on myserver" 提示我们这是一项关于部署Web应用程序的活动,其中“Deployer:149026”可能是一个特定部署工具或进程的标识符,而“myserver”指的是目标...

    Java.EE.and.HTML5.Enterprise.Application.Development

    Title: Java EE and HTML5 Enterprise Application Development Author: Arun Gupta, Geertjan Wielenga, John Brock Length: 176 pages Edition: 1 Language: English Publisher: McGraw-Hill Osborne Media ...

    Hacker's Guide to Scaling Python

    Python is an excellent programming language ... Adding a few interview of experts on the subject, you will learn how you can distribute your Python application so it can process thousands of requests.

    Packt.Hands-On.GUI.Application.Development.in.Go.1789138418.epub

    In the concluding chapters, you'll discover how to distribute to the main desktop marketplaces and distribution channels. By the end of this book, you'll be a confident GUI developer who can use the...

    Android TV Apps Development(Apress,2016)

    This one-of-a-kind short ...How to distribute Android TV apps Audience:Developers with some experience with Android development who are interested in building applications for the Android TV platform.

    Xcode Treasures: Master the Tools to Design, Build, and Distribute Great Apps

    When you’re ready to distribute your app, learn how Apple’s code-signing system really works. Find out when to let Xcode handle it automatically, and how to do it manually when needed. Discover how...

    Android TV Apps Development

    Series: Protocollen Voor De...How to distribute Android TV apps Audience:Developers with some experience with Android development who are interested in building applications for the Android TV platform.

    distribute

    【标题】:“distribute”是Python的一个包管理工具,它在早期被广泛使用,用于替代setuptools。在Python的生态系统中,包管理是至关重要的,因为它使得开发者能够方便地安装、发布和管理软件包。 【描述】:...

    Learn iOS Application Distribution Successfully Distribute Apps epub

    Learn iOS Application Distribution Successfully Distribute Apps 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Apache Maven Dependency Management

    Throughout the course of this book, you will learn how to migrate from non-Maven projects to Maven, learn Maven best practices, and how to simplify the management of multiple projects. The book ...

    wxPython Application Development Cookbook 2016无水印pdf 0分

    This book will provide you with the skills to build highly functional and native looking user interfaces for Python applications on multiple operating system environments. By working through the ...

    Learning Docker Networking(PACKT,2016)

    Docker provides the networking primitives that allow administrators to specify how different containers network with each application and connect each of its components, then distribute them across a...

Global site tag (gtag.js) - Google Analytics