CDIGlobalTrack / rxdjango

A layer over Django Channels to push model updates through websockets
MIT License
30 stars 1 forks source link

RxDjango and Conflict-free Replicated Data Type(CRDTS) #7

Open lpirola opened 1 year ago

lpirola commented 1 year ago

With a ton of new real time new apps and libraries, should we say that RxDjango is an attempt to address some issues with CRDTS or just a performant way to sync data between server and clients?

https://jakelazaroff.com/words/an-interactive-intro-to-crdts/

lfagundes commented 1 year ago

Hey Lucas! Nice question, and thanks for naming the pattern, because we do want to implement some CRDTS.

I intend to implement a new cache layer in browser, using IndexedDB, so that offline clients can load their state and receive updates when they get online.

The general idea of the API is to mimic the Django API on the client side. For example, we've been discussing to override the method filter() on arrays in JS that represents a queryset in Django to make a call to the local IndexedDB cache. This would give frontend developers the flexibility equivalent to GraphQL. And I would also like to have a save() method in frontend objects.

Since serializers already know how to save an object, this saving will be simple when user is connected, but on offline mode, we'll need to handle conflict.

So, thanks for this resource, it will be useful, we have a few things before that :-).