SlideShare a Scribd company logo
Boston
Tonight
2
• Membase Overview
• Use Cases and Deployment Examples
• Membase Architecture
• Demo!
• Developing with Membase
• A Glimpse into the Future
What is Membase?
Membase is a distributed database
4
Membase Servers
In the data center
Web application server
Application user
On the administrator console
Web application serverWeb application server
Five minutes or less to a working
cluster
• Downloads for Linux and Windows
• Start with a single node
• One button press joins nodes to a cluster
Easy to develop against
• Just SET and GET – no schema required
• Drop it in. 10,000+ existing applications
already “speak membase” (via memcached)
• Practically every language and application
framework is supported, out of the box
Easy to manage
• One-click failover and cluster rebalancing
• Graphical and programmatic interfaces
• Configurable alerting
Membase is Simple, Fast, Elastic
5
Membase is Simple, Fast, Elastic
6
Predictable
• “Never keep an application waiting”
• Quasi-deterministic latency and throughput
Low latency
• Built-in Memcached technology
High throughput
• Multi-threaded
• Low lock contention
• Asynchronous wherever possible
• Automatic write de-duplication
Membase is Simple, Fast, Elastic
7
Zero-downtime elasticity
• Spread I/O and data across commodity
servers (or VMs)
• Consistent performance with linear cost
• Dynamic rebalancing of a live cluster
All nodes are created equal
• No special case nodes
• Any node can replace any other node, online
• Clone to grow
Extensible
• Filtered TAP interface provides hook points
for external systems (e.g. full-text search,
backup, warehouse)
• Data bucket – engine API for specialized
container types
Built-in Memcached Caching Layer
8
Memcached
Membase Database
Membase Cache
Membase Database
Memcached Mode Membase Mode
Fact: Membase development team has also contributed over
half of the code to the Memcached project.
Use Cases
Leading cloud service (PAAS)
provider
Over 65,000 hosted
applications
Membase Server serving over
1,200 Heroku customers (as of
June 10, 2010)
Deployments Leading Membase
10
Social game leader – FarmVille,
Mafia Wars, Café World
Over 230 million monthly users
Membase Server
is the 500,000 ops-per-second
database behind FarmVille and
Café World
Ad targeting
11
events
profiles, campaigns
profiles, real time campaign
statistics
40 milliseconds to come
up with an answer.
2
3
1
Search and Gaming Portal
12
Database
Membase Architecture
Clustering
• Underlying cluster
functionality based on
erlang OTP
• Have a custom, vector
clock based way of storing
and propagating...
– Cluster topology
– vBucket mapping
• Collect statistics from many
nodes of the cluster
– Identify hot keys, resource
utilization
14
Membase East Coast Meetups
TAP
• A generic, scalable method of streaming mutations
from a given server
– As data operations arrive, they can be sent to arbitrary TAP
receivers
• Leverages the existing memcached engine interface,
and the non-blocking IO interfaces to send data
• Three modes of operation
Working set
Data
Mutations
Working set
Data
Mutations
Working set
16
Membase data flow – under the hood
17
SET request arrives at
KEY’s master server
Listener-Sender
Master server for KEY Replica Server 2 for KEYReplica Server 1 for KEY
3 3
1
SET acknowledgement
returned to application2
DiskDisk Disk
RAM
membasestorageengine
DiskDisk Disk
4
ns_server
membase
(memcached + membase engine)
moxi ns_server
vbucketmigrator
TAP
memcached operations
with tap commands
memcached operations
Client
port 11211
memcached operations
moxi + Client
port 11210
memcached operations REST/comet
cluster topology
and vbucket map
Clients, nodes and other nodes
18
Data buckets are secure membase “slices”
19
Membase data servers
In the data center
Web application server
Application user
On the administrator console
Bucket 1
Bucket 2
Aggregate Cluster Memory and Disk Capacity
vBucket mapping
20
Disk > Memory
BucketConfiguration
mem_high_wat
mem_low_wat
memory quota
21
Dataset may have many
items infrequently accessed.
However, memcached has
different behavior (LRU) than
wanted with membase.
Still, traditional (most)
RDBMS implementations are
not 100% correct for us
either. The speed of a miss
is very, very important.
Membase Demo
23
Thanks!
Key-Value Patterns
Key-Value
Image courtesy http://www.flickr.com/photos/brenda-starr/3509344100/sizes/m/in/photostream/
(with a replica )
25
Items have:
Key
Value
Expiration
Flags
CAS (more on this later)
Operations include:
Get/Set
Increment/Decrement
Append/Prepend
Membase Datatypes
• byte[]
– Does your data have
1s and 0s?
26
“Any customer can have
a car painted any colour
that he wants so long as
it is black.”
• Items do have flags
– Many clients use flags
–Data type options
• Google protobuf
• Thrift
• Avro
Transactions
• Lock == slow me down
• CAS operations
– Optimistic locking
• Very useful with complex
datatypes
– Imagine two clients trying to
update a complex item
• You’re likely using CAS
already... if you use a CPU
27
User 1
Fail!
User 2
Success
Common Use: Sessions
• Web user sessions
– Highly read, less writes in many case
– Protocol advantage of memcached
• Options already for PHP, Ruby and Java
• Application state
– Not necessarily “entity” style things
– May be appropriate for a “cache” pool
28
Common Use (cache): Rate Limiting
• Want to provide API calls
into the system
– Twitter search
– Google search services
• Use the atomic increment
– Set an item with a unique ID
– Upon API request,
increment and check
• HTTP 420: go away and come
back later
29
Your Users
Your App
¡Ouch!
Looking Ahead: NodeCode
Frank Weigel, Membase
Beyond key-value
• Indexing/Range Queries
• Advanced Data Structures
• Sub-object direct manipulation
Validation and In-flight transformation
• Block mutations failing validation
• Enrich or transform objects
Connectors (Integrate easily with other systems)
• Solr
• Hadoop
• MySQL
NodeCode – Motivation
31
NodeCode - What is it?
Method for extending & customizing Membase
Separate code modules
Defined interface to datapath and cluster manager
Notification on events
• Synchronous
• Asynchronous
32
Simple
• Packaged modules for easy install and enable
• Library of “off the shelf” modules
• Module monitoring
• Straight forward development and debugging
Fast
• Low latency/high-throughput
• Per-bucket process isolation
• Don’t break data manager performance/correctness
Elastic
• Automatically migrate and instantiate on rebalance
• Provide support for migration of internal data
• Leverage native Membase engine for internal data storage
NodeCode – Drivers
33
Block-level architecture
34
Java only
– jar format
Must implement minimal module API
• Initial module startup
• Module removal
• Association with bucket
NodeCode library helper functions
• Register synchronous & asynchronous listeners/callbacks
• Register protocol extension/callbacks
• Register rebalance callback
• Register cluster manager event callbacks
• Membase data access
NodeCode 1.0 Plans
35
Membase East Coast Meetups
37
Q&A
Attributions
• http://commons.wikimedia.org/wiki/
File:Flag_of_China.png
• http://commons.wikimedia.org/wiki/
File:Flag_of_South_Korea.svg
• http://commons.wikimedia.org/wiki/
File:Flag_of_Japan.svg
38
Membase East Coast Meetups

More Related Content

PDF
Membase Intro from Membase Meetup San Francisco
PDF
Membase Introduction
PDF
Couchbase@live person meetup july 22nd
PDF
Node.js and couchbase Full Stack JSON - Munich NoSQL
PDF
Security Best Practices for your Postgres Deployment
PPTX
Introduction to Kafka
PDF
Devoxx Morocco 2016 - Microservices with Kafka
PDF
Oops! I started a broker | Yinon Kahta, Taboola
Membase Intro from Membase Meetup San Francisco
Membase Introduction
Couchbase@live person meetup july 22nd
Node.js and couchbase Full Stack JSON - Munich NoSQL
Security Best Practices for your Postgres Deployment
Introduction to Kafka
Devoxx Morocco 2016 - Microservices with Kafka
Oops! I started a broker | Yinon Kahta, Taboola

What's hot (20)

PDF
Hello, kafka! (an introduction to apache kafka)
PPTX
Apache Pulsar First Overview
PPTX
Spark streaming with apache kafka
PPT
Zing Database – Distributed Key-Value Database
PDF
Apache pulsar - storage architecture
PPTX
Modern Distributed Messaging and RPC
PDF
Pulsar - flexible pub-sub for internet scale
PDF
Introduction to Apache BookKeeper Distributed Storage
PDF
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
PPTX
Apache Kafka Best Practices
PPTX
Kafka Connect - debezium
PDF
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
PDF
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field
PDF
ksqlDB: A Stream-Relational Database System
PPTX
Change Data Capture using Kafka
PDF
Kafka as Message Broker
PPTX
Kafka blr-meetup-presentation - Kafka internals
PDF
Sharing is Caring: Toward Creating Self-tuning Multi-tenant Kafka (Anna Povzn...
PPTX
Introduction to Apache Kafka
PPTX
Copy of Kafka-Camus
Hello, kafka! (an introduction to apache kafka)
Apache Pulsar First Overview
Spark streaming with apache kafka
Zing Database – Distributed Key-Value Database
Apache pulsar - storage architecture
Modern Distributed Messaging and RPC
Pulsar - flexible pub-sub for internet scale
Introduction to Apache BookKeeper Distributed Storage
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
Apache Kafka Best Practices
Kafka Connect - debezium
FOSSASIA 2016 - 7 Tips to design web centric high-performance applications
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field
ksqlDB: A Stream-Relational Database System
Change Data Capture using Kafka
Kafka as Message Broker
Kafka blr-meetup-presentation - Kafka internals
Sharing is Caring: Toward Creating Self-tuning Multi-tenant Kafka (Anna Povzn...
Introduction to Apache Kafka
Copy of Kafka-Camus
Ad

Viewers also liked (8)

PDF
Labegunak SEO aurkezpena
PPTX
Membase Meetup 2010
PPT
Ms mustapha biology
PPT
Ms mustapha biology
PDF
Membase Meetup - San Diego
PPTX
Membase Meetup - Silicon Valley
PDF
Membase Meetup Chicago - january 2011
Labegunak SEO aurkezpena
Membase Meetup 2010
Ms mustapha biology
Ms mustapha biology
Membase Meetup - San Diego
Membase Meetup - Silicon Valley
Membase Meetup Chicago - january 2011
Ad

Similar to Membase East Coast Meetups (20)

PDF
Architecture Patterns - Open Discussion
PPTX
Realtime traffic analyser
PDF
A Closer Look at Apache Kudu
PDF
Fixing twitter
PDF
Fixing_Twitter
PDF
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
PDF
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
PDF
Hpc lunch and learn
PPTX
Maria DB Galera Cluster for High Availability
PPTX
MariaDB Galera Cluster
KEY
Introduction to memcached
PDF
John adams talk cloudy
PPTX
Couchbase Connect 2016
PPTX
MySQL Options in OpenStack
PPTX
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
PPTX
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
PDF
OpenStack Days East -- MySQL Options in OpenStack
PPTX
Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013
PDF
Introduction to Apache Mesos and DC/OS
PPTX
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"
Architecture Patterns - Open Discussion
Realtime traffic analyser
A Closer Look at Apache Kudu
Fixing twitter
Fixing_Twitter
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Hpc lunch and learn
Maria DB Galera Cluster for High Availability
MariaDB Galera Cluster
Introduction to memcached
John adams talk cloudy
Couchbase Connect 2016
MySQL Options in OpenStack
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
OpenStack Days East -- MySQL Options in OpenStack
Kafka 0.8.0 Presentation to Atlanta Java User's Group March 2013
Introduction to Apache Mesos and DC/OS
Sergey Dzyuban "To Build My Own Cloud with Blackjack…"

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
A Presentation on Artificial Intelligence
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Monthly Chronicles - July 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...

Membase East Coast Meetups

  • 2. Tonight 2 • Membase Overview • Use Cases and Deployment Examples • Membase Architecture • Demo! • Developing with Membase • A Glimpse into the Future
  • 4. Membase is a distributed database 4 Membase Servers In the data center Web application server Application user On the administrator console Web application serverWeb application server
  • 5. Five minutes or less to a working cluster • Downloads for Linux and Windows • Start with a single node • One button press joins nodes to a cluster Easy to develop against • Just SET and GET – no schema required • Drop it in. 10,000+ existing applications already “speak membase” (via memcached) • Practically every language and application framework is supported, out of the box Easy to manage • One-click failover and cluster rebalancing • Graphical and programmatic interfaces • Configurable alerting Membase is Simple, Fast, Elastic 5
  • 6. Membase is Simple, Fast, Elastic 6 Predictable • “Never keep an application waiting” • Quasi-deterministic latency and throughput Low latency • Built-in Memcached technology High throughput • Multi-threaded • Low lock contention • Asynchronous wherever possible • Automatic write de-duplication
  • 7. Membase is Simple, Fast, Elastic 7 Zero-downtime elasticity • Spread I/O and data across commodity servers (or VMs) • Consistent performance with linear cost • Dynamic rebalancing of a live cluster All nodes are created equal • No special case nodes • Any node can replace any other node, online • Clone to grow Extensible • Filtered TAP interface provides hook points for external systems (e.g. full-text search, backup, warehouse) • Data bucket – engine API for specialized container types
  • 8. Built-in Memcached Caching Layer 8 Memcached Membase Database Membase Cache Membase Database Memcached Mode Membase Mode Fact: Membase development team has also contributed over half of the code to the Memcached project.
  • 10. Leading cloud service (PAAS) provider Over 65,000 hosted applications Membase Server serving over 1,200 Heroku customers (as of June 10, 2010) Deployments Leading Membase 10 Social game leader – FarmVille, Mafia Wars, Café World Over 230 million monthly users Membase Server is the 500,000 ops-per-second database behind FarmVille and Café World
  • 11. Ad targeting 11 events profiles, campaigns profiles, real time campaign statistics 40 milliseconds to come up with an answer. 2 3 1
  • 12. Search and Gaming Portal 12 Database
  • 14. Clustering • Underlying cluster functionality based on erlang OTP • Have a custom, vector clock based way of storing and propagating... – Cluster topology – vBucket mapping • Collect statistics from many nodes of the cluster – Identify hot keys, resource utilization 14
  • 16. TAP • A generic, scalable method of streaming mutations from a given server – As data operations arrive, they can be sent to arbitrary TAP receivers • Leverages the existing memcached engine interface, and the non-blocking IO interfaces to send data • Three modes of operation Working set Data Mutations Working set Data Mutations Working set 16
  • 17. Membase data flow – under the hood 17 SET request arrives at KEY’s master server Listener-Sender Master server for KEY Replica Server 2 for KEYReplica Server 1 for KEY 3 3 1 SET acknowledgement returned to application2 DiskDisk Disk RAM membasestorageengine DiskDisk Disk 4
  • 18. ns_server membase (memcached + membase engine) moxi ns_server vbucketmigrator TAP memcached operations with tap commands memcached operations Client port 11211 memcached operations moxi + Client port 11210 memcached operations REST/comet cluster topology and vbucket map Clients, nodes and other nodes 18
  • 19. Data buckets are secure membase “slices” 19 Membase data servers In the data center Web application server Application user On the administrator console Bucket 1 Bucket 2 Aggregate Cluster Memory and Disk Capacity
  • 21. Disk > Memory BucketConfiguration mem_high_wat mem_low_wat memory quota 21 Dataset may have many items infrequently accessed. However, memcached has different behavior (LRU) than wanted with membase. Still, traditional (most) RDBMS implementations are not 100% correct for us either. The speed of a miss is very, very important.
  • 25. Key-Value Image courtesy http://www.flickr.com/photos/brenda-starr/3509344100/sizes/m/in/photostream/ (with a replica ) 25 Items have: Key Value Expiration Flags CAS (more on this later) Operations include: Get/Set Increment/Decrement Append/Prepend
  • 26. Membase Datatypes • byte[] – Does your data have 1s and 0s? 26 “Any customer can have a car painted any colour that he wants so long as it is black.” • Items do have flags – Many clients use flags –Data type options • Google protobuf • Thrift • Avro
  • 27. Transactions • Lock == slow me down • CAS operations – Optimistic locking • Very useful with complex datatypes – Imagine two clients trying to update a complex item • You’re likely using CAS already... if you use a CPU 27 User 1 Fail! User 2 Success
  • 28. Common Use: Sessions • Web user sessions – Highly read, less writes in many case – Protocol advantage of memcached • Options already for PHP, Ruby and Java • Application state – Not necessarily “entity” style things – May be appropriate for a “cache” pool 28
  • 29. Common Use (cache): Rate Limiting • Want to provide API calls into the system – Twitter search – Google search services • Use the atomic increment – Set an item with a unique ID – Upon API request, increment and check • HTTP 420: go away and come back later 29 Your Users Your App ¡Ouch!
  • 30. Looking Ahead: NodeCode Frank Weigel, Membase
  • 31. Beyond key-value • Indexing/Range Queries • Advanced Data Structures • Sub-object direct manipulation Validation and In-flight transformation • Block mutations failing validation • Enrich or transform objects Connectors (Integrate easily with other systems) • Solr • Hadoop • MySQL NodeCode – Motivation 31
  • 32. NodeCode - What is it? Method for extending & customizing Membase Separate code modules Defined interface to datapath and cluster manager Notification on events • Synchronous • Asynchronous 32
  • 33. Simple • Packaged modules for easy install and enable • Library of “off the shelf” modules • Module monitoring • Straight forward development and debugging Fast • Low latency/high-throughput • Per-bucket process isolation • Don’t break data manager performance/correctness Elastic • Automatically migrate and instantiate on rebalance • Provide support for migration of internal data • Leverage native Membase engine for internal data storage NodeCode – Drivers 33
  • 35. Java only – jar format Must implement minimal module API • Initial module startup • Module removal • Association with bucket NodeCode library helper functions • Register synchronous & asynchronous listeners/callbacks • Register protocol extension/callbacks • Register rebalance callback • Register cluster manager event callbacks • Membase data access NodeCode 1.0 Plans 35