I have not cut a release yet, but the work-in-progress Local Native v0.4.0 introduced a new
uuid4 field into
This serves as a unique key for each record, syncing between different devices could leverage this new column. Actual code for syncing is still yet to be written. The idea is uuid4 could be used as a record identifier to compare with records with other devices.
I considered using key based on actual content, but decided that's too much and preferred true randomness.
To migrate v0.3.x schema to v0.4.0, an upgrade sub module is also written to create a
meta table with
This schema change might already break the ssb sync code.
Back to sync
I tried to tackle the syncing problem before. The wired sync is not convenient. Sync via ssb the keys setup steps seems cumbersome (Yes, some UI could be put on top of it to make it feel better), but there are 3 real issues I see it is not fit to at least my desire:
- private data is going out wide to other peers, (Yes, can be encrypted, but see below)
- ssb private key loss or theft could expose private data
- performance seems not great, it takes hours to sync my last 10+ years notes
I decided sync over LAN or WiFi when devices are on the same local network with a different protocol should be my next bet.
So what protocol?
I started higher on the stack, even looked at GraphQL, then just try to spin up HTTP server in rust, then hit some build error on Android for
openssl. The dead body of
localnative_sync is the experiment.
Maybe I don't need full HTTP(s) server but just RPC?
So here it is, the code now have tarpc as a dependency.
Like any FLOSS libraries, those supported by large players might have a better chance of being actively maintained and being aligned with the "trend".
gRPC is HTTP/2. It is good for bidirectional communication between components in server farm(s). gRPC-Web now allows web client directly connected to centralized server(s).
I also recall in the old days we 8 teenagers rushing into an internet cafe, ironically it's not connected to internet but just 8 PC connected to a router. Then the group just playing StarCraft for hours, no cloud subscription, no need for earphone but directly shout to your teammates, and you can also shamelessly perform physical distraction to your enemy commanders for the win.
I miss those days.