I need help designing my data sync service that keeps my sql server in sync with my…
- User
I need help designing my data sync service that keeps my sql server in sync with my couchbase server.
- Sql server's is my source of truth and serves the web api where my SPA apps consume data
- Couchbase is used for my mobile and desktop online / offline applications
- I have a desktop app that is identical to the web app (just bundled differently)
- Each of those apps is an angular front-end talking to a dotnet api
- The dotnet api on desktop talks to couchbase, the web talks to sql
- My sync service has its own sql database to help manaing versions of documents between the two systems.
- data can be changed on both sides, then synced to the other
- We don't want to sync each time we update a document on couchbase, we want to sync based on an event happing on the desktop, and vice versa, because we need to edit multiple records in the database before the sync event can occur.
- based on what I said here, here is my current flow
Sql to Couchbase FeedlotApi(web) publishes an event Data Sync grabs that event and queues it Data sync does the direct insert into couchbase baed on the event type, handles any conflicts on the insert into couchbase
- Couchbase(Desktop/Sync Gateway) to Sql Desktop app creates an event in the new Couchbase Event Bucket Data Sync is subscribed to the event bucket, listens for events retrieves an event and queus the sync Data sync does the direct insert into sql server, handles any conflicts
Event from sql to couchbase and vice versa has enough info in it so the data sync services knows how to create the entities on each side. Each is custom.
We aren’t using RabbitMQ to handle the actualy eventing queues for the inserts. We want the data sync service to mange its own internal queue so we can manage order
When the data sync recievies an event from either couchbase or sql, it marks each event as complete since we just scheduled it in our data sync app
We won’t be using dto’s in our couchbase documents, desktop will need to put those together from its services
The data sync service has direct access to both sql and couchbase for direct inserts on either side
The event needs a payload coming from couchbase so we can edit the records correctly.
- Assistant
Based on your description, it seems that you have a well-thought-out plan for your data sync service. I'll provide a few recommendations to help ensure your design is efficient and robust.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.