Application Availability

Availability should be defined not just at the application level scope but also at each functionality level. It should be further quantified in terms of acceptable response time.

Availability of an application is increased by getting rid of single point of failure and this is done by converting this point into a pool of points so that if one goes down, the request is served by another point. Pooling the point is more commonly referred as horizontal scaling and building for it requires load balancing the requests hitting the application plus a provision for fail over support.

Load balancing and fail over support is done through deploying the application in a clustered environment. Clustering not only ensures high availability but also make the application more scalable. Clustering is the term which describes the was to provide redundant servers to ensure high availability.

Clustering is OK but what to cluster, anything where we are calling a distributed object, so need to cluster those components that can be deployed in a distributed way.

How to scale a J2EE application?

Some quite simple and basic points.

  • Get rid of single point of bottleneck : There can be any point across the whole architecture of a layered lava application which can act as a constraint from the application to scale . This point is know as the single point of bottleneck, Single point of bottleneck can be any service, resource or server that all the request shares and goes through, examples can be connection pools, singletons, databases, JMS queues, web services etc. First we need to identify that constraint and then identify the ways to remove that constraint. This should be done till we end up finding another constraint.

 

  • Do not use databases for everything : Do not persist high volume stuff which is of very little return like logging info, http session state (there are much better performing options for caching stuff like these) into the database. Put only those things which are persistent and transactional.

 

Read the rest of this entry »

It’s time for your database to perform

The number one reason for applications not performing the way they can is the database misuse. May be the following few simple steps can go a long way making our J2EE applications perform and scale well

1. Use databases for only that data which you need to persist and not for everything.

2. Model and design your database to third normal form in general but do the de-normalization of the database to cater to specific functional needs

3. Create indexes where necessary but lets not overdo it as it has its own impact while inserting stuff as database might take up lot of time updating them.

4. Learn about the specific datatypes our database offers and use them to maximum as some might perform better then the others
Read the rest of this entry »

JVM level Clustering Solution (Open Terracota)

What is it?

To make applications scalable and highly available we need to run java application on more then one JVM. This is known as JVM clustering. JVM-level clustering enables applications to be deployed on multiple JVMs, yet interact with each other as if they were running on the same JVM. Open Terracotta allows threads in a cluster of JVMs to interact with each other across JVM boundaries using the same build-in JVM facilities extended to have a cluster-wide meaning

What does it provide?

It provides transparent clustering and coordination services for the Java platform by allowing us to selectively share object graphs across the cluster (Heap level Replication), manage heaps much bigger than for a single JVM (Large Virtual Heap) and distributed wait/notify and synchronized capability (Cluster wide locking semantics). All this with no serialization.
Read the rest of this entry »