0
0

More than 1 year has passed since last update.

Couchbase Lite機能解説:ローカルデータ同期

Posted at

概要

Couchbase Liteは、ローカルにあるふたつのデータベース間のレプリケーションをサポートしています。これにより、Couchbase Liteデータベースのデータをセカンダリストレージに保存することできます。

以下は、ローカルデータ同期のコーディング例です。

DatabaseEndpoint targetDatabase = new DatabaseEndpoint(database2);
ReplicatorConfiguration replicatorConfig = new ReplicatorConfiguration(database1, targetDatabase);
replicatorConfig.setReplicatorType(ReplicatorConfiguration.ReplicatorType.PUSH);

// レプリケーターを作成します(レプリケーターがGCされるのを防ぐために、参照が保持されている必要があります)
replicator = new Replicator(replicatorConfig);
replicator.start();

関連情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0