On Oct 16, 2008, at 12:08 PM, Edward Capriolo wrote:
Hello list,
I had setup xindice in the past to learn XPATH etc. It is very cool.
I am working on a project http://www.jointhegrid.com/jtgweb/.
Previously I used java.beans.xmlencoder and xmldecoder to persist xml
data to a directory. Now, I am moving to a multi-node implementation.
So I have an issue of data replication. My goal is to have the data on
all the nodes, and have the data scale out automatically if I moved
from two nodes to three.
I do not want to use shared storage or NFS.
Even if you were to use shared file system, it still will not be
possible to run multiple xindice database instances against same set
of shared files. Database files can be opened - and afterwards are
managed - by single database instance. Any attempt to run two database
instances against same database file will result in data corruption.
This morning I came up with an idea:
1) Use tomcat with session/application clustering anything in memory
is shared on all the nodes.
I remember from using xindice it persists the data to the webapps
directory.
Database files location can be configured using configuration file. By
default, files indeed are placed under webapp's WEB-INF directory.
Can I run xindici in memory? would the data be serializable.
Xindice as-is is capable of using only filesystem based storage.
Having said that, it is possible to implement completely in-memory
database, you would have to replace file based implementation with a
memory based one.
If that is possible xindici can be used as a replicated xml
database. Any ideas?
Client code which talks to the xindice database can be clustered, and
can talk to single database instance residing on single back end
server. That would be the easiest, and most common approach.
Another idea, if you insist on running multiple database instances, is
to build a data replication layer on top. Every change to any of
database instances will have to be broadcasted to database cluster and
replayed in all database instances.
Vadim