Slide 1

Slide 1 text

© 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

Slide 2

Slide 2 text

is  document  oriented  and   designed  for  performance  and  scalability

Slide 3

Slide 3 text

Enterprise & Internet Company Customers 3

Slide 4

Slide 4 text

“Nice, but how does my application benefit?”

Slide 5

Slide 5 text

Couchbase 101
 Architecture

Slide 6

Slide 6 text

Core Principles 6 Easy Scalability Grow and shrink clusters easily with no downtime

Slide 7

Slide 7 text

Core Principles 7 Consistent High Performance Sub-millisecond latency and consistent throughput, even under high load PERFORMANCE

Slide 8

Slide 8 text

Core Principles 8 Always on 24x365 No downtime for software upgrades, hardware maintenance, etc

Slide 9

Slide 9 text

Core Principles 9 Flexible Data Model Schema is dictated by the application, not the database JSON JSON JSON JSON JSON

Slide 10

Slide 10 text

“Bold claims! How does it work?”

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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)

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

“How does my application access it?”

Slide 18

Slide 18 text

Couchbase 101
 Data Access

Slide 19

Slide 19 text

Retrieval Operations 19 Couchbase Server EP Engine RAM Cache Disk Write Queue Replication Queue Application Server Replica Couchbase Cluster Machine get

Slide 20

Slide 20 text

Storage Operations 20 Couchbase Server EP Engine RAM Cache Disk Write Queue Replication Queue Application Server Replica Couchbase Cluster Machine set/add/replace

Slide 21

Slide 21 text

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    

Slide 22

Slide 22 text

SDKs are cluster map aware 22 Application Servers MAP MAP MAP 1024 8 GB RAM Partitions 3 IO Workers

Slide 23

Slide 23 text

Couchbase 101
 SDKs

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

“Talk is cheap. Show me the code.” Linus Torvalds

Slide 30

Slide 30 text

Demo

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

We are hiring! couchbase.com/careers 32

Slide 33

Slide 33 text

Thank you! Questions? @daschl [email protected] github.com/daschl

Slide 34

Slide 34 text

34