720 likes | 1.38k Views
Introduction to NoSQL with Couchbase Server. About the Speakers. Senior Architects @ Sela Group Authors of “Pro Couchbase Server” and others Big Data and NoSQL nerds. @ DavidOstrovsky @ YRodenski. A brief history of data. Relational Databases. Normalized A tomic C onsistent
E N D
Introduction to NoSQL with Couchbase Server #devconnections
About the Speakers Senior Architects @ SelaGroup Authors of “Pro Couchbase Server” and others Big Data and NoSQL nerds @DavidOstrovsky @YRodenski #devconnections
A brief history of data #devconnections
Relational Databases Normalized Atomic Consistent Isolated Durable • Vertical Scaling • Inflexible Schema #devconnections
All your BASE are belong to us. • BASE • Basically Available • Soft state • Eventual consistency Welcome to the wonderful world of NoSQL!
The CAP conjecture A vailability Pick Two C P artition Tolerance onsistency
Documents, and objects and graphs, oh my… Graph Document Column Key-Value Memcached Couchbase Neo4j Google BigTable RavenDB GraphBase #devconnections
A little history… • Couchbase Server originates from: • Membase - a distributed in-memory cache • Apache CouchDB – a document database #devconnections
So what does it do? • Stores documents in JSON format • Caches documents in memory • Indexes document contents • Automatically shards data • Stores multiple replicas for resilience #devconnections
When should I use it? • High performance requirements • High Throughput • Low latency • Scalability • High availability • Developer friendliness • Flexible schema • Simple CRUD and secondary indexes #devconnections
get("Doc 13") Client Node 1 Node 2 Node 3 Bucket1 Bucket1 Bucket1 Cluster Map vBucket 1 vBucket 2 vBucket 3 Doc 1 Doc 7 Doc 13 Active vBucket 2 vBucket 1 Doc 7 Doc 1 Replica vBucket 3 Doc 13 #devconnections
How do I connect? • Official Client SDKs: • Java, .NET, C, PHP, Python, Ruby and Node.js • Community Client SDKs: • Go, Clojure, Erland, Perl, TCL #devconnections
Tables? We don’t need no tables! { "name": "John", "age": 35, "address": { "city": "New York", "street": "…" } } #devconnections
Working with documents • Access documents by key • Key-based operations are very fast • Sub-millisecond responses • Documents are stored in memory, then written to disk asynchronously • Normally, documents are retrieved from the memory cache #devconnections
CRUD • All operations are exposed by the Couchbase client object instance. • Add/Set:store a document in the database • Get: retrieve a document by key • Replace: update an existing document #devconnections
Demo Time! Key-based operations #devconnections
What about transactions? • Concurrency through Check-and-Setoperations • “CAS” value stored with each item, updated with every change • Optimistic concurrency: compare client and server CAS values • Pessimistic concurrency: lock the key exclusively for a specific session #devconnections
Dude, where is my document? • In addition to keys (primary index), Couchbase supports secondary indexes, called Views. • Unlike key-based operations, which are served from memory, views are served from disk. • File system caches disk reads. #devconnections
Demo Time, Again! A different view
N1QL – How do you even pronounce that? • N1QL (aka “Nickel”) - an SQL-like query language for Couchbase • Expanded SQL syntax to account for nested documents, arrays, and cross-bucket joins • Currently in developer preview, coming in a future version #devconnections
More Demo Time! Was that SQL I just saw? #devconnections
Great, what else you got? • Cross-Datacenter Replication (XDCR) • CouchbaseLite (Mobile) • A NoSQL database for mobile apps • Can synchronize with CouchbaseServer • ElasticSearch • Use ES for querying and Couchbase for retrieval • Hadoop • Use sqoop to move data between CB and Hadoop #devconnections
Use case: real-time data analytics • Couchbase: primary data store • ElasticSearch: indexes part of the data • Kibana: displays real-time analytics #devconnections
So Many Demos! Everything is better with pie charts. #devconnections
Summary • NoSQL brings a different and fun approach to data storage • Couchbase Server is a document database • Scalable, fast and simple to use • Ties into a whole ecosystem of big data solutions #devconnections
Rate with Mobile App: Rate This Session Now! Tell Us What You Thought of This Session Select the session from the Agenda or Speakers menus Select the Actions tab Click Rate Session Be Entered to WIN Prizes! Rate Using Our Website: Register at www.devconnections.com/logintoratesession Go to www.devconnections.com/ratesession Select this session from the list and rate it