Share
Embed
Couchbase @ Estee Lauder, Couchbase Server Technical Overview
Couchbase Server Technical Overview
Jeff Harris
April 18, 2014
Transcript
47 slides
-
1 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Jeff Harris, Enterprise Accounts Mel Boulos, Senior Solu2ons Engineer NoSQL Document Database Data Management for Interac6ve Applica6ons -
2 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Mee6ng Objec6ves/Agenda Who and What is Couchbase? When should I use Couchbase? Why Couchbase vs Oracle? Couchbase Server & Mobile – The Basics Next Steps, NDA, POC or project engagement -
3 Couchbase, Inc. Confiden2al Fastest growing NoSQL database
company > 4x growth in 2013; Widely recognized as industry leader Worldwide opera6ons with > 150 employees >75 in engineering; more than doubling every year Support offices in US (mul2ple), UK, India, Japan, China (soon) Leader in scalability & high performance Easily & reliable scale your app; Get consistent low latency & high throughput Only NoSQL vendor with mobile database + sync Recognized as most innova6ve NoSQL vendor Provide KV & document database for web & mobile apps Flexible, schemaless JSON data model; 100% open source Mission cri6cal deployments at large enterprises & internet companies > 400 customers; >10,000 paid produc2on nodes deployed; worldwide customer base Couchbase, Inc. Confiden2al -
4 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Market Adop6on > 400 customers; > 10,000 produc6on nodes deployed Internet Companies Enterprises -
5 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Rela6onal vs. NoSQL Document databases -
6 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Scalability Must Dynamically Scale Apps to Support Millions of Users • Centralized, scale up architecture with big, expensive servers • Manual sharding at app level struggles to support “web scale” • High so_ware costs & TCO • Distributed, scale-‐out architecture with cluster of low-‐cost, commodity servers • Auto-‐sharding at database level to support Big Data, Big Users • Open source & lower TCO RDBMS Scales Up Get a bigger, more complex server Users Applica6on Scales Out Just add more commodity web servers Users System Cost Applica2on Performance System Cost Applica2on Performance Won’t scale beyond this point Couchbase, Inc. Confiden2al -
7 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Rela6onal vs Document Data Model Rela6onal data model Document data model Collec2on of complex documents with arbitrary, nested data formats and varying “record” format. Highly-‐structured table organiza2on with rigidly-‐defined data formats and record structure. JSON JSON C1 C2 C3 C4 JSON { } -
8 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
RDBMS Example: User Profile Address Info 1 DEN 30303 CO 2 MV 94040 CA 3 CHI 60609 IL User Info KEY First ZIP_id Last 4 NY 10010 NY 1 Frank 2 Weigel 2 Ali 2 Dodson 3 Mark 2 Azad 4 Steve 3 Yen ZIP_id CITY ZIP STATE 1 Frank 2 Weigel To get info about specific user, you perform a join across two tables -
9 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
All data in a single document Document Example: User Profile { “ID”: 1, “FIRST”: “Frank”, “LAST”: “Weigel”, “ZIP”: “94040”, “CITY”: “MV”, “STATE”: “CA” } JSON = + -
10 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Performance Consumers & Employees Demand Highly Responsive Apps • Architecture based on “speed of disk” • Requires joins across hundreds or thousands of tables • High throughput requires very expensive hardware • Architecture based on “speed to memory” • Faster access to aggregated, de-‐normalized objects • High throughput at low TCO with cluster of commodity servers Applica2on layer RDBMS Cache Applica2on layer RDBMS Cache Couchbase Couchbase, Inc. Confiden2al -
11 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
What is Couchbase -
12 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Overview Couchbase offers a full range of Data Management solu6ons High Availability Cache Key Value Document Mobile device SSN: 400 658 9993 Pass: ****** Pass: ****** -
13 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase Server Is The Complete Solu6on One click scalability and no app changes. Sub millisecond latency with high throughput for reads and writes. Maintenance, upgrades and cluster resizing all online without applica2on down2me JSON document model with no fixed schema. ✔ ✔ ✔ ✔ Consistent High Performance Flexible Data Model Easy Scalability Always On 24x7x365 -
14 Couchbase, Inc. Confiden2al Easy Scalability XDCR
Single Node Type No Manual Sharding Database manages data movement to scale out -‐ Not the user Database handles propaga2on of updates to scale across clusters and geos Provides disaster recover / data locality Hugely simplifies management of clusters Easy to scale clusters by adding any # of nodes FEATURES Auto Sharding Couchbase, Inc. Confiden2al -
15 Couchbase, Inc. Confiden2al Consistent, High Performance
Fine Grained Locking Built-‐in Cache Hash Par66oning Allows high concurrency and in turn high throughput via highly granular latches No need of separate cache layer Database manages ac2vely used data Uniform data distribu2on Uniform load distribu2on – NO hotspots PERFORMANCE Support a large number of users needed for interac2ve apps Massive Concurrent Connec6ons FEATURES Couchbase, Inc. Confiden2al -
16 Couchbase, Inc. Confiden2al Always on 24x7 Capability
All admin opera2ons online • Compac2on • Indexing • Rebalance • Backup & Restore • High availability using in-‐memory replica2on • Auto or manual failover • XDCR for disaster recovery Online administra6ve opera6ons HA via Replica6on DR via XDCR FEATURES Online DB upgrades and HW maintenance Op2mized swap opera2on to replace nodes Online DB upgrades and maintenance Couchbase, Inc. Confiden2al -
17 Couchbase, Inc. Confiden2al Flexible Data Model
Represent data as objects instead of shredding into rows and columns Create indexes on any anribute of the document Each document can have a different structure Easy to change data without database changes and down2me Maintains Na6ve object representa6on Handles constantly changing data JSON JSON JSON JSON JSON FEATURES Data with mixed structure bener managed via JSON in a document DB than an RDBMS Schema-‐less for structured / un/ semi-‐ structured data Couchbase, Inc. Confiden2al -
19 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
A look into some specific use cases Web app or Use-‐case Couchbase Solu6on Example Customer Content Store & Metadata System Couchbase document store + Elas2c Search Social Game & Mobile App Couchbase store game and player data Ad Targe6ng Couchbase stores user informa2on for fast access User Profile Store Couchbase Server as a key-‐value store Session Store Couchbase Server as a key-‐value store High Availability Caching Tier Couchbase Server as a memcached 2er replacement Chat/Messaging Platorm Couchbase Server Mobile Couchbase Server, Sync Gateway & Couchbase Lite -
20 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Customer Case Studies -
21 Couchbase, Inc. Confiden2al • User profile store
#1 mission-‐cri2cal centralized service Cloud, music, and app services 800M+ profiles • Replacement of Oracle Streams • Evaluated Cassandra and mongoDB • Chose Couchbase for ability to scale to mul6ple DCs, performance, and replica6on latency • Deployed Couchbase in produc6on since September 2013 • 240 Server nodes, 3 datacenters, 200K reads/sec, 20K writes/sec • DBA core team deemed Couchbase reliable easy to maintain Top Tier Consumer Electronics Company -
22 Couchbase, Inc. Confiden2al Ad Targe)ng and
Analy)cs • Company McGraw-‐Hill Educa2on Labs: A Self Adap2ng, Interac2ve Learning Portal • Applica6on Requirements An interac2ve learning environment that scales to millions of learners Serves MHE as well as third party content Self=adapts via usage data • Experimented with other types of database Infrastructure XML databases SQL/MR Engines In-‐memory data grids Enterprise search servers • Pain None allowed for elas2c scaling under spike periods Couldn’t catalog & deliver content from many sources Needed consistent low-‐latency for metadata and stats access Needed full-‐text search support for content discovery • Couchbase Benefits Scalability: simple scaleout to support 11 million users producing 4 petabytes of digital content data. Persistence Low latency: sub millisecond response 2mes Front end Middleware Back-‐end -
23 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase solu6on “The basics” -
24 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase Server Architecture Replica2on, Rebalance, Shard State Manager REST management API/Web UI 8091 Admin Console Erlang /OTP 11210 / 11211 Data access ports Object-‐managed Cache Storage Engine 8092 Query API Query Engine hvp Data Manager Cluster Manager Cluster Manager Wrinen in Erlang Data Manager Wrinen in C/C++ -
25 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Single Node: Couchbase Server Architecture Replica2on, Rebalance, Shard State Manager REST management API/Web UI 8091 Admin Console Erlang /OTP 11210 / 11211 Data access ports Object-‐managed Cache Storage Engine 8092 Query API Query Engine hvp Data Manager Cluster Manager -
26 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Auto Sharding and Cluster Map Hash func6on (KEY) vB1 vB2 vB3 vB4 vB5 vB6 Physical servers A B C More scalability required Add node Logical Par66ons Cluster Map New Cluster Map -
27 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
3 3 2 Single node – Couchbase Write Opera6on Managed Cache Disk Queue Disk Replica2on Queue App Server Couchbase Server Node To other node Doc 1 Doc 1 Doc 1 -
28 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
3 3 2 Single node – Couchbase Update Opera6on Managed Cache Disk Queue Disk Replica2on Queue App Server Couchbase Server Node To other node Doc 1 Doc 1 Doc 1 Doc 1 Doc 1 -
29 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
3 3 2 Single node – Couchbase Read Opera6on Managed Cache Disk Queue Disk Replica2on Queue App Server Couchbase Server Node To other node Doc 1 Get Doc 1 Doc 1 Doc 1 -
30 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Managed Cache Disk Queue Disk Replica2on Queue Couchbase Server Node To other node Doc 1 Doc 1 Doc 2 Doc 3 Doc 4 Doc 5 Doc 6 Cache Ejec6on App Server Doc 2 Doc 3 Doc 4 Doc 5 Doc 6 -
31 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Managed Cache Disk Queue Disk Replica2on Queue Couchbase Server Node To other node Doc 1 Doc 2 Doc 3 Doc 4 Doc 5 Doc 6 Cache Miss App Server Doc 2 Doc 3 Doc 4 Doc 5 Doc 6 Get Doc 1 Doc 1 Doc 1 Doc 1 -
32 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase Server Cluster Basic Opera6on User Configured Replica Count = 1 Read/write/update Ac2ve SERVER 1 Ac2ve SERVER 2 Ac2ve SERVER 3 App Server 1 COUCHBASE Client Library CLUSTER MAP COUCHBASE Client Library CLUSTER MAP App Server 2 Doc 5 Doc 2 Doc 9 Doc Doc Doc Doc 4 Doc 7 Doc 8 Doc Doc Doc Doc 1 Doc 3 Doc 6 Doc Doc Doc Replica Replica Replica Doc 4 Doc 1 Doc 8 Doc Doc Doc Doc 6 Doc 3 Doc 2 Doc Doc Doc Doc 7 Doc 9 Doc 5 Doc Doc Doc • Docs distributed evenly across servers • Each server stores both ac6ve and replica docs Only one server ac2ve at a 2me • Client library provides app with simple interface to database • Cluster map provides map to which server doc is on App never needs to know • App reads, writes, updates docs • Mul6ple app servers can access same document at same 6me -
33 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Add Nodes to Cluster SERVER 4 SERVER 5 Replica Ac2ve Replica Ac2ve Read/write/update App Server 1 COUCHBASE Client Library CLUSTER MAP COUCHBASE Client Library CLUSTER MAP App Server 2 User Configured Replica Count = 1 Couchbase Server Cluster Ac2ve SERVER 1 Doc 5 Doc 2 Doc 9 Doc Doc Doc Replica Doc 4 Doc 1 Doc 8 Doc Doc Doc Ac2ve SERVER 2 Doc 4 Doc 7 Doc 8 Doc Doc Doc Replica Doc 6 Doc 3 Doc 2 Doc Doc Doc Ac2ve SERVER 3 Doc 1 Doc 3 Doc 6 Doc Doc Doc Replica Doc 7 Doc 9 Doc 5 Doc Doc Doc Read/write/update • Two servers added with one-‐click opera6on • Docs automa6cally rebalance across cluster Even distribu2on of docs Minimum doc movement • Cluster map updated • App database calls now distributed over larger number of servers -
34 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Fail Over Node User Configured Replica Count = 1 SERVER 4 SERVER 5 Replica Ac2ve Replica Ac2ve App Server 1 COUCHBASE Client Library CLUSTER MAP COUCHBASE Client Library CLUSTER MAP App Server 2 Couchbase Server Cluster Ac2ve SERVER 1 Doc 5 Doc 2 Doc 9 Doc Doc Doc Replica Doc 4 Doc 1 Doc 8 Doc Doc Doc Ac2ve SERVER 2 Doc 4 Doc 7 Doc 8 Doc Doc Doc Replica Doc 6 Doc 3 Doc 2 Doc Doc Doc Ac2ve SERVER 3 Doc 1 Doc 3 Doc 6 Doc Doc Doc Replica Doc 7 Doc 9 Doc 5 Doc Doc Doc • App servers accessing docs • Requests to Server 3 fail • Cluster detects server failed – Promotes replicas of docs to ac2ve – Updates cluster map • Requests for docs now go to appropriate server • Typically rebalance would follow Doc 1 Doc 3 Doc -
35 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
XDCR: Cross Data Center Replica6on US DATA CENTER hnp://blog.groosy.com/wp-‐content/uploads/2011/10/internet-‐map.jpg EURPOE DATA CENTER ASIA DATA CENTER -
36 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
ACTIVE SERVER 1 RAM DISK Doc Doc 2 Doc 9 Doc Doc Doc ACTIVE SERVER 2 RAM DISK Doc Doc Doc Doc Doc Doc ACTIVE SERVER 3 RAM DISK Doc Doc Doc Doc Doc Doc Cross Data Center Replica6on (XDCR) COUCHBASE SERVER CLUSTER NYC DATA CENTER COUCHBASE SERVER CLUSTER SF DATA CENTER ACTIVE SERVER 1 RAM DISK Doc Doc 2 Doc 9 Doc Doc Doc ACTIVE SERVER 2 RAM DISK Doc Doc Doc Doc Doc Doc ACTIVE SERVER 3 RAM DISK Doc Doc Doc Doc Doc Doc { } { } { } { } { } { } { } { } { } { } { } { } { } -
37 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Indexing and Querying Features • Index and Query Distributed indexing and querying Secondary indexes of JSON document content Flexible querying of indexes • Incremental Map-‐Reduce Distributed simple real-‐2me analy2cs Only considers changes due to updated data • Full Text Search Robust integra2on with Elas2cSearch cluster Flexible full text search and faceted search -
38 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase Server Cluster Indexing and Querying User Configured Replica Count = 1 Ac2ve SERVER 1 SERVER 3 App Server 1 COUCHBASE Client Library CLUSTER MAP COUCHBASE Client Library CLUSTER MAP App Server 2 Doc 5 Doc 2 Doc 9 Doc Doc Doc Ac2ve Doc 1 Doc 3 Doc 6 Doc Doc Doc Replica Doc 4 Doc 1 Doc 8 Doc Doc Doc Ac2ve SERVER 2 Doc 4 Doc 7 Doc 8 Doc Doc Doc Replica Doc 6 Doc 3 Doc 2 Doc Doc Doc Replica Doc 7 Doc 9 Doc 5 Doc Doc Doc • Indexing work is distributed amongst nodes • Large data set possible • Parallelize the effort • Each node has index for data stored on it • Queries combine the results from required nodes Query -
39 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Full Text Search Applica2on Server COUCHBASE SDK Search via HTTP COUCHBASE CLUSTER ELASTICSERACH CLUSTER Read/Writes Queries Queries Document IDs Content delivery Network Couchbase Plug-‐in using Replica2on -
40 Couchbase, Inc. Confiden2al JSON Anywhere
Couchbase Server • JSON on the device Developers increasingly prefer NoSQL database • JSON on the wire No need for data transforma2on • JSON in the cloud Flexible data model High performance Easy scalability Server Sync Gateway Lite JS N JS N JS N -
41 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Architecture SERVER 3 SERVER 1 SERVER 2 Couchbase Server Channel Sync Gateway Channel Channel Sync Gateway Channel Couchbase Lite for iOS and Android On Premise In the cloud -
42 Couchbase, Inc. Confiden2al Couchbase Lite The
only NoSQL Database for Mobile Devices • Features Ultra-‐lightweight, secure JSON database Na2ve support for iOS, Android and REST/HTML5 Full document, index and querying and sync capabili2es Powerful conflict resolu2on Lite Couchbase Lite Android Couchbase Lite iOS -
43 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
The Couchbase difference -
44 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
NoSQL Database Considera6ons Easy Scalability Flexible Data Model Always On 24x7x365 Grow cluster without applica2on changes, without down2me when needed Always awesome experience for your applica2on users. The sun never sets on the Internet, your applica2on needs the database to always serve data. Keep developers produc2ve and allow fast and easy addi2on of new features JSON JSON JSON JSON JSON PERFORMANCE Consistent High Performance -
45 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Always-‐On 24x7x365: Proof Point Example 0 20 40 60 80 100 82 57 72 Couchbase Data Store Availability -
46 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Couchbase Server Is The Complete Solu6on One click scalability and no app changes. Sub millisecond latency with high throughput for reads and writes. Maintenance, upgrades and cluster resizing all online without applica2on down2me JSON document model with no fixed schema. ✔ ✔ ✔ ✔ Consistent High Performance Flexible Data Model Easy Scalability Always On 24x7x365 -
47 Couchbase, Inc. Confiden2al Couchbase, Inc. Confiden2al
Enterprise vs. Community Edi6on Enterprise Edi6on Community Edi6on Cost • Free for pre-‐produc2on • Star2ng at $2,700/node/yr • Free Produc6on Readiness Produc2on Ready • Take open source snapshots • Put through rigorous QA process, fix bugs Unknown Produc2on Readiness • Built with latest open source • Undefined quality Features Differences Enterprise Focused Proprietary Features • Rack/Zone Awareness • Encryp2on support for XDCR • None Technical Support Professional Support • Defined SLAs from the experts • Immediate hot bug fixes Community/Forum Support • No SLA, unknown response 2mes • No bugs fixes assured in a 2mely manner Best Prac6ce Exper6se Broad Best Prac2ce Exper2se • From working with 100s of customers Exper2se of community members • Based on limited individual exper2se Release Support Long-‐Tail Release Support • Including hot bug fixes No Support for Old Releases • Must support old releases yourself License Type Commercial License • Std license terms, SLA, indemnity Simple “As is” license Intended Use Produc2on Deployments Non-‐Produc2on Use, Simple Use Cases