users@glassfish.java.net

RE: Can I run multiple instances of one application

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Thu, 18 Apr 2013 20:40:59 -0400

Most people will do multi-tenant until they
peg memory
peg diskspace
peg the CPU

then they look for alternatives which is Clustering

http://glassfish.java.net/public/clustering31.html
I encourage you to install Clustering as an alternative to multi-tenant webapps
then you wont have to wait for your AppServer to peg resources before making the switch

HTH,
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 Date: Tue, 16 Apr 2013 20:24:14 -0500
Subject: Re: Can I run multiple instances of one application
From: blake_at_arahant.com
To: users_at_glassfish.java.net

Thanks. I knew all that but thought glassfish may have a way of abstracting all this and, in essence, giving me true multi-tenant for free. This is surely something glassfish could do, and it would be a big win for a lot of people. Perhaps some day.

Thanks!
Blake





On Tue, Apr 16, 2013 at 5:04 PM, Kevin Schmidt <kevin_at_nextgate.com> wrote:

You can deploy the same WAR file multiple times with different names/context roots to accomplish what you want. You would need to do something like having the application look at its name/context root to load a different set of properties or use a different data source name to connect to the different database, but that is very straight forward.

Note that this does in fact deploy the same code twice though. If you want only a single deploy but to use multiple backend databases, you may just need to make your app multi-tenant and have the logic in your code to connect to different databases based on the user.


From: Blake McBride <blake_at_arahant.com>
Reply-To: "users_at_glassfish.java.net" <users_at_glassfish.java.net>

Date: Tue, 16 Apr 2013 14:38:13 -0700
To: "users_at_glassfish.java.net" <users_at_glassfish.java.net>

Subject: Can I run multiple instances of one application

Greetings,
I have a web application that connects to a single database and serves X number of simultaneous users without a problem.

I would like to start up another instance of the same application that would connect to a different database and serve Y simultaneous users from a different URL.
If this is possible with glassfish, presumably it would be able to use a single copy of the code base with independent and isolated data spaces.

All the applications instances (for now) would be run on the same machine.
I know I can just copy the application code, reconfigure for another database, and boot it as a separate application. The point is not have to have multiple copies of the application on the disk or in memory. The only things different between the instances would be the database it points to, the URL to access it, and the memory it takes to support the runtime data.

I need this because the application is very large (15,000+ classes). I want to achieve the ability of creating many independent instances running without the need to have multiple copies of the code both on disk and in memory.

Thanks.
Blake McBride