full stack development with node.js and nosql by nic raboy

19

Click here to load reader

Upload: heather-moore

Post on 24-Jan-2018

278 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Full Stack Development with Node.js and NoSQL by Nic Raboy

Full Stack Development with Node.js and NoSQL

Nic Raboy (@nraboy)

Page 2: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 2

The Role of a Full Stack Developer

Page 3: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 3

Application Stacks

Page 4: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 4

The Power of the Flexible JSON Schema

• Ability to store data in multiple ways

• De-normalized single document, as opposed to normalizing data across multiple table

• Dynamic Schema to add new values when needed

Page 5: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 5

What is Couchbase?

Couchbase is a distributed operational database that enables you to develop with agility and operate at any scale.

Managed Cache Key-Value Store Document Database Embedded Database Sync Management

Page 6: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 6

Develop with Agility

Easier, Faster Development Flexible Data Modeling Powerful Querying

SQL Integration & Migration Big Data Integration Mobile / IoT

Page 7: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 7

Operate at Any Scale

Elastic Scalability Consistent High Performance Always-on Availability

Multi-Data Center Deployment Simple, Powerful Administration Enterprise Grade Security

Page 8: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 8

Couchbase Developer

Page 9: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 9

Couchbase Server – Single Node Type

▪ Data Service – builds and maintains local view indexes

▪ Indexing Engine – builds and maintains Global Secondary Indexes

▪ Query Engine – plans, coordinates, and executes queries against either Global or Local view indexes

▪ Cluster Manager – configuration, heartbeat, statistics, RESTful Management interface

Page 10: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 10

Simplified Administration

• Online upgrades and operations• Built-in enterprise class Admin Console• RESTful APIs

Page 11: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 11

Accessing Data From Couchbase

Key access using Document ID

• Operations are extremely fast with consistent low latency

• Reads and writes are evenly distributed across Data Service nodes

• Data is cached in built-in Managed Caching layer and stored in persistent storage layer

Queries using N1QL

• SQL-like : SELECT * FROM WHERE, LIKE, GROUP, etc.,

• JOINs

• Powerful Extensions (nest, unnest) for JSON to support nested and hierarchical data structures.

• Multiple access paths – Views and global secondary indexes

• ODBC/JDBC drivers available

Views using static queries

• Pre-computed complex Map-Reduce queries

• Incrementally updated to power analytics, reporting and dashboards

• Strong for complex custom aggregations

Page 12: Full Stack Development with Node.js and NoSQL by Nic Raboy

Demo Time!

Page 13: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 13

Node.js Sample Applications

https://github.com/couchbaselabs/try-cb-nodejs

https://github.com/couchbaselabs/restful-angularjs-nodejs

Page 14: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 14

Couchbase N1QL Tutorial

http://query.pub.couchbase.com/tutorial/

Page 15: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 15

Ottoman ODM

Page 16: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 16

Ottoman Model

var RecordModel = ottoman.model("Record", { firstname: {type: "string”}, lastname: {type: "string"}, email: {type: "string"}, created_at: {type: “Date”, default: Date.now}});

Page 17: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 17

Ottoman Saving

var myRecord = new RecordModel({ firstname: “Nic”, lastname: “Raboy”, email: “[email protected]”});

myRecord.save(function(error) { if(error) { // Error here } // Success here});

Page 18: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 18

Ottoman Finding

RecordModel.find({}, function(error, result) { if(error) { // Error here } // Array of results here});

Page 19: Full Stack Development with Node.js and NoSQL by Nic Raboy

©2015 Couchbase Inc. 19

Where do you find us?

• developer.couchbase.com• blog.couchbase.com• @couchbasedev or @couchbase• forums.couchbase.com• stackoverflow.com/questions/tagged/couchbase