パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v5.1.3

crdt

競合フリーなレプリケートデータ型(CRDT)のDart実装。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2620
いいね数
83
Pub ポイント
150

パッケージをインストール

flutter pub add crdt

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

衝突のないレプリケートデータ型(CRDT)のDart実装であり、調整なしに分散システム間で一貫性がありリアルタイムのコラボレーションを可能にします。ネットワークの分断や並行更新が発生しても、CRDTはデータの収束を保証するため、共有ドキュメント、ライブダッシュボード、マルチプレイヤーゲームなどの共同アプリケーションに最適です。このパッケージはモバイル、ウェブ、デスクトップなど複数のプラットフォームをサポートしており、クロスプラットフォームでの一貫性を確保しています。

用途

  • リアルタイム共同編集
  • 分散型状態同期
  • オフライン優先のアプリケーション
  • マルチプレイヤー ゲーム状態管理
  • ライブダッシュボードの更新

主な機能

  • 衝突のないデータの収束
  • 複数のCRDTタイプのサポート
  • クロスプラットフォーム互換性
  • 低遅延更新
  • 中央の調整は不要です

適している対象

  • リアルタイムアプリを開発する開発者
  • オフライン優先機能を必要とするチーム
  • 分散ユーザーを持つアプリケーション
  • 強い一貫性を必要とする共同作業ツール
  • 信頼できないネットワーク環境のシステム

注意事項

  • CRDTの原則を理解する必要がある
  • レプリケーションによりデータサイズが増加する可能性があります
  • 高頻度のアトミック操作には適していません
  • 特定のデータ構造に限定される
  • パフォーマンスはデータの複雑さに依存します

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Dart implementation of Conflict-free Replicated Data Types (CRDTs).

This project is heavily influenced by James Long's talk CRTDs for Mortals and includes a Dart-native implementation of Hybrid Local Clocks (HLC) based on the paper Logical Physical Clocks and Consistent Snapshots in Globally Distributed Databases (pdf).

It has minimal external dependencies, so it should run anywhere where Dart runs, which is pretty much everywhere.

The Crdt class implements CRDT conflict resolution and serves as a storage-agnostic interface for specific implementations. Als included with this package is MapCrdt, an ephemeral implementation using Dart HashMaps.

Other implementations include (so far):

  • hive_crdt, a no-sql implementation using Hive as persistent storage.
  • sql_crdt, an abstract implementation for using relational databases as a data storage backend.
  • sqlite_crdt, an implementation using Sqlite for storage, useful for mobile or small projects.
  • postgres_crdt, a sql_crdt that benefits from PostgreSQL's performance and scalability intended for backend applications.

See also crdt_sync, a turnkey approach for real-time network synchronization of Crdt nodes.

Usage

The simplest way to experiment with this package is to use the provided MapCrdt implementation:

import 'package:crdt/map_crdt.dart';

void main() {
  var crdt1 = MapCrdt(['table']);
  var crdt2 = MapCrdt(['table']);

  print('Inserting 2 records in crdt1…');
  crdt1.put('table', 'a', 1);
  crdt1.put('table', 'b', 1);

  print('crdt1: ${crdt1.getMap('table')}');

  print('\nInserting a conflicting record in crdt2…');
  crdt2.put('table', 'a', 2);

  print('crdt2: ${crdt2.getMap('table')}');

  print('\nMerging crdt2 into crdt1…');
  crdt1.merge(crdt2.getChangeset());

  print('crdt1: ${crdt1.getMap('table')}');
}

Implementations

crdt is currently helping build local-first experiences for:

  • Libra a weigh management app with 1M+ installs.
  • tudo an open-source simple to-do app + backend.

Are you using this package in your project? Let me know!

Features and bugs

Please file feature requests and bugs at the issue tracker.

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。