Using couchbase to buffer events

I have a stream of events that are captured via HTTPS calls to an external API gateway.
Multiple threads may publish events, multiple threads may consume events and store them in couchbase as a buffer.
An event embodies a single line of CSV.
Every xx minutes, I need to combine these events into one file by appending them line by line, and then upload that file to an external server. Then delete the events from couchbase.

How could this be achieved using couchbase server and Node.JS client library?

Hey @bunnykitty,

You should be able to insert your CSV data into Couchbase as an array, or you may choose to decompose the CSV to a JSON object. Check out the insert or upsert methods of our SDK!

Cheers, Brett

1 Like