Skip to content

Commit

Permalink
First pass at the documentation. (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianhall authored Aug 28, 2024
1 parent 89697c1 commit 8aac1a4
Show file tree
Hide file tree
Showing 676 changed files with 65,447 additions and 3 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy Hugo site to Pages

on:
push:
branches: [ main ]
paths: [ 'docs/**' ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.132.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
# - name: Install Dart SASS
# run: sudo snap install dart-sass

- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recurisive
fetch-depth: 0

- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"

- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
TZ: America/Los_Angeles
run: hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/"

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

Empty file added docs/.hugo_build.lock
Empty file.
5 changes: 5 additions & 0 deletions docs/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
36 changes: 36 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
+++
archetype = "home"
title = "Datasync Community Toolkit"
description = "A set of .NET libraries for synchronizing data between cloud and device databases."
+++

## What is the Datasync Community Toolkit

The Datasync Community Toolkit is a free [dotnet Foundation] [Community Toolkit] set of libraries that assists in providing offline data to your desktop and mobile applications. The data is stored in the cloud and synchronized to a local Sqlite database.

{{% badge style="primary" title="Version" %}}8.0.0{{% /badge %}}

## Get started

* Step 1: [Set up your datasync service.](setup/server.md)

* Step 2: [Update your desktop or mobile app.](setup/client.md)

## Samples

* [A sample server](samples/server.md)
* [Sample clients](samples/todoapp)
* [AvaloniaUI](samples/todoapp/avalonia.md)
* [MAUI](samples/todoapp/maui.md)
* [Uno Platform](samples/todoapp/uno.md)
* [WinUI3](samples/todoapp/winui3.md)
* [WPF](samples/todoapp/wpf.md)

## More information

* [In-depth with your ASP.NET Core datasync server](in-depth/server/)
* [In-depth with your client application](in-depth/client/)

<!-- Links -->
[dotnet Foundation]: https://dotnetfoundation.org/
[Community Toolkit]: https://learn.microsoft.com/dotnet/communitytoolkit/
34 changes: 34 additions & 0 deletions docs/content/in-depth/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
+++
title = "In-depth"
weight = 100
+++

## Offline data synchronization

Offline data synchronization is a useful tool that synchronizes data from a cloud-based database to a Sqlite database stored with your application. When you app is offline, you can still create, modify, and search the data. Data is synchronized when your device is online.

Offline data synchronization has several benefits:

* Improves app responsiveness
* Improves app reliability when there is bad network connectivity
* Limits network use on high-latency or metered networks
* Supports disconnected use.

## How does offline sync work?

Your client code implements a special Entity Framework Core database context using a Sqlite database. As you make changes to the data within the database context on the local store, each operation is stored in an operations queue. No network communication happens until you push the changes stored in the operations queue to the remote service. Similarly, you pull changes from the remote service to be stored in the local store.

### Incremental synchronization

The Datasync Community Toolkit implements incremental synchronization. Only records that have changed since the last pull operation are fetched. Incremental synchronization saves time and bandwidth when you are processing large tables.

For each unique query, the `UpdatedAt` property of the last successfully transferred record is stored as a "delta token" in the local database context.

### Performance and consistency

Synchronization sometimes stops prematurely. For example:

* The network that you are using for synchronization becomes unavailable during the synchronization process.
* You force-close the application during synchronization.

When fetching records, data is transmitted in pages - each page contains a number of records. The database context is updated and then the records are saved to the database at the end of each page of records (unless you disable that facility).
Loading

0 comments on commit 8aac1a4

Please sign in to comment.