Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
nebogeo
symbai
Commits
f5d8f4a5
Commit
f5d8f4a5
authored
May 01, 2014
by
Dave Griffiths
Browse files
docs
parent
74d43c3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
5 deletions
+56
-5
README.md
README.md
+56
-5
No files found.
README.md
View file @
f5d8f4a5
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
Symbai/Starwisp
===============
This is a data syncing application for remote use with a raspberry pi and
android devices.
Development notes
=================
Data model
----------
The sqlite database is using an entity-attribute-value system so data types can
be added dynamically, with only an android application update required.
Each item in the database is an entity, which contains a version number,
a local id (the primary key) which is defined on the local database only
and a unique-id which is common to all databases across the
network. Entities are split into different types, and are associated
with attributes which make up their contents. The attributes of the
entity are stored in key-type-value attributes (ktv). Entities are
comprised of multiple ktv attributes.
When an entity is edited, it's flagged as dirty - along with the
individual attributes which are changed.
The entity dirty flag is used to determine which entities need to be
sent to the server when syncing, and the attribute's dirty flags
indicate which individual items need sending.
The server increments the entity version number on reciept of a changed
values, which is used to determine which entities are needed updating on
other clients.
In this way, data changes are merged and propagated through the system.
Syncing
-------
Sending data from client to server:
| Android (client) | Raspberry Pi (server |
|-------------------------------|------------------------------|
| Data edited or created - cause entities and attributes to be flagged as 'dirty' | |
| For each dirty entity, send all dirty attributes | Return message to confirm reciept |
| | Overwrite all dirty attributes, increment version number |
| Android (client) | Raspberry Pi (server |
|-------------------------------|------------------------------|
| Request all entity version numbers | Send versions... |
| Check each local entity, request updates | Send complete entity, with all attributes |
| Overwrite/add new entities | |
| ktv | ktv-list | sql |
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment