HI everybody,
we are planing to use Couchbase as back-end database.
Furthermore we need to upload xml files from a customer (local windows server which automatically retrieves xml files)
and then process them with a xslt transformation and store the result as document in couchbase for aggregation.
So, one way would be to use a WebApi with authentication and a post request to upload the xml files to the server, nothing special about that.
But it would require to write logic for authentication, uploading and failover (connection lost, server down…).
So my question is, if something like that could be build with couchbase lite .net and sync gateway.
Based on the information I have collected so far, I would suggest the following scenario.
Use Couchbase Lite .Net inside a Windows Service on the local customer Windows server, if a xml file arrives, create a new document with some unique id(doesn’t matter because the relevant Id’s are living inside the xml file) and store it with the xml file as attachment (files have a maximum size of 1 or 2 MB).
On server side, use Sync Gateway to authenticate incoming requests and sync with the local Couchbase Lite instances.
Use a channel for every customer, so that the local instances only receive there documents and updates from Sync Gateway.
So, now the documents are stored in the syc_gateway bucket on the server, next step would be to process the xslt transformation and store the result in another ‘aggregation’ bucket.
I thought this would be possible by another Windows Service which runs on server side and acts as another ‘couchbase lite client’ (via RESTapi!?) which looks on a channel called ‘unprocessed’ which contains all documents from all customers that are not processed yet(could be some property with processed : false which is only set once from sync gateway during import from local client).
After processing the xml and storing the result inside the aggregation bucket, the service should delete the document from Sync Gateway to reduce disc space and of course the file should also be deleted from the local Couchbase Lite instance automatically during next ‘sync’ .
So my question is, if that is a possible workflow that Couchbase Lite .net and Sync Gateway could cover, or if I better use simple Web Api and handle failover on client side by my self.
Thanks for helping me out.
Best regards from Germany