An open, storage-agnostic, sync engine development kit.

Next to your data.
🎉 Introducing Synclets! 🎉 We're excited to introduce Synclets, an open, storage-agnostic, sync engine development kit. Read more... 👇
1
6
21
101,006
The WsServer component is a standalone WebSocket server, used to accept incoming connections from WsClientTransport synclets yet does not store its own data. This is now also part of the transport/ws module. github.com/tinyplex/synclets… Enjoy! 3/3
53
There is a new WsServerTransport component, which is to be used for a server synclet that will be also acting as a server for other client synclets to connect to. 2/3
1
52
🏗️ v0.0.5 This release includes some important changes to the WebSocket-oriented synclet APIs. The WsTransport has been renamed to WsClientTransport. This can be used for a client synclet that will be connecting to a WebSocket server elsewhere. 1/3
1
68
And if you got this far, thank you! This is just the announcement of a forthcoming journey, but please like, star, share, and follow so we can all go on it together. 🙏 synclets.org/#
117
Our next major milestone will be building out a proof of concept that connects client-side SQLite and PGlite databases to CloudFlare Durable Objects, as we think this might be a popular pattern for many realtime collaborative apps. Stay tuned for announcements on that one!
1
132
What's next? -- The Synclets project is pre-alpha right now, so there is still plenty of work to be done! There are decent test suites in place for the core components, and some basic documentation, but we still need to build out more connectors, transports, and examples.
1
80
Or you could synchronize data between a local SQLite database and a remote PostgreSQL server over WebSockets. PGlite in the browser with CloudFlare Durable Objects. Or, as long as you can implement a few simple methods, between any storage and over any transport you like!
1
85
This compositional approach means you have a lot of flexibility for how data flows in your app. For example, you could synchronize an in-memory state in the UI thread of your application with local storage in a worker thread.
1
82
Here's an example of how Synclets can synchronize key-values between a local PGlite database and a local SQLite database over WebSockets:
1
1
87
4. Connect the three components together using a Synclet instance, which, once started, orchestrates the synchronization process itself.
1
85
3. Instantiate a Transport component that handles communication between different parts of your application (e.g. WebSocket server/client, BroadcastChannel, etc.)
1
90
2. Instantiate a MetaConnector component that stores metadata (primarily timestamps), again into any of many storage backends.
1
91
1. Instantiate a DataConnector component that interfaces with your chosen storage (e.g., SQLite, PGlite, TinyBase, local storage etc. - or one you customize yourself)
1
96
How do Synclets work? -- Exact implementation details are still evolving, but here's roughly how Synclets are designed to be used:
1
1
99
4. Prioritize simplicity and ease of use, with clear documentation and examples to help you get started quickly.
1
103
3. Be modular and extensible, allowing you to customize and extend its functionality to suit your specific needs, or to contribute back to the community.
1
106
2. Work across a variety of transport layers, such as WebSockets, in-memory, BroadcastChannel, and so on.
1
109
The philosophy of Synclets -- The Synclets project is designed around a few core principles: 1. Be compatible with as many storage backends as possible, whether database-oriented, in-memory, file-based, or otherwise. No vendor lock-in!
1
130
(Development on TinyBase will continue as before, but we expect to increasingly use Synclets as the default underlying engine for its synchronization features going forward - making it easier for you to piece together the architecture that best works for you.)
1
147
But we figured these techniques would be valuable to people that are not using TinyBase too, and so Synclets is essentially an attempt to extract and generalize these ideas into a standalone project.
1
159