Subject How to prepare to replication (IBreplicator)
Author fowlertrainer
Hi !

We have two sites, and the primary DB server (FireBird) is placed in
the first site.

But when I test my program, I see that the net line across the two
sites is very instable, and very slow to I use intensive DB queries,
reports, etc.

So I decide that in the future we need replication, and secondary db
server.

But we are non-profit healthcare organization (Peto Institute), and we
don't have a cash now to pay for IBReplicator, or other programs.

In the future possible we buy a software, but not now .

We have many "intra" software, but every of these products are
one-site optimized program. The DB is optimized to one server.

How to we prepare the DB to two-site work, and replication ?

We want to start the modifying all of the programs, and DB structure -
to prepare the replication. We want to "pay" now with the software
rewriting, and Db restructuring costs to when the replication will
started, we will avoid these kinds of problems.

So:
I see two (3) way to prepare.

1.)
Upgrade Db from one to 2 keys.
ID ->SITE_ID, ID
That is very painful solution, but it is best for long time.
I must restructure all of my tables, and I must rewrite my every
programs to use these keys, not the one ID.
This solution is the best, because the SITE-s are addable later in
simple way; and the databases (when they are synchronized) are can
copied as files (but generators need to re-set to they last values).

2.)
Segmentation of ID.
ID - 0..1 milliard - site1 (> site2)
That is very simple to use, no changes will made in programs/db-s,
only set generators in the second db.
But when I forget to set a generator to it's site determined initial
value, it is cause BIG-BIG problems, because it is overwrite other
records (the site1's records).
I can create GENID function in my program and I can check this value
before insert, but in server side (stored proc) it is not working for me.
The databases can copy as files, but generators are must be re-set is
they last values in every site.

3.)
REPL_ID
Every table have this key, and the db-s in sites are very different.
The name X.Y is ID=128 in site1, but 1150 in site2.
The replicator not use the primary key to identify record, it is use
repl_id.
But when I try to replicating an item, it must correct the FK-s.
So it is not practical, and very hard to coding the replicator software.


Please help me.
What is the best solution for preparing ?

What is method what is supported by IBreplicator ?

How I IBreplicator working when try to sync records ? It is use
primary key ? Or other ?

Thanx for help:
ft