Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Michael Nitschinger on Building a reactive Couchbase driver for the JVM

Michael Nitschinger on Building a reactive Couchbase driver for the JVM

More Decks by Enterprise Java User Group Austria

Other Decks in Technology

Transcript

  1. A  Retrospective:     Couchbase  on  the  JVM   or

     how  we’ve  built  the  first  reactive  driver  and  still  love  it       Michael  Nitschinger,  SDK  Engineer  
  2. ©2015  Couchbase  Inc.   7   Java  SDK  1.x  

    § Extends  Spymemcached   § Adds  Config  &  View  Capabilities   § Stable  &  Mature   § Old  codebase,  difficult  to  maintain  and  evolve   § API  grew  organically  
  3. ©2015  Couchbase  Inc.   8   Spymemcached   §  Initial

     Work  Started  mid  2006  (Java  5)   §  No  Generics   §  Memcached  ASCII  Protocol  
  4. ©2015  Couchbase  Inc.   11   From  Key  Value  to

     Documents   Key   Value   Views   N1QL   Search   mcd   ✔   1.8   ✔   2.0   ✔   ✔   3.0   ✔   ✔   4.0   ✔   ✔   ✔   .next   ✔   ✔   ✔   ✔  
  5. ©2015  Couchbase  Inc.   15   Rx  Semantics   single

      multiple   sync   T   Iterable<T>   async   Future<T>   Observable<T>  
  6. ©2015  Couchbase  Inc.   16   Rx  Semantics   Event

      Iterable<T>   Observable<T>   data  retrieval   T  next()   onNext(T)   discover  error   throws  Exception   onError(Throwable)   complete   returns   onCompleted()  
  7. ©2015  Couchbase  Inc.   17   Consuming  Observables   17

      §  The  Observer  subscribes     and  receives  events.   §  A  cold  Observable   starts  when  subscribed.   §  onNext  can  be  called   0..N  times  
  8. ©2015  Couchbase  Inc.   42   Coordinated  Retry:  Builder  

    42   §  Declarative  API  instead  of  complicated  retryWhen