BarcelonaJS / April 4th, 2013 Couchbase & Javascript MapReduce, Node.js, Angular Tugdual “Tug” Grall Technical Evangelist BarcelonaJS / April 4th, 2013.

Slides:



Advertisements
Similar presentations
Database Architectures and the Web
Advertisements

My first computer: The Apple ][ It wanted to be programmed.
NoSQL, No SQL!!, No, SQL? Raj Nair, Penton. Variety is the spice of life Key-Value stores Document stores ColumnFam ily Graph Hybrid Spice can lead to.
Technical Evangelist Tugdual “Tug” Grall BigData - NoSQL Hadoop - Couchbase.
Microsoft Ignite /16/2017 2:42 PM
Introduction to Backend James Kahng. Install Node.js.
GGF Toronto Spitfire A Relational DB Service for the Grid Peter Z. Kunszt European DataGrid Data Management CERN Database Group.
Chapter 14 The Second Component: The Database.
Presentation by Krishna
NoSQL and NewSQL Justin DeBrabant CIS Advanced Systems - Fall 2013.
Nikolay Tomitov Technical Trainer SoftAcad.bg.  What are Amazon Web services (AWS) ?  What’s cool when developing with AWS ?  Architecture of AWS 
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo How to Scale a Database System.
An introduction to MongoDB Rácz Gábor ELTE IK, febr. 10.
Platform as a Service (PaaS)
Google AppEngine. Google App Engine enables you to build and host web apps on the same systems that power Google applications. App Engine offers fast.
1 Yasin N. Silva Arizona State University This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
How WebMD Maintains Operational Flexibility with NoSQL Rajeev Borborah, Sr. Director, Engineering Matt Wilson – Director, Production Engineering – Consumer.
1 The Google File System Reporter: You-Wei Zhang.
Introduction à Couchbase Server 2.0 Tugdual Grall
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
:: Conférence :: NoSQL / Scalabilite Etat de l’art Samuel BERTHE10 Mars 2014Epitech Nantes.
HBase A column-centered database 1. Overview An Apache project Influenced by Google’s BigTable Built on Hadoop ▫A distributed file system ▫Supports Map-Reduce.
Panagiotis Antonopoulos Microsoft Corp Ioannis Konstantinou National Technical University of Athens Dimitrios Tsoumakos.
WTT Workshop de Tendências Tecnológicas 2014
Meet with the AppEngine Márk Gergely eu.edge. What is AppEngine? It’s a tool, that lets you run your web applications on Google's infrastructure. –Google's.
Goodbye rows and tables, hello documents and collections.
Hadoop/MapReduce Computing Paradigm 1 Shirish Agale.
Moohanad Hassan Maedeh Pishvaei. Introduction Open Source Apache foundation project Relational DB: SQL Server CouchDB : JSON document-oriented DB (NoSQL)
IMDGs An essential part of your architecture. About me
 70s - Database access is hard and depends on the app  80s – Relational databases come on the scene  90s – Object oriented programming and DBs  00s.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
MySQL to NoSQL Data Modeling Challenges in Supporting Scalability ΧΑΡΟΚΟΠΕΙΟ ΠΑΝΕΠΙΣΤΗΜΙΟ - ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΚΑΙ ΤΗΛΕΜΑΤΙΚΗΣ ΠΜΣ "Πληροφορική και Τηλεματική“
App Dev with Documents, their Schemas and Relationships Tugdual Grall Technical Evangelist.
MapReduce and GFS. Introduction r To understand Google’s file system let us look at the sort of processing that needs to be done r We will look at MapReduce.
A FIRST TOUCH ON NOSQL SERVERS: COUCHDB GENOVEVA VARGAS SOLAR, JAVIER ESPINOSA CNRS, LIG-LAFMIA, FRANCE
3-Tier Architecture Chandrasekaran Rajagopalan Cs /01/99.
GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based.
NOSQL Implementation and examples Maciej Matuszewski.
CS525: Big Data Analytics MapReduce Computing Paradigm & Apache Hadoop Open Source Fall 2013 Elke A. Rundensteiner 1.
Clusterpoint Margarita Sudņika ms RDBMS & NoSQL Databases & tables → Document stores Columns, rows → Schemaless documents Scales UP → Scales UP.
Dynamo: Amazon’s Highly Available Key-value Store DAAS – Database as a service.
NoSQL Or Peles. What is NoSQL A collection of various technologies meant to work around RDBMS limitations (mostly performance) Not much of a definition...
NoSQL Systems Motivation. NoSQL: The Name  “SQL” = Traditional relational DBMS  Recognition over past decade or so: Not every data management/analysis.
HDB++: High Availability with
Mick Badran Using Microsoft Service Fabric to build your next Solution with zero downtime – Lvl 300 CLD32 5.
Introduction to MongoDB. Database compared.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
1 HBASE – THE SCALABLE DATA STORE An Introduction to HBase XLDB Europe Workshop 2013: CERN, Geneva James Kinley EMEA Solutions Architect, Cloudera.
The Google File System Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung Presenter: Chao-Han Tsai (Some slides adapted from the Google’s series lectures)
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
BIG DATA/ Hadoop Interview Questions.
1 Gaurav Kohli Xebia Breaking with DBMS and Dating with Relational Hbase.
Platform as a Service (PaaS)
Platform as a Service (PaaS)
BigData - NoSQL Hadoop - Couchbase
Platform as a Service (PaaS)
CS122B: Projects in Databases and Web Applications Winter 2017
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Open Source distributed document DB for an enterprise
Couchbase Server is a NoSQL Database with a SQL-Based Query Language
Introduction to NewSQL
The Improvement of PaaS Platform ZENG Shu-Qing, Xu Jie-Bin 2010 First International Conference on Networking and Distributed Computing SQUARE.
Designed for Big Data Visual Analytics, Zoomdata Allows Business Users to Quickly Connect, Stream, and Visualize Data in the Microsoft Azure Platform MICROSOFT.
Lecture 1: Multi-tier Architecture Overview
Overview of big data tools
CSE 482 Lecture 5: NoSQL.
THE GOOGLE FILE SYSTEM.
CloudAnt: Database as a Service (DBaaS)
NoSQL & Document Stores
NoSQL databases An introduction and comparison between Mongodb and Mysql document store.
Presentation transcript:

BarcelonaJS / April 4th, 2013 Couchbase & Javascript MapReduce, Node.js, Angular Tugdual “Tug” Grall Technical Evangelist BarcelonaJS / April 4th, 2013

Tugdual “Tug” Grall ­Couchbase Technical Evangelist ­eXo CTO ­Oracle Developer/Product Manager Mainly Java/SOA ­Developer in consulting firms tgrall NantesJUG co-founder Pet Project :

BarcelonaJS / April 4th, / /6 Draw Something by OMGPOP Daily Active Users (millions)

BarcelonaJS / April 4th, 2013 RDBMS is good for many thing, but hard to scale RDBMS Scales Up Get a bigger, more complex server Users Application Scales Out Just add more commodity web servers Users System Cost Application Performance Relational Database Web/App Server Tier System Cost Application Performance Won’t scale beyond this point How do you take the growth?

BarcelonaJS / April 4th, 2013 Scaling out flattens the cost and performance curves NoSQL Database Scales Out Cost and performance mirrors app tier Users NoSQL Distributed Data Store Web/App Server Tier Application Scales Out Just add more commodity web servers Users System Cost Application Performance System Cost NoSQL Technology Scales Out

BarcelonaJS / April 4th, 2013 Dynamo October 2007 Cassandra August 2008 Bigtable November 2006 Voldemort February 2009 Very few organizations want to (fewer can) build and maintain database software technology. But every organization building interactive web applications needs this technology. Very few organizations want to (fewer can) build and maintain database software technology. But every organization building interactive web applications needs this technology. A new technology? Building new database to answer the following requirements ­No schema required before inserting data ­No schema change required to change data format ­Auto-sharding without application participation ­Distributed queries ­Integrated main memory caching ­Data synchronization ( multi-datacenter)

BarcelonaJS / April 4th, 2013 Lack of flexibility/ rigid schemas Inability to scale out data Performance challengesCostAll of theseOther 49 % 35 % 29 % 16 % 12 % 11 % Source: Couchbase Survey, December 2011, n = What is driving NoSQL adoption?

Couchbase Open Source Project Leading NoSQL database project focused on distributed database technology and surrounding ecosystem Supports both key-value and document-oriented use cases All components are available under the Apache 2.0 Public License Obtained as packaged software in both enterprise and community editions. Couchbase Open Source Project

BarcelonaJS / April 4th, 2013 Easy Scalability Consistent High Performance Always On 24x365 Grow cluster without application changes, without downtime with a single click Consistent sub-millisecond read and write response times with consistent high throughput No downtime for software upgrades, hardware maintenance, etc. Flexible Data Model JSON document model with no fixed schema. Couchbase Server Core Principles

BarcelonaJS / April 4th, 2013 Heartbeat Process monitor Global singleton supervisor Configuration manager on each node Rebalance orchestrator Node health monitor one per cluster vBucket state and replication manager http REST management API/Web UI HTTP 8091 Erlang port mapper 4369 Distributed Erlang Erlang/OTP storage interface Couchbase EP Engine Memcapable 2.0 Moxi Memcapable 1.0 Memcached New Persistence Layer 8092 Query API Query Engine Data ManagerCluster Manager Couchbase Server 2.0 Architecture

BarcelonaJS / April 4th, 2013 New Persistence Layer storage interface Couchbase EP Engine Memcapable 2.0 Moxi Memcapable 1.0 Object-level Cache Disk Persistence 8092 Query API Query Engine HTTP 8091 Erlang port mapper 4369 Distributed Erlang Heartbeat Process monitor Global singleton supervisor Configuration manager on each node Rebalance orchestrator Node health monitor one per cluster vBucket state and replication manager http REST management API/Web UI Erlang/OTP Server/Cluster Management & Communication (Erlang) RAM Cache, Indexing & Persistence Management (C & V8) The Unreasonable Effectiveness of C by Damien Katz Couchbase Server 2.0 Architecture

BarcelonaJS / April 4th, Open Source Project Apache 2.0

BarcelonaJS / April 4th, 2013 WHAT ABOUT MY APP?

BarcelonaJS / April 4th, Clojure Python Ruby libcouchbase Go Couchbase SDK

BarcelonaJS / April 4th, Managed Cache Disk Queue Disk Replication Queue App Server Couchbase Server Node Doc 1 To other node Write Operation

BarcelonaJS / April 4th, 2013 COUCHBASE SERVER CLUSTER Docs distributed evenly across servers Each server stores both active and replica docs Only one doc active at a time 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 Multiple app servers can access same document at same time READ/WRITE/UPDATE ACTIVE Doc 5Doc 2 Doc SERVER 1 ACTIVE Doc 4Doc 7 Doc SERVER 2 Doc 8 ACTIVE Doc 1Doc 2 Doc REPLICA Doc 4 Doc 1 Doc 8 Doc REPLICA Doc 6 Doc 3 Doc 2 Doc REPLICA Doc 7 Doc 9 Doc 5 Doc SERVER 3 Doc 6 APP SERVER 1 COUCHBASE Client Library CLUSTER MAP COUCHBASE Client Library CLUSTER MAP APP SERVER 2 Doc 9 Basic Operations

BarcelonaJS / April 4th, 2013 get (key) ­ Retrieve a document set (key, value) ­ Store a document, overwrites if exists add (key, value) ­ Store a document, error/exception if exists replace (key, value) ­ Store a document, error/exception if doesn’t exist cas (key, value, cas) ­ Compare and swap, mutate document only if it hasn’t changed while executing this operation Store & Retrieve Operations

BarcelonaJS / April 4th, 2013 These operations are always executed in order atomically. set (key, value) ­ Use set to initialize the counter cb.set(“my_counter”, 1) incr (key) ­ Increase an atomic counter value, default by 1 cb.incr(“my_counter”) # now it’s 2 decr (key) ­ Decrease an atomic counter value, default by 1 cb.decr(“my_counter”) # now it’s 1 Atomic Counter Operations

BarcelonaJS / April 4th, 2013 In SQL we tend to want to avoid hitting the database as much as possible ­ Even with caching and indexing tricks, and massive improvements over the years, SQL still gets bogged down by complex joins and huge indexes, so we avoid making database calls In Couchbase, get’s and set’s are so fast they are trivial, not bottlenecks, this is hard for many people to accept at first; Multiple get statements are commonplace, don’t avoid it! Mental Adjustments

BarcelonaJS / April 4th, 2013 Operations with Node

BarcelonaJS / April 4th, 2013 NPM { "name": "my-node-application", "version": "1.0.0", "private": true, "dependencies": { "express": "3.x", "couchbase": "0.0.11", "ejs": ">= 0.0.1" }

BarcelonaJS / April 4th, 2013 Connect to the cluster var driver = require('couchbase'); dbConfiguration = { "hosts": ["localhost:8091"], "bucket": "ideas" }; driver.connect(dbConfiguration, function(err, cb) { if (err) { throw (err) } // your application code here }

BarcelonaJS / April 4th, 2013 Insert Data var meetup = {"type" : "meetup", "language" : "javascript"}; cb.set("barcelonajs",meetup, function(err, meta) {}); var tmp = {"message" : "hello world!"}; cb.set("tmp", tmp, {"expiry" : 5},function(err, meta) {});

BarcelonaJS / April 4th, 2013 Insert / Delete Data var meetup = {"type" : "meetup", "language" : "javascript"}; cb.set("barcelonajs",meetup, function(err, meta) {}); var tmp = {"message" : "hello world!"}; cb.set("tmp", tmp, {"expiry" : 5},function(err, meta) {}); cb.set("todelete", tmp, function(err, meta) {}); cb.remove("todelete", function(err, meta) {});

BarcelonaJS / April 4th, 2013 Retrieve the Data cb.get("product:45", function(errs, doc, metas) {console.log("=== get the document ===");console.log( doc );});var keys = new Array(); keys.push("product:1");keys.push("product:45");keys.push("product:65"); keys.push("product:80");cb.get(keys, null, function(errs, docs, metas) { console.log("\n=== get List of documents ===");console.log( docs );});

BarcelonaJS / April 4th, 2013 Retrieve the Data What if I want all products or meetups? key : barcelonajs { "type": "meetup", "language": "javascript"} key : product:10 { "type": "product", "name": "Product with id 10"}

BarcelonaJS / April 4th, 2013 Calling a view from your app var queryParams = { stale: false, key : "meetup" }; cb.view("my_views", "by_type", queryParams, function(err, view) { var keys = new Array(); for (var i = 0; i < view.length; i++) { keys.push(view[i].id); } cb.get(keys, null, function(errs, docs, metas) { console.log(docs); });

BarcelonaJS / April 4th, 2013 Indexing and Querying Define materialized views on JSON documents and then query across the data set Using views you can define ­Primary indexes ­Simple secondary indexes (most common use case) ­Complex secondary, tertiary and composite indexes ­Aggregations (reduction) Indexes are eventually indexed Queries are eventually consistent with respect to documents Built using Map/Reduce technology ­Map and Reduce functions are written in Javascript

BarcelonaJS / April 4th, 2013 Map Function

BarcelonaJS / April 4th, 2013 Q&A