2

If we are going to use Zumero... Does the schema between remote and local need to remain the same, or not? Because if we deploy the application, we won't be able to change the local schema.

Environment:

Xamarin.Forms in the MAC Machine, SQLite database to sync with SQL Server

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
user1027076
  • 175
  • 1
  • 4
  • 12

2 Answers2

2

In Zumero when you create a "DBFile" in the ZSS Manager you are defining which subset of the server's database will be synchronized with the client. The schema of the subset you choose will be kept the same between the remote and local database.

As of Zumero 2.0, you will be able to change the schema on the server and those schema changes will automatically be applied to each Zumero client on its next sync. (See the documentation that Paul Roub linked to for how this works and the details about how certain schema changes are handled.)

Schema changes made on the client, on the other hand, will not be applied on the server. Therefore: You can safely use CREATE TABLE to add "local-only" tables which will not be synced with the server. However, you should not use ALTER TABLE ... ADD COLUMN on synced tables since Zumero will sometimes drop and recreate a table (e.g. when applying a schema change from the server), in which case you will lose all the data in the non-synced column. And you should not drop or rename synced tables since that will cause errors during the sync process.

0

With care, you can change the server-side schema without altering the client-side schema.

If you add new columns on the server side, by default they will not be synched to the client DB unless you specifically request so.

However, if you rename or drop columns, the client schema will automatically change at the next sync. The same applies if foreign keys are added / removed / etc., although these changes won't necessarily cause trouble on the client application.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93