You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Howard W. Smith, Jr." <sm...@gmail.com> on 2013/10/20 05:48:54 UTC

[OT but still JSF]: Clustering, session replication, and database, too

I had a question or two, since I have been reading "Java Summit - Pitfalls
in EE"[1] provided by Mark Struberg while having a discussion on tomee user
list.

The following page stated the following:

Page 134
Clustering

* We use 'asymmetric clustering'
* use sticky sessions
* backup away the session to a memcached after each
request
* do not replicate the session over to other nodes!
* Session-Replication always in node pairs.
* only restore the session from the memcached if a failover
happened
* msm can be integrated into OWB:
http://code.google.com/p/memcached-session-manager/

Since it says, 'We use asymmetric clustering' and other suggestions were
made, I found it appropriate to direct my question(s) to MyFaces 'JSF' user
list and committers.

is there some type of blog (or two or three) available that discuss how to
properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also, how
is the database replicated? I don't ever see database cluster/replication
discussed by JSF developers; i recently had to search for database cluster
and saw 'replication', which is something i have not had to worry about
since my previous work involved database teams while i was doing
front-end/GUI software.

now that i am doing java ee and jsf, i would love to know how to do
database clustering and/or replicating database while clustering JSF
webapp. Of course, right now, i only have one  tomee which references
'apache' derby (which is performing well, but I would love to get my feet
wet and cluster my web app + database). i did search derby's mail list
archives and i learned about sequioa and HA-JDBC (High-Availability JDBC).

i was hoping to get an answer from MyFaces 'JSF' users/committers...based
on their experience. I think someone told me that they use mysql
(clustering); my preference is still 'apache' derby (smile). please
remember, i'm wondering if any blogs are available that discuss clustering
tomcat (preference = tomee) + JSF web app (with database) + memcached
session manager.

Thomas has already started writing a blog[2] about this. I'm looking
forward to seeing sample config for it all (if available). :)

[1]
http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf

[2]
http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
interesting response, (and thanks) Mark!

glad you feel that way about clustering (expensive and not worth the
hassle), and scaling out the database for expensive queries/searches is
definitely what I want, because I really think the tomee+ stack is
performing very very well on my fast hardware. sadly, the (one) database
for queries+writes (performance) definitely can be improved!

will have to look into scaling out the database. thanks again!



On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de> wrote:

> DB replication basically works with the transaction log (IBM DB/2
> terminology, in Oracle it's called transfer tables). Each
> update/insert/delete statement gets written into a file and you can pick
> this file up from another node. This secondary node then does exactly the
> same like the first node. See e.g. Master/Slave setup on MySQL.
> Means after a commit, after a few ms the secondary (slave) node has
> exactly the same info as the master node. And if the master node fails,
> then you can easily fall over to the slave node.
>
> This can also be very helpful to 'scale out' in case you need performance:
>
> All write stuff is only performed on the master node, but expensive
> queries/searches might be performed on the n replication nodes. Of course
> this needs a special handling in your app, but allows to move the expensive
> queries away from your primary node.
>
> All other 'real' cluster solutions are really expensive and most of the
> times not worth the hassle imo ;)
>
>
> LieGrue,
> strub
>
> PS: usually clustering of Servlets are done by just 'pairing' up always 2
> different servlet containers (tomcat nodes A+B, C+D) and have full session
> replication on them. Means whenever a request is done it will move the
> whole session content to the paired node.
> With the msm you can get away from this.
>
>
>
> ----- Original Message -----
> > From: "Howard W. Smith, Jr." <sm...@gmail.com>
> > To: MyFaces Discussion <us...@myfaces.apache.org>
> > Cc:
> > Sent: Sunday, 20 October 2013, 12:56
> > Subject: Re: [OT but still JSF]: Clustering, session replication, and
> database, too
> >
> > also, i'm still wondering about how database is replicated while
> clustering
> > the app.
> >
> >
> > On Sun, Oct 20, 2013 at 5:34 AM, Thomas Andraschko <
> > andraschko.thomas@gmail.com> wrote:
> >
> >>  JFYI:
> >>  MyFaces+OWB on Tomcat with MSM is working fine.
> >>
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
interesting. thanks Jose'


On Sun, Oct 20, 2013 at 9:03 PM, José Luis Cetina <ma...@gmail.com>wrote:

> El 20/10/2013 19:34, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
> >
> > so, db server is on a separate machine/server on the network, and each
> EAR
> > is referencing the (one) db server via IP address?
> >
>
> Yes 2 tomee instances each in separete server point to a third server that
> only serve as db server. Thats why y have clustering only in webapps and
> not in db.
>
> > also, do you have an embedded db server (running inside of tomee and
> using
> > tomcat jdbc pooling) or network db server/engine?
> >
> >
>
> I use tomcat jdbc pooling (tomee with defined connections in tomee.xml)
>
> > On Sun, Oct 20, 2013 at 5:32 PM, José Luis Cetina <maxtorzito@gmail.com
> >wrote:
> >
> > > Ear with all my apps in each server (2 server each with their own ear)
> then
> > > each server insert/read in another unique db server.
> > > El 20/10/2013 16:09, "Howard W. Smith, Jr." <sm...@gmail.com>
> > > escribió:
> > >
> > > > Hmmm, i thought you said that you have EAR on one server and database
> on
> > > > separate server. are you running 2 tomee on same server; one tomee =
> EAR,
> > > > another tomee = database?
> > > >
> > > >
> > > >
> > > > On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <
> maxtorzito@gmail.com
> > > > >wrote:
> > > >
> > > > > By the way im not using remote calls. All my apps are in the same
> ear
> > > > with
> > > > > this i can inject my ejb local interface for calling methods in
> ejb.
> > > > > El 20/10/2013 07:49, "Howard W. Smith, Jr." <
> smithh032772@gmail.com>
> > > > > escribió:
> > > > >
> > > > > > just remembered-and-revised 2nd question, below...
> > > > > >
> > > > > > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > > > > > smithh032772@gmail.com> wrote:
> > > > > >
> > > > > > >
> > > > > > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <
> struberg@yahoo.de>
> > > > > > wrote:
> > > > > > >
> > > > > > >> This can also be very helpful to 'scale out' in case you need
> > > > > > performance:
> > > > > > >>
> > > > > > >> All write stuff is only performed on the master node, but
> > > expensive
> > > > > > >> queries/searches might be performed on the n replication
> nodes. Of
> > > > > > course
> > > > > > >> this needs a special handling in your app, but allows to move
> the
> > > > > > expensive
> > > > > > >> queries away from your primary node.
> > > > > > >>
> > > > > > >
> > > > > > > hmmm, had a question or two, or seeking clarification (or a bit
> > > more
> > > > > > > details or even a reference to a blog/article/document).
> > > > > > >
> > > > > > > 1. scale-out usually mean different physical servers? scaling
> out
> > > > > > multiple
> > > > > > > databases on one physical server, usually (or I would assume)
> means
> > > > > that
> > > > > > > the hard drive becomes the bottleneck, if hard drive contain
> > > multiple
> > > > > > > databases. right?
> > > > > > >
> > > > > > > 2. this needs special handling in your app? can you please
> clarify?
> > > > > > >
> > > > > > >
> > > > > > thanks!
> > > > > >
> > > > >
> > > >
> > >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
how many concurrent users is your app serving....normally or at peak times?

earlier, i think you mentioned response time is quite fast. did you throw
fast/high-performance hardware at db server, so db server responds fasts to
queries/updates?

do you have any expensive queries or updates...that may cause other
endusers to wait for a few seconds (or more)...if multiple users are using
your app, concurrently?

any (other db) performance issues that you'd like to share or you know
can/should be optimized to improve response time since one database is
serving 2 tomee/jsf/ear layer?




On Sun, Oct 20, 2013 at 9:03 PM, José Luis Cetina <ma...@gmail.com>wrote:

> El 20/10/2013 19:34, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
> >
> > so, db server is on a separate machine/server on the network, and each
> EAR
> > is referencing the (one) db server via IP address?
> >
>
> Yes 2 tomee instances each in separete server point to a third server that
> only serve as db server. Thats why y have clustering only in webapps and
> not in db.
>
> > also, do you have an embedded db server (running inside of tomee and
> using
> > tomcat jdbc pooling) or network db server/engine?
> >
> >
>
> I use tomcat jdbc pooling (tomee with defined connections in tomee.xml)
>
> > On Sun, Oct 20, 2013 at 5:32 PM, José Luis Cetina <maxtorzito@gmail.com
> >wrote:
> >
> > > Ear with all my apps in each server (2 server each with their own ear)
> then
> > > each server insert/read in another unique db server.
> > > El 20/10/2013 16:09, "Howard W. Smith, Jr." <sm...@gmail.com>
> > > escribió:
> > >
> > > > Hmmm, i thought you said that you have EAR on one server and database
> on
> > > > separate server. are you running 2 tomee on same server; one tomee =
> EAR,
> > > > another tomee = database?
> > > >
> > > >
> > > >
> > > > On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <
> maxtorzito@gmail.com
> > > > >wrote:
> > > >
> > > > > By the way im not using remote calls. All my apps are in the same
> ear
> > > > with
> > > > > this i can inject my ejb local interface for calling methods in
> ejb.
> > > > > El 20/10/2013 07:49, "Howard W. Smith, Jr." <
> smithh032772@gmail.com>
> > > > > escribió:
> > > > >
> > > > > > just remembered-and-revised 2nd question, below...
> > > > > >
> > > > > > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > > > > > smithh032772@gmail.com> wrote:
> > > > > >
> > > > > > >
> > > > > > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <
> struberg@yahoo.de>
> > > > > > wrote:
> > > > > > >
> > > > > > >> This can also be very helpful to 'scale out' in case you need
> > > > > > performance:
> > > > > > >>
> > > > > > >> All write stuff is only performed on the master node, but
> > > expensive
> > > > > > >> queries/searches might be performed on the n replication
> nodes. Of
> > > > > > course
> > > > > > >> this needs a special handling in your app, but allows to move
> the
> > > > > > expensive
> > > > > > >> queries away from your primary node.
> > > > > > >>
> > > > > > >
> > > > > > > hmmm, had a question or two, or seeking clarification (or a bit
> > > more
> > > > > > > details or even a reference to a blog/article/document).
> > > > > > >
> > > > > > > 1. scale-out usually mean different physical servers? scaling
> out
> > > > > > multiple
> > > > > > > databases on one physical server, usually (or I would assume)
> means
> > > > > that
> > > > > > > the hard drive becomes the bottleneck, if hard drive contain
> > > multiple
> > > > > > > databases. right?
> > > > > > >
> > > > > > > 2. this needs special handling in your app? can you please
> clarify?
> > > > > > >
> > > > > > >
> > > > > > thanks!
> > > > > >
> > > > >
> > > >
> > >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by José Luis Cetina <ma...@gmail.com>.
El 20/10/2013 19:34, "Howard W. Smith, Jr." <sm...@gmail.com>
escribió:
>
> so, db server is on a separate machine/server on the network, and each EAR
> is referencing the (one) db server via IP address?
>

Yes 2 tomee instances each in separete server point to a third server that
only serve as db server. Thats why y have clustering only in webapps and
not in db.

> also, do you have an embedded db server (running inside of tomee and using
> tomcat jdbc pooling) or network db server/engine?
>
>

I use tomcat jdbc pooling (tomee with defined connections in tomee.xml)

> On Sun, Oct 20, 2013 at 5:32 PM, José Luis Cetina <maxtorzito@gmail.com
>wrote:
>
> > Ear with all my apps in each server (2 server each with their own ear)
then
> > each server insert/read in another unique db server.
> > El 20/10/2013 16:09, "Howard W. Smith, Jr." <sm...@gmail.com>
> > escribió:
> >
> > > Hmmm, i thought you said that you have EAR on one server and database
on
> > > separate server. are you running 2 tomee on same server; one tomee =
EAR,
> > > another tomee = database?
> > >
> > >
> > >
> > > On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <
maxtorzito@gmail.com
> > > >wrote:
> > >
> > > > By the way im not using remote calls. All my apps are in the same
ear
> > > with
> > > > this i can inject my ejb local interface for calling methods in ejb.
> > > > El 20/10/2013 07:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> > > > escribió:
> > > >
> > > > > just remembered-and-revised 2nd question, below...
> > > > >
> > > > > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > > > > smithh032772@gmail.com> wrote:
> > > > >
> > > > > >
> > > > > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <
struberg@yahoo.de>
> > > > > wrote:
> > > > > >
> > > > > >> This can also be very helpful to 'scale out' in case you need
> > > > > performance:
> > > > > >>
> > > > > >> All write stuff is only performed on the master node, but
> > expensive
> > > > > >> queries/searches might be performed on the n replication
nodes. Of
> > > > > course
> > > > > >> this needs a special handling in your app, but allows to move
the
> > > > > expensive
> > > > > >> queries away from your primary node.
> > > > > >>
> > > > > >
> > > > > > hmmm, had a question or two, or seeking clarification (or a bit
> > more
> > > > > > details or even a reference to a blog/article/document).
> > > > > >
> > > > > > 1. scale-out usually mean different physical servers? scaling
out
> > > > > multiple
> > > > > > databases on one physical server, usually (or I would assume)
means
> > > > that
> > > > > > the hard drive becomes the bottleneck, if hard drive contain
> > multiple
> > > > > > databases. right?
> > > > > >
> > > > > > 2. this needs special handling in your app? can you please
clarify?
> > > > > >
> > > > > >
> > > > > thanks!
> > > > >
> > > >
> > >
> >

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
so, db server is on a separate machine/server on the network, and each EAR
is referencing the (one) db server via IP address?

also, do you have an embedded db server (running inside of tomee and using
tomcat jdbc pooling) or network db server/engine?


On Sun, Oct 20, 2013 at 5:32 PM, José Luis Cetina <ma...@gmail.com>wrote:

> Ear with all my apps in each server (2 server each with their own ear) then
> each server insert/read in another unique db server.
> El 20/10/2013 16:09, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
>
> > Hmmm, i thought you said that you have EAR on one server and database on
> > separate server. are you running 2 tomee on same server; one tomee = EAR,
> > another tomee = database?
> >
> >
> >
> > On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <maxtorzito@gmail.com
> > >wrote:
> >
> > > By the way im not using remote calls. All my apps are in the same ear
> > with
> > > this i can inject my ejb local interface for calling methods in ejb.
> > > El 20/10/2013 07:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> > > escribió:
> > >
> > > > just remembered-and-revised 2nd question, below...
> > > >
> > > > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > > > smithh032772@gmail.com> wrote:
> > > >
> > > > >
> > > > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de>
> > > > wrote:
> > > > >
> > > > >> This can also be very helpful to 'scale out' in case you need
> > > > performance:
> > > > >>
> > > > >> All write stuff is only performed on the master node, but
> expensive
> > > > >> queries/searches might be performed on the n replication nodes. Of
> > > > course
> > > > >> this needs a special handling in your app, but allows to move the
> > > > expensive
> > > > >> queries away from your primary node.
> > > > >>
> > > > >
> > > > > hmmm, had a question or two, or seeking clarification (or a bit
> more
> > > > > details or even a reference to a blog/article/document).
> > > > >
> > > > > 1. scale-out usually mean different physical servers? scaling out
> > > > multiple
> > > > > databases on one physical server, usually (or I would assume) means
> > > that
> > > > > the hard drive becomes the bottleneck, if hard drive contain
> multiple
> > > > > databases. right?
> > > > >
> > > > > 2. this needs special handling in your app? can you please clarify?
> > > > >
> > > > >
> > > > thanks!
> > > >
> > >
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by José Luis Cetina <ma...@gmail.com>.
Ear with all my apps in each server (2 server each with their own ear) then
each server insert/read in another unique db server.
El 20/10/2013 16:09, "Howard W. Smith, Jr." <sm...@gmail.com>
escribió:

> Hmmm, i thought you said that you have EAR on one server and database on
> separate server. are you running 2 tomee on same server; one tomee = EAR,
> another tomee = database?
>
>
>
> On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <maxtorzito@gmail.com
> >wrote:
>
> > By the way im not using remote calls. All my apps are in the same ear
> with
> > this i can inject my ejb local interface for calling methods in ejb.
> > El 20/10/2013 07:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> > escribió:
> >
> > > just remembered-and-revised 2nd question, below...
> > >
> > > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > > smithh032772@gmail.com> wrote:
> > >
> > > >
> > > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de>
> > > wrote:
> > > >
> > > >> This can also be very helpful to 'scale out' in case you need
> > > performance:
> > > >>
> > > >> All write stuff is only performed on the master node, but expensive
> > > >> queries/searches might be performed on the n replication nodes. Of
> > > course
> > > >> this needs a special handling in your app, but allows to move the
> > > expensive
> > > >> queries away from your primary node.
> > > >>
> > > >
> > > > hmmm, had a question or two, or seeking clarification (or a bit more
> > > > details or even a reference to a blog/article/document).
> > > >
> > > > 1. scale-out usually mean different physical servers? scaling out
> > > multiple
> > > > databases on one physical server, usually (or I would assume) means
> > that
> > > > the hard drive becomes the bottleneck, if hard drive contain multiple
> > > > databases. right?
> > > >
> > > > 2. this needs special handling in your app? can you please clarify?
> > > >
> > > >
> > > thanks!
> > >
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Hmmm, i thought you said that you have EAR on one server and database on
separate server. are you running 2 tomee on same server; one tomee = EAR,
another tomee = database?



On Sun, Oct 20, 2013 at 11:52 AM, José Luis Cetina <ma...@gmail.com>wrote:

> By the way im not using remote calls. All my apps are in the same ear with
> this i can inject my ejb local interface for calling methods in ejb.
> El 20/10/2013 07:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
>
> > just remembered-and-revised 2nd question, below...
> >
> > On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> > smithh032772@gmail.com> wrote:
> >
> > >
> > > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de>
> > wrote:
> > >
> > >> This can also be very helpful to 'scale out' in case you need
> > performance:
> > >>
> > >> All write stuff is only performed on the master node, but expensive
> > >> queries/searches might be performed on the n replication nodes. Of
> > course
> > >> this needs a special handling in your app, but allows to move the
> > expensive
> > >> queries away from your primary node.
> > >>
> > >
> > > hmmm, had a question or two, or seeking clarification (or a bit more
> > > details or even a reference to a blog/article/document).
> > >
> > > 1. scale-out usually mean different physical servers? scaling out
> > multiple
> > > databases on one physical server, usually (or I would assume) means
> that
> > > the hard drive becomes the bottleneck, if hard drive contain multiple
> > > databases. right?
> > >
> > > 2. this needs special handling in your app? can you please clarify?
> > >
> > >
> > thanks!
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by José Luis Cetina <ma...@gmail.com>.
By the way im not using remote calls. All my apps are in the same ear with
this i can inject my ejb local interface for calling methods in ejb.
El 20/10/2013 07:49, "Howard W. Smith, Jr." <sm...@gmail.com>
escribió:

> just remembered-and-revised 2nd question, below...
>
> On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
> smithh032772@gmail.com> wrote:
>
> >
> > On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de>
> wrote:
> >
> >> This can also be very helpful to 'scale out' in case you need
> performance:
> >>
> >> All write stuff is only performed on the master node, but expensive
> >> queries/searches might be performed on the n replication nodes. Of
> course
> >> this needs a special handling in your app, but allows to move the
> expensive
> >> queries away from your primary node.
> >>
> >
> > hmmm, had a question or two, or seeking clarification (or a bit more
> > details or even a reference to a blog/article/document).
> >
> > 1. scale-out usually mean different physical servers? scaling out
> multiple
> > databases on one physical server, usually (or I would assume) means that
> > the hard drive becomes the bottleneck, if hard drive contain multiple
> > databases. right?
> >
> > 2. this needs special handling in your app? can you please clarify?
> >
> >
> thanks!
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
just remembered-and-revised 2nd question, below...

On Sun, Oct 20, 2013 at 8:35 AM, Howard W. Smith, Jr. <
smithh032772@gmail.com> wrote:

>
> On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de> wrote:
>
>> This can also be very helpful to 'scale out' in case you need performance:
>>
>> All write stuff is only performed on the master node, but expensive
>> queries/searches might be performed on the n replication nodes. Of course
>> this needs a special handling in your app, but allows to move the expensive
>> queries away from your primary node.
>>
>
> hmmm, had a question or two, or seeking clarification (or a bit more
> details or even a reference to a blog/article/document).
>
> 1. scale-out usually mean different physical servers? scaling out multiple
> databases on one physical server, usually (or I would assume) means that
> the hard drive becomes the bottleneck, if hard drive contain multiple
> databases. right?
>
> 2. this needs special handling in your app? can you please clarify?
>
>
thanks!

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Sun, Oct 20, 2013 at 8:17 AM, Mark Struberg <st...@yahoo.de> wrote:

> This can also be very helpful to 'scale out' in case you need performance:
>
> All write stuff is only performed on the master node, but expensive
> queries/searches might be performed on the n replication nodes. Of course
> this needs a special handling in your app, but allows to move the expensive
> queries away from your primary node.
>

hmmm, had a question or two, or seeking clarification (or a bit more
details or even a reference to a blog/article/document).

1. scale-out usually mean different physical servers? scaling out multiple
databases on one physical server, usually (or I would assume) means that
the hard drive becomes the bottleneck, if hard drive contain multiple
databases. right?

2. hmmm, had another question, if I remember it, then I can ask it later.

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Mark Struberg <st...@yahoo.de>.
DB replication basically works with the transaction log (IBM DB/2 terminology, in Oracle it's called transfer tables). Each update/insert/delete statement gets written into a file and you can pick this file up from another node. This secondary node then does exactly the same like the first node. See e.g. Master/Slave setup on MySQL. 
Means after a commit, after a few ms the secondary (slave) node has exactly the same info as the master node. And if the master node fails, then you can easily fall over to the slave node. 

This can also be very helpful to 'scale out' in case you need performance:

All write stuff is only performed on the master node, but expensive queries/searches might be performed on the n replication nodes. Of course this needs a special handling in your app, but allows to move the expensive queries away from your primary node.

All other 'real' cluster solutions are really expensive and most of the times not worth the hassle imo ;)


LieGrue,
strub

PS: usually clustering of Servlets are done by just 'pairing' up always 2 different servlet containers (tomcat nodes A+B, C+D) and have full session replication on them. Means whenever a request is done it will move the whole session content to the paired node.
With the msm you can get away from this.



----- Original Message -----
> From: "Howard W. Smith, Jr." <sm...@gmail.com>
> To: MyFaces Discussion <us...@myfaces.apache.org>
> Cc: 
> Sent: Sunday, 20 October 2013, 12:56
> Subject: Re: [OT but still JSF]: Clustering, session replication, and database, too
> 
> also, i'm still wondering about how database is replicated while clustering
> the app.
> 
> 
> On Sun, Oct 20, 2013 at 5:34 AM, Thomas Andraschko <
> andraschko.thomas@gmail.com> wrote:
> 
>>  JFYI:
>>  MyFaces+OWB on Tomcat with MSM is working fine.
>> 
> 

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
also, i'm still wondering about how database is replicated while clustering
the app.

On Sun, Oct 20, 2013 at 5:34 AM, Thomas Andraschko <
andraschko.thomas@gmail.com> wrote:

> JFYI:
> MyFaces+OWB on Tomcat with MSM is working fine.
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
smiling big... while I wrote OP (last night, my time), I did find Thomas's
long discussion[1] with memcached-session-manager's committer/developer
(Martin). and I remember Thomas said that Martin (the mail list) is 'very
helpful', I think Thomas said that on primefaces forum.

Romain, that discussion might help a bit. I did not read it yet.

Thomas, I know that you remember that discussion...that's why you
lightly-and-indirectly mentioned that in primefaces forum. :)

[1]
https://groups.google.com/forum/#!msg/memcached-session-manager/yCTsORhu_3c/noV_IvW-YF0J


On Sun, Oct 20, 2013 at 5:34 AM, Thomas Andraschko <
andraschko.thomas@gmail.com> wrote:

> JFYI:
> MyFaces+OWB on Tomcat with MSM is working fine.
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Thomas Andraschko <an...@gmail.com>.
@romain
do you have any article about it? Just for my interesst.
What especially is optimized for tomcat?

I may use TomEE in the future - if our customers allow this.



2013/10/20 Romain Manni-Bucau <rm...@gmail.com>

> @thomas: same on tomee + tomee has another integration for it, optimized
> for tomcat
> Le 20 oct. 2013 11:35, "Thomas Andraschko" <an...@gmail.com> a
> écrit :
>
> > Hey,
> >
> > JFYI:
> > MyFaces+OWB on Tomcat with MSM is working fine.
> >
> > Don't know about TomEE.
> >
> > Regards,
> > Thomas
> >
> >
> > 2013/10/20 Karl Kildén <ka...@gmail.com>
> >
> > > Hello! I am also very interested in having more i.e. docs, examples and
> > > stuff for clustering across the tomee stack. The discussion came up on
> a
> > > jira some time ago and after that I asked Thomas to write a new post
> > about
> > > it (First part was great!).
> > >
> > > For example this is something that sounds really interesting and I want
> > to
> > > know more:
> > >
> > > * do not replicate the session over to other nodes!
> > >
> > > My scenarios are usually tomee with one war or tomcat with one war and
> > JSF,
> > > CDI, JPA only.
> > >
> > >
> > > On 20 October 2013 05:48, Howard W. Smith, Jr. <smithh032772@gmail.com
> > > >wrote:
> > >
> > > > I had a question or two, since I have been reading "Java Summit -
> > > Pitfalls
> > > > in EE"[1] provided by Mark Struberg while having a discussion on
> tomee
> > > user
> > > > list.
> > > >
> > > > The following page stated the following:
> > > >
> > > > Page 134
> > > > Clustering
> > > >
> > > > * We use 'asymmetric clustering'
> > > > * use sticky sessions
> > > > * backup away the session to a memcached after each
> > > > request
> > > > * do not replicate the session over to other nodes!
> > > > * Session-Replication always in node pairs.
> > > > * only restore the session from the memcached if a failover
> > > > happened
> > > > * msm can be integrated into OWB:
> > > > http://code.google.com/p/memcached-session-manager/
> > > >
> > > > Since it says, 'We use asymmetric clustering' and other suggestions
> > were
> > > > made, I found it appropriate to direct my question(s) to MyFaces
> 'JSF'
> > > user
> > > > list and committers.
> > > >
> > > > is there some type of blog (or two or three) available that discuss
> how
> > > to
> > > > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app?
> also,
> > > how
> > > > is the database replicated? I don't ever see database
> > cluster/replication
> > > > discussed by JSF developers; i recently had to search for database
> > > cluster
> > > > and saw 'replication', which is something i have not had to worry
> about
> > > > since my previous work involved database teams while i was doing
> > > > front-end/GUI software.
> > > >
> > > > now that i am doing java ee and jsf, i would love to know how to do
> > > > database clustering and/or replicating database while clustering JSF
> > > > webapp. Of course, right now, i only have one  tomee which references
> > > > 'apache' derby (which is performing well, but I would love to get my
> > feet
> > > > wet and cluster my web app + database). i did search derby's mail
> list
> > > > archives and i learned about sequioa and HA-JDBC (High-Availability
> > > JDBC).
> > > >
> > > > i was hoping to get an answer from MyFaces 'JSF'
> > users/committers...based
> > > > on their experience. I think someone told me that they use mysql
> > > > (clustering); my preference is still 'apache' derby (smile). please
> > > > remember, i'm wondering if any blogs are available that discuss
> > > clustering
> > > > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > > > session manager.
> > > >
> > > > Thomas has already started writing a blog[2] about this. I'm looking
> > > > forward to seeing sample config for it all (if available). :)
> > > >
> > > > [1]
> > > >
> > > >
> > >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> > > >
> > > > [2]
> > > >
> > > >
> > >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> > > >
> > >
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Romain Manni-Bucau <rm...@gmail.com>.
@thomas: same on tomee + tomee has another integration for it, optimized
for tomcat
Le 20 oct. 2013 11:35, "Thomas Andraschko" <an...@gmail.com> a
écrit :

> Hey,
>
> JFYI:
> MyFaces+OWB on Tomcat with MSM is working fine.
>
> Don't know about TomEE.
>
> Regards,
> Thomas
>
>
> 2013/10/20 Karl Kildén <ka...@gmail.com>
>
> > Hello! I am also very interested in having more i.e. docs, examples and
> > stuff for clustering across the tomee stack. The discussion came up on a
> > jira some time ago and after that I asked Thomas to write a new post
> about
> > it (First part was great!).
> >
> > For example this is something that sounds really interesting and I want
> to
> > know more:
> >
> > * do not replicate the session over to other nodes!
> >
> > My scenarios are usually tomee with one war or tomcat with one war and
> JSF,
> > CDI, JPA only.
> >
> >
> > On 20 October 2013 05:48, Howard W. Smith, Jr. <smithh032772@gmail.com
> > >wrote:
> >
> > > I had a question or two, since I have been reading "Java Summit -
> > Pitfalls
> > > in EE"[1] provided by Mark Struberg while having a discussion on tomee
> > user
> > > list.
> > >
> > > The following page stated the following:
> > >
> > > Page 134
> > > Clustering
> > >
> > > * We use 'asymmetric clustering'
> > > * use sticky sessions
> > > * backup away the session to a memcached after each
> > > request
> > > * do not replicate the session over to other nodes!
> > > * Session-Replication always in node pairs.
> > > * only restore the session from the memcached if a failover
> > > happened
> > > * msm can be integrated into OWB:
> > > http://code.google.com/p/memcached-session-manager/
> > >
> > > Since it says, 'We use asymmetric clustering' and other suggestions
> were
> > > made, I found it appropriate to direct my question(s) to MyFaces 'JSF'
> > user
> > > list and committers.
> > >
> > > is there some type of blog (or two or three) available that discuss how
> > to
> > > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also,
> > how
> > > is the database replicated? I don't ever see database
> cluster/replication
> > > discussed by JSF developers; i recently had to search for database
> > cluster
> > > and saw 'replication', which is something i have not had to worry about
> > > since my previous work involved database teams while i was doing
> > > front-end/GUI software.
> > >
> > > now that i am doing java ee and jsf, i would love to know how to do
> > > database clustering and/or replicating database while clustering JSF
> > > webapp. Of course, right now, i only have one  tomee which references
> > > 'apache' derby (which is performing well, but I would love to get my
> feet
> > > wet and cluster my web app + database). i did search derby's mail list
> > > archives and i learned about sequioa and HA-JDBC (High-Availability
> > JDBC).
> > >
> > > i was hoping to get an answer from MyFaces 'JSF'
> users/committers...based
> > > on their experience. I think someone told me that they use mysql
> > > (clustering); my preference is still 'apache' derby (smile). please
> > > remember, i'm wondering if any blogs are available that discuss
> > clustering
> > > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > > session manager.
> > >
> > > Thomas has already started writing a blog[2] about this. I'm looking
> > > forward to seeing sample config for it all (if available). :)
> > >
> > > [1]
> > >
> > >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> > >
> > > [2]
> > >
> > >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> > >
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Thomas Andraschko <an...@gmail.com>.
Hey,

JFYI:
MyFaces+OWB on Tomcat with MSM is working fine.

Don't know about TomEE.

Regards,
Thomas


2013/10/20 Karl Kildén <ka...@gmail.com>

> Hello! I am also very interested in having more i.e. docs, examples and
> stuff for clustering across the tomee stack. The discussion came up on a
> jira some time ago and after that I asked Thomas to write a new post about
> it (First part was great!).
>
> For example this is something that sounds really interesting and I want to
> know more:
>
> * do not replicate the session over to other nodes!
>
> My scenarios are usually tomee with one war or tomcat with one war and JSF,
> CDI, JPA only.
>
>
> On 20 October 2013 05:48, Howard W. Smith, Jr. <smithh032772@gmail.com
> >wrote:
>
> > I had a question or two, since I have been reading "Java Summit -
> Pitfalls
> > in EE"[1] provided by Mark Struberg while having a discussion on tomee
> user
> > list.
> >
> > The following page stated the following:
> >
> > Page 134
> > Clustering
> >
> > * We use 'asymmetric clustering'
> > * use sticky sessions
> > * backup away the session to a memcached after each
> > request
> > * do not replicate the session over to other nodes!
> > * Session-Replication always in node pairs.
> > * only restore the session from the memcached if a failover
> > happened
> > * msm can be integrated into OWB:
> > http://code.google.com/p/memcached-session-manager/
> >
> > Since it says, 'We use asymmetric clustering' and other suggestions were
> > made, I found it appropriate to direct my question(s) to MyFaces 'JSF'
> user
> > list and committers.
> >
> > is there some type of blog (or two or three) available that discuss how
> to
> > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also,
> how
> > is the database replicated? I don't ever see database cluster/replication
> > discussed by JSF developers; i recently had to search for database
> cluster
> > and saw 'replication', which is something i have not had to worry about
> > since my previous work involved database teams while i was doing
> > front-end/GUI software.
> >
> > now that i am doing java ee and jsf, i would love to know how to do
> > database clustering and/or replicating database while clustering JSF
> > webapp. Of course, right now, i only have one  tomee which references
> > 'apache' derby (which is performing well, but I would love to get my feet
> > wet and cluster my web app + database). i did search derby's mail list
> > archives and i learned about sequioa and HA-JDBC (High-Availability
> JDBC).
> >
> > i was hoping to get an answer from MyFaces 'JSF' users/committers...based
> > on their experience. I think someone told me that they use mysql
> > (clustering); my preference is still 'apache' derby (smile). please
> > remember, i'm wondering if any blogs are available that discuss
> clustering
> > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > session manager.
> >
> > Thomas has already started writing a blog[2] about this. I'm looking
> > forward to seeing sample config for it all (if available). :)
> >
> > [1]
> >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> >
> > [2]
> >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Karl Kildén <ka...@gmail.com>.
Hello! I am also very interested in having more i.e. docs, examples and
stuff for clustering across the tomee stack. The discussion came up on a
jira some time ago and after that I asked Thomas to write a new post about
it (First part was great!).

For example this is something that sounds really interesting and I want to
know more:

* do not replicate the session over to other nodes!

My scenarios are usually tomee with one war or tomcat with one war and JSF,
CDI, JPA only.


On 20 October 2013 05:48, Howard W. Smith, Jr. <sm...@gmail.com>wrote:

> I had a question or two, since I have been reading "Java Summit - Pitfalls
> in EE"[1] provided by Mark Struberg while having a discussion on tomee user
> list.
>
> The following page stated the following:
>
> Page 134
> Clustering
>
> * We use 'asymmetric clustering'
> * use sticky sessions
> * backup away the session to a memcached after each
> request
> * do not replicate the session over to other nodes!
> * Session-Replication always in node pairs.
> * only restore the session from the memcached if a failover
> happened
> * msm can be integrated into OWB:
> http://code.google.com/p/memcached-session-manager/
>
> Since it says, 'We use asymmetric clustering' and other suggestions were
> made, I found it appropriate to direct my question(s) to MyFaces 'JSF' user
> list and committers.
>
> is there some type of blog (or two or three) available that discuss how to
> properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also, how
> is the database replicated? I don't ever see database cluster/replication
> discussed by JSF developers; i recently had to search for database cluster
> and saw 'replication', which is something i have not had to worry about
> since my previous work involved database teams while i was doing
> front-end/GUI software.
>
> now that i am doing java ee and jsf, i would love to know how to do
> database clustering and/or replicating database while clustering JSF
> webapp. Of course, right now, i only have one  tomee which references
> 'apache' derby (which is performing well, but I would love to get my feet
> wet and cluster my web app + database). i did search derby's mail list
> archives and i learned about sequioa and HA-JDBC (High-Availability JDBC).
>
> i was hoping to get an answer from MyFaces 'JSF' users/committers...based
> on their experience. I think someone told me that they use mysql
> (clustering); my preference is still 'apache' derby (smile). please
> remember, i'm wondering if any blogs are available that discuss clustering
> tomcat (preference = tomee) + JSF web app (with database) + memcached
> session manager.
>
> Thomas has already started writing a blog[2] about this. I'm looking
> forward to seeing sample config for it all (if available). :)
>
> [1]
>
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
>
> [2]
>
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Mark Struberg <st...@yahoo.de>.
Try to avoid any remoting. Regardless whether remote EJB or even worse SOAP. The power it takes to transfer all your state to a different node is usually more than it takes to render your JSF pages. If you have performance issues then rather scale-out by adding another node and have a haproxy or any other load balancer with sticky session in front of it. 

LieGrue,
strub




----- Original Message -----
> From: "Howard W. Smith, Jr." <sm...@gmail.com>
> To: MyFaces Discussion <us...@myfaces.apache.org>
> Cc: 
> Sent: Sunday, 20 October 2013, 13:07
> Subject: Re: [OT but still JSF]: Clustering, session replication, and database, too
> 
> interesting response, Jose', thanks!
> 
> for some time, I thought that it might be best to have separate server
> (tomee + @EJB/DTO's + tomcat's jdbc + database) which is/becomes the
> database tier. I guess I need to learn how to do/make remote calls to EJB
> server from JSF web layer like you are doing.
> 
> i wonder if this is the typical/common/most-recommended-and-preferred
> solution.
> 
> hmmm, avoid database replication.
> 
> i have even seen tomcat committer (mark thomas slideshow/document on
> people.apache.org) mention that clustering your app should be avoided, if
> possible (or only used, if necessary). :)
> 
> 
> 
> 
> On Sun, Oct 20, 2013 at 1:30 AM, José Luis Cetina 
> <ma...@gmail.com>wrote:
> 
>>  I have a early experience with a "mini cluster" 2 servers using 
> tomee +
>>  memcached for session replication+ sticky session but using 1 only server
>>  for database (i mean i dont use db replication). My jsf apps (ear) are
>>  running in this mini cluster everithyng works fine except when i shutdown
>>  tomee for do a re deploy i always see an xhtml parser error. I could never
>>  configure it session replication with tomcat.
>> 
>>  In your web apps just use distributable tag in web.xml and all other are
>>  configuration. You can use memcached to not only session replication even
>>  thougth for savr information of your app and with this you can share
>>  information between your nodes and with this you dont persist information
>>  that could be "transient".
>>  The result is incredible.
>> 
>>  As i sayed i could never configure session replication with tomcat,  the
>>  only way i could do it is using memcached session replication.
>> 
>>  I dont know if anybody here have any experience with this.
>> 
>>  Regards Howard.
>>   El 19/10/2013 22:49, "Howard W. Smith, Jr." 
> <sm...@gmail.com>
>>  escribió:
>> 
>>  > I had a question or two, since I have been reading "Java Summit -
>>  Pitfalls
>>  > in EE"[1] provided by Mark Struberg while having a discussion on 
> tomee
>>  user
>>  > list.
>>  >
>>  > The following page stated the following:
>>  >
>>  > Page 134
>>  > Clustering
>>  >
>>  > * We use 'asymmetric clustering'
>>  > * use sticky sessions
>>  > * backup away the session to a memcached after each
>>  > request
>>  > * do not replicate the session over to other nodes!
>>  > * Session-Replication always in node pairs.
>>  > * only restore the session from the memcached if a failover
>>  > happened
>>  > * msm can be integrated into OWB:
>>  > http://code.google.com/p/memcached-session-manager/
>>  >
>>  > Since it says, 'We use asymmetric clustering' and other 
> suggestions were
>>  > made, I found it appropriate to direct my question(s) to MyFaces 
> 'JSF'
>>  user
>>  > list and committers.
>>  >
>>  > is there some type of blog (or two or three) available that discuss 
> how
>>  to
>>  > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? 
> also,
>>  how
>>  > is the database replicated? I don't ever see database 
> cluster/replication
>>  > discussed by JSF developers; i recently had to search for database
>>  cluster
>>  > and saw 'replication', which is something i have not had to 
> worry about
>>  > since my previous work involved database teams while i was doing
>>  > front-end/GUI software.
>>  >
>>  > now that i am doing java ee and jsf, i would love to know how to do
>>  > database clustering and/or replicating database while clustering JSF
>>  > webapp. Of course, right now, i only have one  tomee which references
>>  > 'apache' derby (which is performing well, but I would love to 
> get my feet
>>  > wet and cluster my web app + database). i did search derby's mail 
> list
>>  > archives and i learned about sequioa and HA-JDBC (High-Availability
>>  JDBC).
>>  >
>>  > i was hoping to get an answer from MyFaces 'JSF' 
> users/committers...based
>>  > on their experience. I think someone told me that they use mysql
>>  > (clustering); my preference is still 'apache' derby (smile). 
> please
>>  > remember, i'm wondering if any blogs are available that discuss
>>  clustering
>>  > tomcat (preference = tomee) + JSF web app (with database) + memcached
>>  > session manager.
>>  >
>>  > Thomas has already started writing a blog[2] about this. I'm 
> looking
>>  > forward to seeing sample config for it all (if available). :)
>>  >
>>  > [1]
>>  >
>>  >
>> 
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
>>  >
>>  > [2]
>>  >
>>  >
>> 
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
>>  >
>> 
> 

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
wow, good point. I don't ever create new users in app. currently, the app
is only 'for-office-use' only, but some day, i'm hoping the app will serve
the customers of the business (and endusers have already mentioned
some/different requirements where customers can login and do some stuff in
the app, specific for customers, of course).

i have already learned to cache 'static' data in @ApplicationScoped; a lot
of lists that show up in selectOneMenu, etc..., are instantiated-and-cached
on startup of the app (and inside the @ApplicationScoped bean).

based on your response, I can definitely cache the user data and some of
the 'static' data in the database. hmmm, i think I am doing that too, on a
few of the tables, but I will have to check that.

of course, omnifaces came up with a way for selectOneMenu to avoid the need
to use @EJB to verify elements in the list (via selectone converter, or
something like that)... i am not using that (yet). your idea, to cache the
'static' lists in database is definitely a better (performance) option than
the omnifaces feature.

evidently, i need to cache more data from my database in my
@ApplicationScoped bean. i love that (CDI) @ApplicationScoped bean!



On Sun, Oct 20, 2013 at 8:30 AM, Mark Struberg <st...@yahoo.de> wrote:

> With Caching I meant stuff like all the things which do not change often.
>
> There is a big difference between 'almost static' data and between 'living
> data'.
>
> E.g. the User data can surely be cached for 30 minutes. How often do you
> add or change a new user in your system?
> Same for e.g. an amazon catalogue. This can be perfectly be cached for at
> least an hour without having to hit the database again.
> Of course not all data can be cached, but lots of things which are kind of
> 'configuration like' can. And this can take away a lot of hits from the
> database which is then free to serve other more important stuff.
>
> LieGrue,
> strub
>
>
>
>
> ----- Original Message -----
> > From: "Howard W. Smith, Jr." <sm...@gmail.com>
> > To: MyFaces Discussion <us...@myfaces.apache.org>
> > Cc:
> > Sent: Sunday, 20 October 2013, 13:19
> > Subject: Re: [OT but still JSF]: Clustering, session replication, and
> database, too
> >
> > On Sun, Oct 20, 2013 at 7:07 AM, Howard W. Smith, Jr. <
> > smithh032772@gmail.com> wrote:
> >
> >>
> >>  hmmm, avoid database replication.
> >>
> >
> > honestly, I think HA-JDBC[1] (clustering the database) is all I really
> > need, because my app is quite fast, and only bottleneck is database
> layer.
> > I have seen David Blevins or Mark Struberg say that they reverted to
> > caching much of the data from database (in memory, on startup, I
> > guess/assume) to improve performance, but i wonder if caching the data is
> > really (really) necessary/recommended...
> >
> >
> > [1] http://ha-jdbc.github.io/
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Mark Struberg <st...@yahoo.de>.
With Caching I meant stuff like all the things which do not change often. 

There is a big difference between 'almost static' data and between 'living data'.

E.g. the User data can surely be cached for 30 minutes. How often do you add or change a new user in your system?
Same for e.g. an amazon catalogue. This can be perfectly be cached for at least an hour without having to hit the database again. 
Of course not all data can be cached, but lots of things which are kind of 'configuration like' can. And this can take away a lot of hits from the database which is then free to serve other more important stuff.

LieGrue,
strub




----- Original Message -----
> From: "Howard W. Smith, Jr." <sm...@gmail.com>
> To: MyFaces Discussion <us...@myfaces.apache.org>
> Cc: 
> Sent: Sunday, 20 October 2013, 13:19
> Subject: Re: [OT but still JSF]: Clustering, session replication, and database, too
> 
> On Sun, Oct 20, 2013 at 7:07 AM, Howard W. Smith, Jr. <
> smithh032772@gmail.com> wrote:
> 
>> 
>>  hmmm, avoid database replication.
>> 
> 
> honestly, I think HA-JDBC[1] (clustering the database) is all I really
> need, because my app is quite fast, and only bottleneck is database layer.
> I have seen David Blevins or Mark Struberg say that they reverted to
> caching much of the data from database (in memory, on startup, I
> guess/assume) to improve performance, but i wonder if caching the data is
> really (really) necessary/recommended...
> 
> 
> [1] http://ha-jdbc.github.io/
> 

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Sun, Oct 20, 2013 at 7:07 AM, Howard W. Smith, Jr. <
smithh032772@gmail.com> wrote:

>
> hmmm, avoid database replication.
>

honestly, I think HA-JDBC[1] (clustering the database) is all I really
need, because my app is quite fast, and only bottleneck is database layer.
I have seen David Blevins or Mark Struberg say that they reverted to
caching much of the data from database (in memory, on startup, I
guess/assume) to improve performance, but i wonder if caching the data is
really (really) necessary/recommended...

[1] http://ha-jdbc.github.io/

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
interesting response, Jose', thanks!

for some time, I thought that it might be best to have separate server
(tomee + @EJB/DTO's + tomcat's jdbc + database) which is/becomes the
database tier. I guess I need to learn how to do/make remote calls to EJB
server from JSF web layer like you are doing.

i wonder if this is the typical/common/most-recommended-and-preferred
solution.

hmmm, avoid database replication.

i have even seen tomcat committer (mark thomas slideshow/document on
people.apache.org) mention that clustering your app should be avoided, if
possible (or only used, if necessary). :)



On Sun, Oct 20, 2013 at 1:30 AM, José Luis Cetina <ma...@gmail.com>wrote:

> I have a early experience with a "mini cluster" 2 servers using tomee +
> memcached for session replication+ sticky session but using 1 only server
> for database (i mean i dont use db replication). My jsf apps (ear) are
> running in this mini cluster everithyng works fine except when i shutdown
> tomee for do a re deploy i always see an xhtml parser error. I could never
> configure it session replication with tomcat.
>
> In your web apps just use distributable tag in web.xml and all other are
> configuration. You can use memcached to not only session replication even
> thougth for savr information of your app and with this you can share
> information between your nodes and with this you dont persist information
> that could be "transient".
> The result is incredible.
>
> As i sayed i could never configure session replication with tomcat,  the
> only way i could do it is using memcached session replication.
>
> I dont know if anybody here have any experience with this.
>
> Regards Howard.
>  El 19/10/2013 22:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
>
> > I had a question or two, since I have been reading "Java Summit -
> Pitfalls
> > in EE"[1] provided by Mark Struberg while having a discussion on tomee
> user
> > list.
> >
> > The following page stated the following:
> >
> > Page 134
> > Clustering
> >
> > * We use 'asymmetric clustering'
> > * use sticky sessions
> > * backup away the session to a memcached after each
> > request
> > * do not replicate the session over to other nodes!
> > * Session-Replication always in node pairs.
> > * only restore the session from the memcached if a failover
> > happened
> > * msm can be integrated into OWB:
> > http://code.google.com/p/memcached-session-manager/
> >
> > Since it says, 'We use asymmetric clustering' and other suggestions were
> > made, I found it appropriate to direct my question(s) to MyFaces 'JSF'
> user
> > list and committers.
> >
> > is there some type of blog (or two or three) available that discuss how
> to
> > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also,
> how
> > is the database replicated? I don't ever see database cluster/replication
> > discussed by JSF developers; i recently had to search for database
> cluster
> > and saw 'replication', which is something i have not had to worry about
> > since my previous work involved database teams while i was doing
> > front-end/GUI software.
> >
> > now that i am doing java ee and jsf, i would love to know how to do
> > database clustering and/or replicating database while clustering JSF
> > webapp. Of course, right now, i only have one  tomee which references
> > 'apache' derby (which is performing well, but I would love to get my feet
> > wet and cluster my web app + database). i did search derby's mail list
> > archives and i learned about sequioa and HA-JDBC (High-Availability
> JDBC).
> >
> > i was hoping to get an answer from MyFaces 'JSF' users/committers...based
> > on their experience. I think someone told me that they use mysql
> > (clustering); my preference is still 'apache' derby (smile). please
> > remember, i'm wondering if any blogs are available that discuss
> clustering
> > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > session manager.
> >
> > Thomas has already started writing a blog[2] about this. I'm looking
> > forward to seeing sample config for it all (if available). :)
> >
> > [1]
> >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> >
> > [2]
> >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
romain, i have recognized and (gmail) star'red the mail list topics related
to tomee clustering. have not tried yet, but i don't see (any) mention of
how database is replicated while clustering tomee.

On Sun, Oct 20, 2013 at 2:11 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> PS: if tomee clustering has issues please help us working on it on trunk
> and tomee list
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by José Luis Cetina <ma...@gmail.com>.
Ok Romain. Im not sure if is tomee issue of msm issue, but i will send you
a mail with the info to the tomee mailing list.


2013/10/20 Romain Manni-Bucau <rm...@gmail.com>

> Hi
>
> Tomcat/tomee session replication; memcached and custom session manager
> (hazelcast) solutions are different.
>
> Typically in some of them you accept SPoF, not in others. The perf are not
> the same too. Finally guarantees (synchronous or not persistence) can be
> different too.
>
> Mark info were consistent but adapted to his apps I think. The "theorical"
> solution is sometimes not enough...
>
> Was just to give some more inputs and dont believe in IT you have a single
> solution.
>
> PS: if tomee clustering has issues please help us working on it on trunk
> and tomee list
> Le 20 oct. 2013 07:30, "José Luis Cetina" <ma...@gmail.com> a écrit :
>
> > I have a early experience with a "mini cluster" 2 servers using tomee +
> > memcached for session replication+ sticky session but using 1 only server
> > for database (i mean i dont use db replication). My jsf apps (ear) are
> > running in this mini cluster everithyng works fine except when i shutdown
> > tomee for do a re deploy i always see an xhtml parser error. I could
> never
> > configure it session replication with tomcat.
> >
> > In your web apps just use distributable tag in web.xml and all other are
> > configuration. You can use memcached to not only session replication even
> > thougth for savr information of your app and with this you can share
> > information between your nodes and with this you dont persist information
> > that could be "transient".
> > The result is incredible.
> >
> > As i sayed i could never configure session replication with tomcat,  the
> > only way i could do it is using memcached session replication.
> >
> > I dont know if anybody here have any experience with this.
> >
> > Regards Howard.
> >  El 19/10/2013 22:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> > escribió:
> >
> > > I had a question or two, since I have been reading "Java Summit -
> > Pitfalls
> > > in EE"[1] provided by Mark Struberg while having a discussion on tomee
> > user
> > > list.
> > >
> > > The following page stated the following:
> > >
> > > Page 134
> > > Clustering
> > >
> > > * We use 'asymmetric clustering'
> > > * use sticky sessions
> > > * backup away the session to a memcached after each
> > > request
> > > * do not replicate the session over to other nodes!
> > > * Session-Replication always in node pairs.
> > > * only restore the session from the memcached if a failover
> > > happened
> > > * msm can be integrated into OWB:
> > > http://code.google.com/p/memcached-session-manager/
> > >
> > > Since it says, 'We use asymmetric clustering' and other suggestions
> were
> > > made, I found it appropriate to direct my question(s) to MyFaces 'JSF'
> > user
> > > list and committers.
> > >
> > > is there some type of blog (or two or three) available that discuss how
> > to
> > > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also,
> > how
> > > is the database replicated? I don't ever see database
> cluster/replication
> > > discussed by JSF developers; i recently had to search for database
> > cluster
> > > and saw 'replication', which is something i have not had to worry about
> > > since my previous work involved database teams while i was doing
> > > front-end/GUI software.
> > >
> > > now that i am doing java ee and jsf, i would love to know how to do
> > > database clustering and/or replicating database while clustering JSF
> > > webapp. Of course, right now, i only have one  tomee which references
> > > 'apache' derby (which is performing well, but I would love to get my
> feet
> > > wet and cluster my web app + database). i did search derby's mail list
> > > archives and i learned about sequioa and HA-JDBC (High-Availability
> > JDBC).
> > >
> > > i was hoping to get an answer from MyFaces 'JSF'
> users/committers...based
> > > on their experience. I think someone told me that they use mysql
> > > (clustering); my preference is still 'apache' derby (smile). please
> > > remember, i'm wondering if any blogs are available that discuss
> > clustering
> > > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > > session manager.
> > >
> > > Thomas has already started writing a blog[2] about this. I'm looking
> > > forward to seeing sample config for it all (if available). :)
> > >
> > > [1]
> > >
> > >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> > >
> > > [2]
> > >
> > >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> > >
> >
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Tomcat/tomee session replication; memcached and custom session manager
(hazelcast) solutions are different.

Typically in some of them you accept SPoF, not in others. The perf are not
the same too. Finally guarantees (synchronous or not persistence) can be
different too.

Mark info were consistent but adapted to his apps I think. The "theorical"
solution is sometimes not enough...

Was just to give some more inputs and dont believe in IT you have a single
solution.

PS: if tomee clustering has issues please help us working on it on trunk
and tomee list
Le 20 oct. 2013 07:30, "José Luis Cetina" <ma...@gmail.com> a écrit :

> I have a early experience with a "mini cluster" 2 servers using tomee +
> memcached for session replication+ sticky session but using 1 only server
> for database (i mean i dont use db replication). My jsf apps (ear) are
> running in this mini cluster everithyng works fine except when i shutdown
> tomee for do a re deploy i always see an xhtml parser error. I could never
> configure it session replication with tomcat.
>
> In your web apps just use distributable tag in web.xml and all other are
> configuration. You can use memcached to not only session replication even
> thougth for savr information of your app and with this you can share
> information between your nodes and with this you dont persist information
> that could be "transient".
> The result is incredible.
>
> As i sayed i could never configure session replication with tomcat,  the
> only way i could do it is using memcached session replication.
>
> I dont know if anybody here have any experience with this.
>
> Regards Howard.
>  El 19/10/2013 22:49, "Howard W. Smith, Jr." <sm...@gmail.com>
> escribió:
>
> > I had a question or two, since I have been reading "Java Summit -
> Pitfalls
> > in EE"[1] provided by Mark Struberg while having a discussion on tomee
> user
> > list.
> >
> > The following page stated the following:
> >
> > Page 134
> > Clustering
> >
> > * We use 'asymmetric clustering'
> > * use sticky sessions
> > * backup away the session to a memcached after each
> > request
> > * do not replicate the session over to other nodes!
> > * Session-Replication always in node pairs.
> > * only restore the session from the memcached if a failover
> > happened
> > * msm can be integrated into OWB:
> > http://code.google.com/p/memcached-session-manager/
> >
> > Since it says, 'We use asymmetric clustering' and other suggestions were
> > made, I found it appropriate to direct my question(s) to MyFaces 'JSF'
> user
> > list and committers.
> >
> > is there some type of blog (or two or three) available that discuss how
> to
> > properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also,
> how
> > is the database replicated? I don't ever see database cluster/replication
> > discussed by JSF developers; i recently had to search for database
> cluster
> > and saw 'replication', which is something i have not had to worry about
> > since my previous work involved database teams while i was doing
> > front-end/GUI software.
> >
> > now that i am doing java ee and jsf, i would love to know how to do
> > database clustering and/or replicating database while clustering JSF
> > webapp. Of course, right now, i only have one  tomee which references
> > 'apache' derby (which is performing well, but I would love to get my feet
> > wet and cluster my web app + database). i did search derby's mail list
> > archives and i learned about sequioa and HA-JDBC (High-Availability
> JDBC).
> >
> > i was hoping to get an answer from MyFaces 'JSF' users/committers...based
> > on their experience. I think someone told me that they use mysql
> > (clustering); my preference is still 'apache' derby (smile). please
> > remember, i'm wondering if any blogs are available that discuss
> clustering
> > tomcat (preference = tomee) + JSF web app (with database) + memcached
> > session manager.
> >
> > Thomas has already started writing a blog[2] about this. I'm looking
> > forward to seeing sample config for it all (if available). :)
> >
> > [1]
> >
> >
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
> >
> > [2]
> >
> >
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
> >
>

Re: [OT but still JSF]: Clustering, session replication, and database, too

Posted by José Luis Cetina <ma...@gmail.com>.
I have a early experience with a "mini cluster" 2 servers using tomee +
memcached for session replication+ sticky session but using 1 only server
for database (i mean i dont use db replication). My jsf apps (ear) are
running in this mini cluster everithyng works fine except when i shutdown
tomee for do a re deploy i always see an xhtml parser error. I could never
configure it session replication with tomcat.

In your web apps just use distributable tag in web.xml and all other are
configuration. You can use memcached to not only session replication even
thougth for savr information of your app and with this you can share
information between your nodes and with this you dont persist information
that could be "transient".
The result is incredible.

As i sayed i could never configure session replication with tomcat,  the
only way i could do it is using memcached session replication.

I dont know if anybody here have any experience with this.

Regards Howard.
 El 19/10/2013 22:49, "Howard W. Smith, Jr." <sm...@gmail.com>
escribió:

> I had a question or two, since I have been reading "Java Summit - Pitfalls
> in EE"[1] provided by Mark Struberg while having a discussion on tomee user
> list.
>
> The following page stated the following:
>
> Page 134
> Clustering
>
> * We use 'asymmetric clustering'
> * use sticky sessions
> * backup away the session to a memcached after each
> request
> * do not replicate the session over to other nodes!
> * Session-Replication always in node pairs.
> * only restore the session from the memcached if a failover
> happened
> * msm can be integrated into OWB:
> http://code.google.com/p/memcached-session-manager/
>
> Since it says, 'We use asymmetric clustering' and other suggestions were
> made, I found it appropriate to direct my question(s) to MyFaces 'JSF' user
> list and committers.
>
> is there some type of blog (or two or three) available that discuss how to
> properly cluster a tomcat/tomee/openwebbeans/myfaces JSF web app? also, how
> is the database replicated? I don't ever see database cluster/replication
> discussed by JSF developers; i recently had to search for database cluster
> and saw 'replication', which is something i have not had to worry about
> since my previous work involved database teams while i was doing
> front-end/GUI software.
>
> now that i am doing java ee and jsf, i would love to know how to do
> database clustering and/or replicating database while clustering JSF
> webapp. Of course, right now, i only have one  tomee which references
> 'apache' derby (which is performing well, but I would love to get my feet
> wet and cluster my web app + database). i did search derby's mail list
> archives and i learned about sequioa and HA-JDBC (High-Availability JDBC).
>
> i was hoping to get an answer from MyFaces 'JSF' users/committers...based
> on their experience. I think someone told me that they use mysql
> (clustering); my preference is still 'apache' derby (smile). please
> remember, i'm wondering if any blogs are available that discuss clustering
> tomcat (preference = tomee) + JSF web app (with database) + memcached
> session manager.
>
> Thomas has already started writing a blog[2] about this. I'm looking
> forward to seeing sample config for it all (if available). :)
>
> [1]
>
> http://people.apache.org/~struberg/eesummit2013/Java%20EE%20Summit%20-%20pitfalls%20in%20EE.pdf
>
> [2]
>
> http://tandraschko.blogspot.com/2013/09/session-replication-clustering-failover.html
>