item2
Next»

contents

 

Introduction - 1

Background - 2

Deployment - 3

Starkits - 4

Tclkit - 5

Advanced topics - 6

Repositories - 7

Server apps - 8

Who uses this - 9

Examples - 10

Conclusion - 11

 

Acknowledgements

References

7.2 - Starsync

Starsync is a technology to fetch and update Starkits over the net. It sends only the files which have changed (compressed) which are then replaced within the Starkit's VFS.

There is an implementation of Starsync embedded in the SDX “update” command that allows you to inspect, obtain and update Starkits from SDarchive.

For example, the “Fractal Mountains” Tk demonstration Starkit by Keith Vetter [39]

    $ sdx update -n fractal.kit
     FRACTAL: looking up on http://mini.net/sync.cgi ...
      3 differences:
           69  main.tcl
        35188  lib/app-fractal/fractal.tcl
           76  lib/app-fractal/pkgIndex.tcl

The “-n” flag tells SDX to show the differences with the current installed version, but not to make any changes. In this case, we don't have a current version so all files in the Starkit are different.

Now we can fetch the Starkit :

    $ sdx update fractal.kit
     FRACTAL: fetching from http://mini.net/sync.cgi ...
      File created.

At a later date, we could request that the Starkit is updated with any changes:

    $ sdx update fractal.kit
     FRACTAL: updating from http://mini.net/sync.cgi ...
      1 changes applied.

Here we can see that one file was changed. Another update will show no subsequent changes:

    $ sdx update fractal.kit
     FRACTAL: updating from http://mini.net/sync.cgi ...
      No change.

The implementation (both client and server) takes advantage of several aspects of the Metakit database:

  • changes are transacted, aborted updates can always be restarted without damaging the underlying Starkit VFS
  • there is a simple and efficient client-side implementation and protocol
  • on-the-fly restructuring to make a table-of-contents
  • only changed files are fetched, in zlib-compressed form
  • the server also stores Starkits, so there is no packing/unpacking whatsoever

The first Starsync server implementation is a simple CGI script (all of the server logic is in the SDX command). All client-server interactions are stateless and use a normal HTTP "POST" request, with a very compact Metakit-based "table of contents" exchange (typically less than 0.1% of the Starkit size).

The protocol is based on a single request/reply transaction, and is therefore stateless. The first implementation consists of a package called - what else? - "starsync" (it's part of SDX), which contains the logic for both clients and servers in less than 300 lines of Tcl.

see also

Starkit Home Page

Tclkit Home Page

Metakit Home Page

SDX Utility

Wikit Home Page

Tclers' Wiki

Author's Website

Updated paper, by Steve Landers, as presented at Tcl/Tk 2002 conference - see also original PDF.

Papers & Presentations