You are not logged in.
Congratulations on the new replication feature!
Two questions if you don't mind:
1 - For the "Corporate Servers Master/Slave Replication With Private Local Data" mode, are the two arrows in the graph have wrong directions? Shouldn't it look like this (notice the two red arrows I added):
2 - I think one drawback of the master/slave replication mode is that the slave should be "read-only" to avoid duplicated version numbers. I'm not sure if I understand it correctly, but can we make this feature becoming two-way syncing by using different prefix for the server-wide TRecordVersion properties? For example, for rest server A in office A we use 1 as the version number prefix, while rest server B in office B has prefix of 2, and vice versa.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Got it !
Now for the really stupid questions ;-) !!
I use
aServer.RecordVersionSynchronize(TSQLRecordPeopleVersioned,aClient);
to get data from the master to my local FPC Android mORMot client.
As I understand correctly, this will update all records in the local PeopleVersioned-table.
(All) aClient(s) need to have full access to the master-server.
However, the master is equipped with a lot of methods to limit direct access.
Questions:
1) How do you see Synchronize ? Using a message loop / timer / thread ? Or during method-access of the master-server ?
2) How do you see Access ? Most tables on master are closed for direct access.
3) Would I need to make a special replication-user with full access ? This could be dangerous.
Sorry for stupidity, if applicable. Thanks for help in advance !
Offline
2 - I think one drawback of the master/slave replication mode is that the slave should be "read-only" to avoid duplicated version numbers. I'm not sure if I understand it correctly, but can we make this feature becoming two-way syncing by using different prefix for the server-wide TRecordVersion properties? For example, for rest server A in office A we use 1 as the version number prefix, while rest server B in office B has prefix of 2, and vice versa.
Yes, this is prepared for a future implementation.
The TSQLRestServer.InternalRecordVersionComputeNext function just need to be overriden with a timestamp + node suffix to have a monotonic multi-node version number.
There is just a limit of 58 bits, due to how TSQLRecordTableDelete.ID works.
To synchronize, the easiest is to use a timer.
It will work from a mobile device.
To synchronize in real time, I have just introduced TSQLRestServer.RecordVersionSynchronizeCallback() method, able to register a callback interface which would be called each time a write operation is performed on a given TSQLRecord with a TRecordVersion field.
With WebSockets support, it is a pretty good way of having full synchronization of a database.
See http://synopse.info/fossil/info/e78b7e3e24
Online
Thanks for these additions !
Could you shed some light on my very closed setup: how do I access my master-server, that only allows methods, and no direct CRUD on tables ?
Just use a privileged replication-user ?
Minor problem with latest mORMot. This
(PPointer(instance)^=TInterfacedObjectFakeServer)
does not compile with FPC.
Offline
FPC compilation should be fixed by http://synopse.info/fossil/info/4462a6f626 (together with other changes).
The slave need to have read access to the master tables involved (i.e. the TSQLRecord table containing the TRecordVersion field, and the TSQLRecordTableDeleted table).
So specific user rights may be necessary.
Online
Thanks ! Your fix compiles !! Now I can go testing on FPC and Android.
As a sidenote, and in addition to the need for specific user rights:
Would it be an idea to add the replication-user to the mORMot framework.
Because this replication will only work with full read access of the Master.
So it can be added by default to the framework.
Replication will not work without full read acccess to all tables.
Offline
Yes, this is prepared for a future implementation.
The TSQLRestServer.InternalRecordVersionComputeNext function just need to be overriden with a timestamp + node suffix to have a monotonic multi-node version number.
There is just a limit of 58 bits, due to how TSQLRecordTableDelete.ID works.
Sounds like a good idea! Does it mean once such a two-way syncing feature is implemented, I can have several databases synced with the very same set of data? I can help to test when it's added, what's your plan? Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Does it mean once such a two-way syncing feature is implemented, I can have several databases synced with the very same set of data? I can help to test when it's added, what's your plan? Thanks.
Yes, this is the point.
But we won't use it directly this feature here, so testing will be welcome!
I suspect we may be able to add this TRecordVersion per-node generation in a very short term.
Online
edwinsn wrote:Does it mean once such a two-way syncing feature is implemented, I can have several databases synced with the very same set of data? I can help to test when it's added, what's your plan? Thanks.
Yes, this is the point.
But we won't use it directly this feature here, so testing will be welcome!I suspect we may be able to add this TRecordVersion per-node generation in a very short term.
Great! I'll monitor this thread to get updates. Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Hi Arnaud, I assume even with the above mentioned two-way syncing implemented, we still have to take care of the IDs of the records not to be duplicated across offices, right?
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Good afternoon! Am new to mORMot, I developed an application to perform automatic backup in real time, however, would like to test the performance of mORMot with this relationship, someone could provide a simple example of database replication with this new available routine? Best Regards
Offline