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

Couchbase and Spring Data in the Enterprise

Couchbase and Spring Data in the Enterprise

This talk was given at SpringOne 2GX 2014 in Dallas. It introduces Couchbase, then shows how the SDKs are used and finally does a live demo of the module. Note that there are not much slides to spring data in here because those parts have been covered extensively in other sessions of the conference.

Michael Nitschinger

September 09, 2014
Tweet

More Decks by Michael Nitschinger

Other Decks in Programming

Transcript

  1. © 2014 SpringOne 2GX. All rights reserved. Do not distribute

    without permission. Couchbase and Spring Data in the Enterprise Michael Nitschinger, Software Engineer at Couchbase @daschl
  2. Core Principles 9 Flexible Data Model Schema is dictated by

    the application, not the database JSON JSON JSON JSON JSON
  3. History lesson 11 • Key  contributors  to  memcached   •

    Evolved  into  Membase   • distributed  and  persisted  key-­‐ value  store   • Evolved  into  Couchbase   • Document  Store  with  JSON   • Map-­‐Reduce  Indexing   • Cross-­‐Data  Center  ReplicaEon
  4. Couchbase Server • Current Version: 2.5.1 ! • Next Version:

    3.0.0 (currently beta2) • Optimised for huge datasets • Better indexing performance • Improved Security • … and many more: http://www.couchbase.com/beta 12
  5. Architecture 13 New  Persistence  Layer storage  interface Couchbase  EP  Engine

    11210   Memcapable    2.0 Moxi 11211   Memcapable    1.0 Object-­‐level  Cache Disk  Persistence 8092   Query  API Query  Engine HTTP   8091 Erlang  port  mapper   4369 Distributed  Erlang   21100  -­‐  21199 Heartbeat Process  monitor Global  singleton  supervisor ConfiguraEon  manager on  each  node Rebalance  orchestrator Node  health  monitor one  per  cluster vBucket  state  and  replicaEon  manager hJp REST  management  API/Web  UI Erlang/OTP Server/Cluster   Management  &   CommunicaUon   (Erlang) RAM  Cache,  Indexing   &  Persistence   Management   (C)
  6. Architecture 14 New  Persistence  Layer storage  interface Couchbase  EP  Engine

    11210   Memcapable    2.0 Moxi 11211   Memcapable    1.0 Object-­‐level  Cache Disk  Persistence 8092   Query  API Query  Engine HTTP   8091 Erlang  port  mapper   4369 Distributed  Erlang   21100  -­‐  21199 Heartbeat Process  monitor Global  singleton  supervisor ConfiguraEon  manager on  each  node Rebalance  orchestrator Node  health  monitor one  per  cluster vBucket  state  and  replicaEon  manager hJp REST  management  API/Web  UI Erlang/OTP
  7. Rebalance 15 Application Servers 8 GB RAM 3 IO Workers

    8 GB RAM 3 IO Workers TOTAL 16 GB RAM 6 IO Workers 1024 Partitions 1024 Partitions 512 Partitions 512 Partitions Rebalance Operation TOTAL 8 GB RAM 3 IO Workers 1024 Partitions
  8. Rebalance 16 TOTAL 32 GB RAM 12 IO Workers 1024

    Partitions Application Servers 8 GB RAM 3 IO Workers 8 GB RAM 3 IO Workers 8 GB RAM 3 IO Workers 8 GB RAM 3 IO Workers 512 Partitions 512 Partitions 256 Partitions 256 Partitions Rebalance Operation 256 Partitions 256 Partitions TOTAL 16 GB RAM 6 IO Workers 1024 Partitions MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP MAP
  9. Retrieval Operations 19 Couchbase Server EP Engine RAM Cache Disk

    Write Queue Replication Queue Application Server Replica Couchbase Cluster Machine get
  10. Storage Operations 20 Couchbase Server EP Engine RAM Cache Disk

    Write Queue Replication Queue Application Server Replica Couchbase Cluster Machine set/add/replace
  11. Ejection and Cache Misses 21 Couchbase Server EP Engine RAM

    Cache Disk Write Queue Replication Queue Application Server Replica Couchbase Cluster Machine FULL  (90%) NRU Documents Ejected set/add/replace set/add/replace set/add/replace get Non-­‐ Resident  Document    
  12. SDKs are cluster map aware 22 Application Servers MAP MAP

    MAP 1024 8 GB RAM Partitions 3 IO Workers
  13. Supported SDKs 24 • Start  here:  hTp://www.couchbase.com/communiEes/   • NodeJS,

     PHP,  Ruby,  and  Python  clients  are  wrappers  around   libcouchbase  C  library,  so  libcouchbase  must  be  installed  first   • Community  clients  also  available
  14. Stable SDK • Current Version: 1.4.4 ! • Asynchronous, cache-like

    API on top of Futures • Cluster topology aware • Unifies underlying protocol semantics ! • Start here: http://www.couchbase.com/communities/java/getting-started • Docs: http://docs.couchbase.com/couchbase-sdk-java-1.4/index.html 26
  15. Preview: SDK 2.0 • Current Version: 2.0.0-beta ! • Complete

    rewrite compared to 1.* • Fully asynchronous based on RxJava • Document oriented API & Support for N1QL • First-class support for JVM languages (Scala,..) & Java 8 ! • Start here: http://blog.couchbase.com/couchbase-java-sdk-200-beta-1 • Docs: http://docs.couchbase.com/prebuilt/java-sdk-2.0-beta/topics/ overview.html 27
  16. Spring Data Couchbase • Current Version: 1.1.4 (part of the

    release trains) • Depends on the 1.4.4 Java SDK ! • Key Features: • Work with Entities instead of JSON • Template as a lightweight wrapper • Full CrudRepository for easy access • Easy configuration management • JMX & @Cacheable 28
  17. 34