패키지, 저장소 및 앱 카테고리 검색

패키지 상세v5.1.3

crdt

충돌 없는 복제 데이터 유형(CRDT)의 다트 구현.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.6천
좋아요
83
Pub 점수
150

패키지 설치

flutter pub add crdt

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

충돌 없는 복제 데이터 유형(CRDT)의 다트 구현으로, 조정 없이 분산 시스템 간에 일관되고 실시간 협업을 가능하게 합니다. 네트워크 파티션이나 동시 업데이트가 발생하더라도 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.