I know that PouchDB only works with CouchDB compatible servers. Is there a way to use SQL Server as a backend while maintaining its original schema?
I have a thought how to accomplish this but I am not entirely sure if it is feasible. Any answer that will lead this to fruition will be appreciated.
The way I see it can be done is by using CouchDB to store the sync metadata like revisions and all things needed for a successful sync. The actual latest data will then be stored on the SQL Server following its original schema.
To be able to accomplish this I need to create a CouchDB compatible server using my stack which is C#. This will act like a proxy in between CouchDB and PouchDB so I don't actually need to implement all methods. I will have to intercept certain methods that will allow me to keep SQL Server and CouchDB in sync (following business rules) on the server at the same time take advantage of CouchDB's sync capability over the SQL Server Data. With this in place I could also add a bunch of middleware I wish in the future.
Is this thing feasible? I know that express-pouchdb exist but it is just a CouchDB compatible server with a PouchDB backend. What I wanted is to make the CouchDB and SQL Server work together. If so, how should I go about it?
CouchDB works well with modern web and mobile apps. PouchDB (local/client) enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.
PouchDB is a NoSQL database, meaning that you store unstructured documents rather than explicitly specifying a schema with rows, tables, and all that jazz.
Might sound like a crazy idea, but you can use PouchDB on the server and plug in an alternative storage adapter that uses SQL Server. That way you don't need to reimplement the replication logic (this is really hard), you can concentrate on the storage part.
Some pointers:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With