I want to implement an Idempotent Repository on Couchbase with three synchronous add, contains, remove operations, which will be called concurrently in a very high rate (5000 calls/sec each)
my very simple implementation is as below:
//Remove Op
val res = Await.result( bucket.delete( key ), 1 second )
// Contains check
val res = Await.result( bucket.get[String]( key ), 1 second )
res.exists( _ => true )
// Add operation
val res = Await.result( bucket.add( key, System.currentTimeMillis, CouchbaseExpirationTiming_byDuration( expiry ) ), 1 second )
res.isSuccess
however this is not scalable and my operations time out under load.
How can I achieve better implementation? can stream methods help me with sync operations needed above?
I want to implement an Idempotent Repository on Couchbase with three synchronous add, contains, remove operations, which will be called concurrently in a very high rate (5000 calls/sec each)
my very simple implementation is as below:
however this is not scalable and my operations time out under load.
How can I achieve better implementation? can stream methods help me with sync operations needed above?