What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
3. Where am I?
• All Things Open
• Raleigh, North Carolina
• https://allthingsopen.org/
4. Who am I?
• Nic Raboy Matthew D. Groves
• Developer Advocate for Couchbase
• @mgroves on Twitter
• Podcast and blog: https://crosscuttingconcerns.com
• "I am not an expert, but I am an enthusiast."
–Alan Stevens
10. Couchbase: The Complete Database Solution
Lightweight embedded NoSQL database
with full CRUD and query functionality.
Secure web gateway with synchronization,
REST, stream, batch and event APIs for
accessing and synchronizing data over the
web.
Highly scalable, highly available, high
performance NoSQL database server.
Built-in enterprise level security throughout the entire stack includes user authentication, user and role based data access control
(RBAC), secure transport (TLS), and 256-bit AES full database encryption.
Couchbase Lite Sync Gateway Couchbase Server
EMBEDDED DATABASE SYNCHRONIZATION DATABASE SERVER
SECURITY
11. Couchbase Lite Overview
Cross-platform support for all major
operating systems and platforms
Built native from the ground up
500kb for most platforms
256-bit AES full database encryption
11
Couchbase Lite
Embedded Database
12. Sync Gateway Overview
Synchronize data between Couchbase
Lite and Couchbase Server
REST, Stream, Batch, and Event APIs
Pluggable authentication
Fine grained user and role based
access control
Elastically scalable in real-time
12
Sync Gateway
Synchronization
13. Couchbase Server Overview
Scale easily to thousands of nodes
Consistent high performance that
supports millions of concurrent users
Flexible JSON data model
24x365 always-on availability
13
Couchbase Server
Database Server
14. 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
15. The Couchbase Node.js SDK
• Uses the high performance Couchbase C library
• Compatible with Node.js frameworks
• Express, Sails, Hapi, Etc.
• Minimal coding
• No database maintenance via code
• No parsing queries via application code
16. Building Applications with Node.js SDK
//including the Node.js dependency
var Couchbase = require("couchbase");
//connecting to a Couchbase cluster
var cluster = new Couchbase.Cluster("couchbase://localhost");
//opening a bucket in the cluster
var myBucket = cluster.openBucket("travel-sample");
//preparing N1ql
var myQuery = Couchbase.N1qlQuery();
//creating and saving a Document
var document = {
firstname: "Matt",
lastname: "Groves"
};
myBucket.insert("my-key", document, function (error, result) { });
17. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
18. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
19. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
20. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
21. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
22. Node.js
function query(sql, done) {
var queryToRun = myQuery.fromString(sql);
myBucket.query(queryToRun, function (error, result) {
if (error) {
console.log("ERROR: ", error);
done(error, null);
return;
}
done(null, result);
return;
});
}
25. Node.js Separation of Frontend and Backend
• No Jade markup
• API driven
• Less client and server coupling
• The backend can evolve without affecting the frontend
• Frontend can be extended to web as well as mobile
47. Where do you find us?
• developer.couchbase.com
• blog.couchbase.com
• @couchbase / @couchbasedev / @mgroves
• forums.couchbase.com
• stackoverflow.com/questions/tagged/couchbase
48. Frequently Asked Questions
1. How is Couchbase different than Mongo?
2. Is Couchbase the same thing as CouchDb?
3. How did you get to be both incredibly handsome and
tremendously intelligent?
4. What is the Couchbase licensing situation?
5. Is Couchbase a Managed Cloud Service?
50. MongoDB vs Couchbase
• Architecture
• Memory first architecture
• Master-master architecture
• Auto-sharding
< Back
• Features
• SQL (N1QL)
• FullText Search
• Mobile & Sync
51. Licensing
Couchbase Server Community
• Open source (Apache 2)
• Binary release is one release behind Enterprise
• Free to use in dev/test/qa/prod
• Forum support only
Couchbase Server Enterprise
• Mostly open source (Apache 2)
• Some features not available on Community (XDCRTLS, MDS, Rack Zone, etc)
• Free to use in dev/test/qa
• Need commercial license for prod
• Paid support provided
< Back
52. Managed Cloud Service (DBaaS)?
Short answer: No.
< Back
Longer answer: Kinda. https://zdatainc.com/couchbase-managed-services/
Longest answer: See me after class.
Notas do Editor
What is a full stack?
This is my idea of a full stack.
Some people take issue with the term "full stack" because you aren't programming the literal entire stack.
But what is usually meant is UI to the database. And that's what we're going to cover today.
The need for engineers working in a silo is shrinking
Full stack engineers do a little bit of everything
A stack includes a client facing layer, backend, and database.
Each layer in a stack can extend to multiple components, for example more than one client facing component or more than one database.
No db migrations in code
No proprietary query language, we'll be using SQL
Open source apache license for community edition, enterprise edition on a faster release schedule, some advanced features, and support license.
Couchbase is software you can run in the cloud on a VM or on your own data center. CosmosDb is a manage cloud service, but there is a emulator you can run locally.
Couchbase is the company, Couchbase Server is the software
So imagine if Mongo and Redis companies formed a new company named RedMongo, and a new database combining Redis and Mongo together called RedMongo Server
Memory first: integrated cache, you don't need to put redis on top of couchbase
Master-master: easier scaling, better scaling
Auto-sharding: we call vBuckets, you don't have to come up with a sharding scheme, it's done by crc32
N1QL: SQL, mongo has a more limited query language and it's not SQL-like
Full Text Search: Using the bleve search engine, language aware FTS capabilities built in
Mobile & sync: Mongo has nothing like the offline-first and sync capabilities couchbase offers
Mongo DOES have a DbaaS cloud provider
Everything I've shown you today is available in Community edition
The only N1QL feature I can think of not in Community is INFER
The Enterprise features you probably don't need unless you are Enterprise developer.
Not yet. We've been talking about it at least as long as I've been with Couchbase.
It's partly a technical problem, may need additional features for multi-tenant.
It's partly (mostly) a business problem. Would this be worth it?
Couchbase IS in the Azure and AWS marketplaces, and there are some wizards to make config easy, but it runs on your VMs.