Serverless Diff-Patcher Update Service
A server-less delta-update service using CDN and bsdiff. A Python implementation of server-side Serverless Diff-Patcher Update Protocol.
Currently supported CDN:
- Aliyun OSS
Why Use Serverless Diff-Patcher Update Service?
Patch-based update
Serverless Diff-Patcher Update Service uses patch-based delta-update. The client download a patch generated by a binary diff algorithm and apply it instead of downloading the full binary. In most cases, this will save 90%+ of the bandwidth and download time.
Server-less
Version checking can be very frequent if users are many. Utilizing CDN (Content Distribution Network) instead of a centralized server will significantly lower the stress on your server.
Lightweight and Eazy-to-use
A server-client framework that uses third-party services is usually cubersome and hard to configure. Serverless Diff-Patcher Update Service is very eazy to use and configure.
Installation
Download publish.py
. Then install pip dependencies.
pip install bsdiff4 oss2 xxhash
Usage
python publish.py <artifact_id> <source_folder> [<version>]
artifact_id
: a string serving as the unique ID of the resource. artifact_id
cannot change during updates.
source_folder
: the path to the new version of the resource. It must be a folder.
version
: (Optional) a semantic version for the new version. It must be the same with the version
file in source_folder
. If the version
files does not exist, it will be created. If the argument is ignored, the value from version
file will be used. For each update, version
must be greater than the previous version.
Example:
python publish.py localserver ../localserver/build-win 0.1.2
This will publish the update of "localserver" at the directory at "../localserver/build-win" under the new version "0.1.2". Any client lower than version "0.1.2" will start acquiring patches and update itself to "0.1.2".
Client Usage
Please check client
folder.
Serverless Diff-Patcher Update Protocol
Check serverless-diff-patcher-update-protocol.md
.