Hacker News new | ask | show | jobs
by spyremeown 1365 days ago
>Ditto is designed for "peer-to-peer" synchronization where it can directly communicate with other devices even without an internet connection. In addition, Ditto automatically manages the complexity of using multiple network transports, like Bluetooth, P2P Wi-Fi, and Local Area Network, to find and connect to other devices and then synchronize any changes.[1]

This is cool! I have no idea what's the use-case behind it, but it is really awesome if properly implemented (which seems like a gigantic challenge).

[1] https://docs.ditto.live/

5 comments

Max, CoFounder of Ditto here.

Super cool to see us on HN! The use cases are for projects, products, enterprises to build collaborative apps that can sync with the internet but fall back to local P2P connections when internet connectivity fails. Furthermore we added offline first as an additional guard for some resiliency.

We help solve a class of apps like:

1. Desk-less worker apps for the enterprise: think people who use mobile apps for the vast majority of their work: pilots, flight attendants, construction, maintenance 2. Retail, inventory warehousing, point of sale systems where being able to communicate between kiosks, service tablets, and display systems quickly even if there are interruptions in service 3. Education: it’s very often parents give their kids phones without a data plan, so their school or learning apps need to be able to collaborate with other students or teachers regardless of connectivity 4. Robotics, agriculture technology, IoT - often these applications have hard requirements to communicate with other local devices without any dependency of the internet

I can keep going!

Again, So happy to see us on HN! Thank you!

We are in the process of buying it for retail applications (just signed the paperwork) and so far so good. I would ask that you make the documentation a little easier to find from the home page. Engineers want things to be easy ya know :).

EDIT: is there ever a plan to open this as a spec?

Thanks!! We will make improvements.

Our replication system is very complex. I am not sure that even publishing our spec would get much usage because it’s so complex.

But maybe we can open source an API?

One thing I don't fully understand is how KV stores like this fit into the overall architecture of an app. Is Ditto supposed to completely replace SQL or is there some Ditto DB <-> SQL DB syncing mechanism happening?
Adam (Ditto cofounder) - Ditto can be used either as the primary datastore in the client app (we call these "Small Peers"), or alongside others local DBs (existing apps adopting Ditto tend to pick off key P2P features and run Ditto with others like Couchbase, SQLite, or Core Data - and we have built connectors to help with this). With regards to the backend, our server product, or "Big Peer" provides webhooks or a Kafka topic of all changes to pipe them into other systems, so it similarly can be a primary datastore or middleware.

All-in-all, the design of Ditto is to be flexible so users can add Ditto to their architecture as easy as possible.

My vision is that all the current use of IT should work in this mode. Depending on a central server for synchronization should be the exception, not the norm.
Interestingly, most of the Ditto folks originally worked on Realm, an object database that eventually monetized into the "sync via a central server" space.

Of course, Realm was later acquired by MongoDB, and currently exists as some kind of Frankenstein's monster product in an attempt to drum up Atlas sales.

Interesting how the acquisition pushed some of the devs to create better tech, but they had to give up the original product along the way.

It’s just my cofounder Adam and I that came from Realm!

We’ve got Alumni from Pusher, Basho/Riak, Walmart Labs, Microsoft, to name a few

Agreed, and I expect it to set new standards for user expectations. Users are tired of slow and fragile server interactions on every click, or managing connectivity during use.
How would you handle granular permissions though?
Sync permission rules to clients, enforce in centralized authorities and peers once synced
We will be working on granular permissions as a top priority in 2023. We have a couple of ideas running around right now.
I'm not sure about latency since I haven't tried Ditto, but there's a class of in-person multiplayer games that would benefit from something like this. See Spaceteam[0] for an example.

[0] https://spaceteam.ca/

One use-case comes to mind is messaging for activists and journalists wanting to keep things private.

How would this compare to https://briarproject.org/ ? Have you generalized their protocol for many other applications?

Another use case that comes to mind is US Air Force bomber drones having navigation and peer to peer capability through intermittent connectivity with central control

edit: turns out my guess was essentially correct! that general use case is indeed what the USAF is using Ditto for https://www.sbir.gov/node/1629457

I’ve thought about building a messaging app the doesn’t depend on cell networks, it could be useful for example if you are on a snowboarding trip or mountain biking and need to communicate with a group of friends, but in a place with spotty cell service. I’ve played around with Apples P2P networking framework but it was pretty clunky, this looks like it would be much easier to use.