搜尋套件、儲存庫與 APP 分類

套件詳情v1.2.0+1

hlc_dart

基於論文《全域分散式資料庫中的邏輯物理時鐘與一致快照》的 Dart 混合邏輯時鐘實作。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
637
喜歡數
5
Pub 分數
160

安裝套件

flutter pub add hlc_dart

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

HLC_Dart 是 Hybrid Logical Clock(混合邏輯時鐘)的 Dart 實作,旨在為分散式系統提供因果一致的時間戳。受到邏輯物理時鐘論文啟發,它結合了邏輯時間與物理時間的優點,確保在全球分散式資料庫中實現強一致性。HLC_Dart 能夠精確排序事件,同時與現實世界時間保持同步,非常適合用於 CRDT 和分散式帳本。該套件支援多種平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

適用情境

  • 分散式資料庫時間戳
  • CRDT 衝突解決
  • 微服務中的全域事件排序
  • 複製系統中的一致快照
  • 即時協作應用

主要特色

  • 混合邏輯-物理時間同步
  • 跨節點的因果一致性
  • 低延遲時間戳產生
  • 跨平台支援
  • 與 CRDT 的整合

適合對象

  • 開發分散式系統的開發者
  • 使用CRDT實現資料一致性的團隊
  • 需要全域事件排序的應用程式
  • 多區域部署中的後端服務

使用建議

  • 需要小心處理時鐘漂移
  • 不適合高精度計時需求
  • 依賴準確的系統時間來源
  • 在邊緣情況下可能需要網路協調
  • 最適合在具有穩定網路連接的環境中使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

CRDT

github_starts melos_badge repo_size

logo

docs_badge

Apps

Packages

Roadmap

A roadmap is available in the project page. The roadmap provides a high-level overview of the project's goals and the current status of the project.

Workspace structure

This repository is a workspace that contains multiple packages and apps. Consistency is granted by the melos tool.

Melos

Melos (pub.dev) is a CLI tool for Dart/Flutter monorepos. It links the local packages together, so every package can depend on the others without publishing them first, and it runs the same command over all of them (format, analyze, test, publish, ...).

Every shared command lives in melos.yaml and runs with melos run <script>:

Script What it does
format formats the code (80 characters per line)
analyze runs the analyzer with warnings and infos as errors
test / test_flutter / test_chrome runs the Dart, Flutter and web tests
benchmark runs the benchmarks of every package with a benchmarks/ folder
devtools_build builds the DevTools extension
docs_bs / docs_build bootstraps and builds the documentation site
update_references propagates package/app references into the READMEs
Setup

The Flutter SDK is pinned with fvm, and the documentation site is a Docusaurus project, so Node.js (with npm) is required too.

fvm install                     # installs the pinned Flutter SDK
fvm dart pub get                # resolves the workspace tools (melos included)
fvm dart run melos bootstrap    # links the packages and prepares the examples
fvm dart run melos run docs_bs  # optional: installs the documentation site (needs Node.js)

Note Melos is a dev_dependency of the root pubspec.yaml, so running it as fvm dart run melos ... is the safest option: you use the melos version pinned by this repository, with the Flutter/Dart SDK pinned by fvm. A globally activated melos (dart pub global activate melos) works as well, but it may be a different version than the one the workspace expects, and the difference usually shows up at the worst possible moment 🙃.

A command is provided to try to publish all packages:

fvm dart run melos publish --dry-run

This ensures that every package is formatted, analyzed, tested and built.

Organization

The repository structure is organized as follows:

workspace/
├── melos.yaml # melos configuration file
├── packages/ # contains every package of the workspace
│   ├── core/ # the CRDT engine and its bindings
│   │   ├── crdt_lf/
│   │   │   ├── lib/
│   │   │   ├── example/
│   │   │   └── flutter_example/
│   │   └── .../
│   ├── adapters/
│   │   └── persistence/ # storage backends for crdt_lf
│   │       ├── crdt_lf_drift/
│   │       ├── crdt_lf_hive/
│   │       └── crdt_lf_sqlite/
│   └── _internal/ # private, unpublished packages
│       ├── benchmark_infrastructure/
│       └── shared_examples_infrastructure/
├── apps/ # contains the applications built on top of the packages
│   └── greyhound_markdown/
│       ├── client/
│       └── server/
├── docs/ # the documentation site (Docusaurus, Node.js project)
├── scripts/ # dart scripts used by the melos commands
└── assets/ # contains the assets used in the documentation
    └── .../
VS Code

If you work with VS Code, the repository already contains a .vscode folder with:

  • the recommended extensions (Dart, Flutter, Melos, Mermaid);
  • the settings (fvm SDK path, project dictionary for the spell checker);
  • the launch configurations for the apps and the examples;
  • the snippets used in the READMEs and the changelogs.

Accepting the recommended extensions gives you the smoothest experience on this workspace.

Contributing

Contributions are welcome: bug fixes, new features, documentation, performance work, or anything else — a fixed typo counts too 💚.

The whole flow (roadmap, issues, pull requests, AI-assisted work) is described in CONTRIBUTING.md. Please read it before opening an issue or a pull request.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。