Couchbase

2,492 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,492
On SlideShare
0
From Embeds
0
Number of Embeds
681
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Couchbase

  1. 1. Lorraine JUG - 19-JUN-2013Thursday, June 20, 13
  2. 2. Lorraine JUG - 19-JUN-2013Send  a  mail  to:winning@couchbase.comLorraineJUG  in  the  subject...Join  the  French  Couchbase  Meetuph3p://www.meetup.com/Couchbase-­‐France/Thursday, June 20, 13
  3. 3. Lorraine JUG - 19-JUN-2013Introduc)on  to  NoSQL  with  CouchbaseTugdual  GrallTechnical  EvangelistThursday, June 20, 13
  4. 4. Lorraine JUG - 19-JUN-2013About  me...• Tugdual  “Tug”  Grall­ Couchbase• Technical  Evangelist­ eXo• CTO­ Oracle• Developer/Product  Manager­ Mainly  Java/SOA­ Developer  in  consul)ng  firms• Web­  @tgrall­      hIp://blog.grallandco.com­      tgrall­ NantesJUG  co-­‐founder­ Pet  Project  :­ hIp://www.resultri.comThursday, June 20, 13
  5. 5. Lorraine JUG - 19-JUN-2013Agenda• Why  NoSQL  ?• NoSQL  Landscape• Document  Design• Use  Cases• Couchbase  Server  2.0Thursday, June 20, 13
  6. 6. Lorraine JUG - 19-JUN-2013$30B  Database  Market  Being  Disrupted<50%?202795%RelaVonal  Technology2012All  new  database  growth  will  be  NoSQLRelaVonal  TechnologyRelaVonal  TechnologyRelaVonal  TechnologyNoSQLTechnologyOtherThursday, June 20, 13
  7. 7. Lorraine JUG - 19-JUN-2013Three  Macro  Trends  Driving  DisrupVonBig  DataSaaS/Cloud  CompuVngBig  UsersThursday, June 20, 13
  8. 8. Lorraine JUG - 19-JUN-2013Smartphone  UsersHours  Spent  Online35Billion  Hours1Billion+Global  Online  PopulaVon2Billion+Thursday, June 20, 13
  9. 9. Lorraine JUG - 19-JUN-2013Big  DataHigh  Data  Variety  and  VelocitySource:  IDC  2011  Digital  Universe  Study  (hIp://www.emc.com/collateral/demos/microsites/emc-­‐digital-­‐universe-­‐2011/index.htm)Trillions  of  Gigabytes  (ZeIabytes)00.501.001.502.002000 2006 2011Unstructured  and  Semi-­‐Structured  DataStructured  DataText,  Log  Files,  Click  Streams,  Blogs,  Tweets,  Audio,  Video,  etc.More  Flexible  Data  Model  RequiredThursday, June 20, 13
  10. 10. Lorraine JUG - 19-JUN-2013RDBMS  are  not  Enough?Thursday, June 20, 13
  11. 11. Lorraine JUG - 19-JUN-2013Growth  is  the  New  Reality• Instagram  gained  nearly  1  million  users  overnight  when  then  expanded  to  AndroidThursday, June 20, 13
  12. 12. Lorraine JUG - 19-JUN-2013Draw  Something  Viral  Growth191715131197533/12826242220181614121082/6Draw  Something  by  OMGPOPDaily  Ac)ve  Users  (millions)21246810121416Thursday, June 20, 13
  13. 13. Lorraine JUG - 19-JUN-2013RDBMS  is  good  for  many  thing,  but  hard  to  scaleRDBMS  Scales  UpGet  a  bigger,  more  complex  serverUsersApplicaVon  Scales  OutJust  add  more  commodity  web  serversUsersSystem  CostApplica)on  Performance  RelaVonal  DatabaseWeb/App  Server  TierSystem  CostApplica)on  Performance  Won’t  scale  beyond  this  pointHow  do  you  take  this  growth?Thursday, June 20, 13
  14. 14. Lorraine JUG - 19-JUN-2013Web/App  Server  TierMemcached  TierMySQL  TierScaling  out  RDBMS• Run  Many  SQL  Servers• Data  could  be  sharded­ Done  by  the  applica)on  code• Caching  for  faster  response  VmeThursday, June 20, 13
  15. 15. Lorraine JUG - 19-JUN-2013Scaling  out  flafens  the  cost  and  performance  curvesNoSQL  Database  Scales  OutCost  and  performance  mirrors  app  VerUsersNoSQL  Distributed  Data  StoreWeb/App  Server  TierApplicaVon  Scales  OutJust  add  more  commodity  web  serversUsersSystem  CostApplica)on  Performance  Applica)on  Performance  System  CostNoSQL  Technology  Scales  OutThursday, June 20, 13
  16. 16. Lorraine JUG - 19-JUN-2013DynamoOctober  2007CassandraAugust  2008BigtableNovember  2006VoldemortFebruary  2009Very  few  organizaVons  want  to  (fewer  can)  build  and  maintain  database  sojware  technology.But  every  organizaVon  building  interacVve  web  applicaVons  needs  this  technology.A  New  Technology?• Building  new  database  to  answer  the  following  requirements­ No  schema  required  before  inser)ng  data­ No  schema  change  required  to  change  data  format­ Auto-­‐sharding  without  applica)on  par)cipa)on­ Distributed  queries­ Integrated  main  memory  caching­ Data  synchroniza)on  (  mul)-­‐datacenter)Thursday, June 20, 13
  17. 17. Lorraine JUG - 19-JUN-2013Lack  of  flexibility/rigid  schemasInability  to  scale  out  data Performance  challenges Cost All  of  these Other49%35%29%16%12%11%What  Is  Biggest  Data  Management  Problem  Driving  Use  of  NoSQL  in  Coming  Year?Source:  Couchbase  Survey,  December  2011,  n  =  1351.Thursday, June 20, 13
  18. 18. Lorraine JUG - 19-JUN-2013NoSQL  CatalogKey-­‐ValueMemcachedMembaseRedisData  Structure Document Column GraphMongoDBCouchbase CassandraCache(memory  only)Database(memory/disk)Neo4jHBase InfiniteGraphCoherenceThursday, June 20, 13
  19. 19. Lorraine JUG - 19-JUN-2013OperaVonal  vs.  AnalyVc  DatabasesClouderaHortonworksMaprCouchbaseMongoDBCassandraHbaseAnaly9cDatabasesGet  insights  from  dataReal-­‐9me,  Interac9ve  DatabasesFast  access  to  dataNoSQLThursday, June 20, 13
  20. 20. Lorraine JUG - 19-JUN-2013HadoopThursday, June 20, 13
  21. 21. Lorraine JUG - 19-JUN-2013Use  CasesKey  Value •  Session  Management•  User  Profile/Preferences•  Shopping  CartDocument •  Event  Logging•  Content  Management  •  Web  AnalyFcs•  E-­‐Commerce  ApplicaFonColumns •  Event  Logging•  Content  Management•  CountersGraph •  Connected  Data  /    Social  Networks•  RouFng,  Dispatch•  RecommendaFons  based  on  Social  GraphThursday, June 20, 13
  22. 22. Lorraine JUG - 19-JUN-2013Data  ModelsThursday, June 20, 13
  23. 23. Lorraine JUG - 19-JUN-2013RelaVonal  vs  Document  Data  ModelRelaVonal  data  model Document  data  modelCollec)on  of  complex  documents  witharbitrary,  nested  data  formats  andvarying  “record”  format.Highly-­‐structured  table  organiza)on  with  rigidly-­‐defined  data  formats  and  record  structure.C1 C2 C3 C4JSONJSONJSON{}Thursday, June 20, 13
  24. 24. Lorraine JUG - 19-JUN-2013The  RelaVonal  Approach  to  Storing  DataRela)onal  databases  were  not  designed  with  clusters  in  mind,  which  is  why  people  have  cast  around  for  an  alterna)ve.  Storing  aggregates  as  fundamental  units  makes  a  lot  of  sense  for  running  on  a  cluster.  hIp://mar)nfowler.com/bliki/AggregateOrientedDatabase.htmlThursday, June 20, 13
  25. 25. Lorraine JUG - 19-JUN-2013Document  Database  by  Comparisono::1001{uid: “ji22jd”,customer: “Ann”,line_items: [{ sku: 0321293533, quan: 2, unit_price:48.0 },{ sku: 0321601912, quan: 1, unit_price:39.0 },{ sku: 0131495054, quan: 1, unit_price: 51.0 }],payment: {type: “Amex”,expiry: “04/2001”,last5: 12345}}Easy  to  distribute  dataMakes  sense  to  applicaFon  programmersThursday, June 20, 13
  26. 26. Lorraine JUG - 19-JUN-2013Objects  Serialized  to  JSON  and  Back  User  Objectstring uidstring firstnamestring lastnameint agearray favorite_colorsstring emailu::john@couchbase.com{“uid”:  123456,“firstname”:  “John”,“lastname”:  “Smith”,“age”:  22,“favorite_colors”:  [“blue”,  “black”],“email”:  “john@couchbase.com”}User  Objectstring uidstring firstnamestring lastnameint agearray favorite_colorsstring emailu::john@couchbase.com{“uid”:  123456,“firstname”:  “john”,“lastname”:  “smith”,“age”:  22,“favorite_colors”:  [“blue”,  “black”],“email”:  “john@couchbase.com”}set()get()Thursday, June 20, 13
  27. 27. Lorraine JUG - 19-JUN-2013Use  CasesThursday, June 20, 13
  28. 28. Lorraine JUG - 19-JUN-2013Common  Use  CasesSocial  Gaming• Couchbase  stores  player  and  game  data  • Examples  customers  include:  Zynga• Tapjoy,  Ubisor,  TencentMobile  Apps• Couchbase  stores  user  info  and  app  content• Examples  customers  include:  Kobo,  Play)ka  Ad  TargeVng• Couchbase  stores  user  informa)on  for  fast  access• Examples  customers  include:  AOL,  Mediamind,  Convertro  Session  store• Couchbase  Server  as  a  key-­‐value  store• Examples  customers  include:  Concur,  SabreUser  Profile  Store• Couchbase  Server  as  a  key-­‐value  store• Examples  customers  include:  TunewikiHigh  availability  cache• Couchbase  Server  used  as  a  cache  )er  replacement• Examples  customers  include:  OrbitzContent  &  Metadata  Store• Couchbase  document  store  with  Elas)c  Search• Examples  customers  include:  McGraw  Hill3rd  party  data    aggregaVon  • Couchbase  stores  social  media  and  data  feeds• Examples  customers  include:  SambacloudThursday, June 20, 13
  29. 29. Lorraine JUG - 19-JUN-2013QuesVons  ?  Concerns  ?• Data  DuplicaVon?• Schema  ?• TransacVon  ?• DBA  ?• Backup/Restore  ?• ...?Thursday, June 20, 13
  30. 30. Lorraine JUG - 19-JUN-2013Couchbase  ServerNoSQL  Document  DatabaseThursday, June 20, 13
  31. 31. Lorraine JUG - 19-JUN-2013Easy  Scalability Consistent  High  PerformanceAlways  On  24x365Grow  cluster  without  applica)on  changes,  without  down)me  with  a  single  clickConsistent  sub-­‐millisecond  read  and  write  response  )mes  with  consistent  high  throughputNo  down)me  for  sorware  upgrades,  hardware  maintenance,  etc.Flexible  Data  ModelJSON  document  model  with  no  fixed  schema.Couchbase  ServerThursday, June 20, 13
  32. 32. Lorraine JUG - 19-JUN-2013Open  Source  ProjectThursday, June 20, 13
  33. 33. Lorraine JUG - 19-JUN-2013Couchbase  Handles  Real  World  ScaleThursday, June 20, 13
  34. 34. Lorraine JUG - 19-JUN-2013HeartbeatProcess  monitorGlobal  singleton  supervisorConfigura)on  manageron  each  nodeRebalance  orchestratorNode  health  monitorone  per  clustervBucket  state  and  replica)on  managerhSpREST  management  API/Web  UIHTTP8091Erlang  port  mapper4369Distributed  Erlang21100  -­‐  21199Erlang/OTPstorage  interfaceCouchbase  EP  Engine11210Memcapable    2.0Moxi11211Memcapable    1.0MemcachedNew  Persistence  Layer8092Query  APIQuery  EngineData  Manager Cluster  ManagerCouchbase  Server  ArchitectureThursday, June 20, 13
  35. 35. Lorraine JUG - 19-JUN-2013HeartbeatProcess  monitorGlobal  singleton  supervisorConfigura)on  manageron  each  nodeRebalance  orchestratorNode  health  monitorone  per  clustervBucket  state  and  replica)on  managerhSpREST  management  API/Web  UIHTTP8091Erlang  port  mapper4369Distributed  Erlang21100  -­‐  21199Erlang/OTPstorage  interfaceCouchbase  EP  Engine11210Memcapable    2.0Moxi11211Memcapable    1.0MemcachedNew  Persistence  Layer8092Query  APIQuery  EngineCouchbase  Server  ArchitectureThursday, June 20, 13
  36. 36. Lorraine JUG - 19-JUN-2013Couchbase  Opera)onsThursday, June 20, 13
  37. 37. Lorraine JUG - 19-JUN-201333 2Single  node  -­‐  Couchbase  Write  Opera)onManaged  CacheDisk  QueueDiskReplica)on  QueueApp  ServerCouchbase  Server  NodeDoc  1Doc  1Doc  1To  other  nodeThursday, June 20, 13
  38. 38. Lorraine JUG - 19-JUN-2013COUCHBASE  SERVER    CLUSTERBasic  Opera)on• Docs  distributed  evenly  across  servers  • Each  server  stores  both  ac9ve  and  replica  docsOnly  one  server  ac)ve  at  a  )me• Client  library  provides  app  with  simple  interface  to  database• Cluster  map  provides  map  to  which  server  doc  is  onApp  never  needs  to  know• App  reads,  writes,  updates  docs• Mul9ple  app  servers  can  access  same  document  at  same  9meUser  Configured  Replica  Count  =  1READ/WRITE/UPDATEACTIVESERVER  1ACTIVEDoc  4Doc  7DocDocDocSERVER  2Doc  8ACTIVEDoc  1Doc  2DocDocDocREPLICADoc  4Doc  1Doc  8DocDocDocREPLICADoc  6Doc  3Doc  2DocDocDocREPLICADoc  7Doc  9Doc  5DocDocDocSERVER  3Doc  6Doc  5Doc  2DocDocDocDoc  9APP  SERVER  1COUCHBASE  Client  LibraryCLUSTER  MAPCOUCHBASE  Client  LibraryCLUSTER  MAPAPP  SERVER  2Thursday, June 20, 13
  39. 39. Lorraine JUG - 19-JUN-2013Client  SDKwww.couchbase.com/developClojurePythonRubylibcouchbaseGoThursday, June 20, 13
  40. 40. Lorraine JUG - 19-JUN-2013Demo  TimeThursday, June 20, 13
  41. 41. Lorraine JUG - 19-JUN-2013Cross  Data  ReplicaVonUS  DATA  CENTER EUROPE  DATA  CENTER ASIA  DATA  CENTERReplica9on Replica9onReplica9on• Data  close  to  users• MulVple  locaVons  for  disaster  recovery• Independently  managed  clusters  serving  local  dataThursday, June 20, 13
  42. 42. Lorraine JUG - 19-JUN-2013www.couchbase.com/downloadCouchbase  Server  Thursday, June 20, 13
  43. 43. Lorraine JUG - 19-JUN-2013Q  &  AMeetuphIp://meetup.com/Couchbase-­‐France/Contacts@tgrall  /  tug@couchbase.comThursday, June 20, 13
  44. 44. Lorraine JUG - 19-JUN-2013Thank  you!tug@couchbase.com@tgrallJoin  the  French  Couchbase  Meetuph3p://www.meetup.com/Couchbase-­‐France/Thursday, June 20, 13
  45. 45. Lorraine JUG - 19-JUN-2013Thursday, June 20, 13

×