Last Fall we showed a 30 minute live demo of a full stack application written using a broad range of the Couchbase Data Platform capabilities. This was at the Couchbase Connect Silicon Valley 2017 conference.

 

In this introductory post, I highlighted most of what we showed. The post includes pointers for more information, and to the project source code. If you haven’t seen the demo video yet, or read about the project, I’d suggest taking a look at that post first.

High-Level Architecture

With this post I want to kick off the deep dives into the technical aspects of the demo. Let’s take a look at the overall architecture. Here’s a diagram of it for reference.

CCDemoHighLevel

Web Application Components

The web side is pretty standard. We have a web client written using Vue.js. The server side runs in Node.js. The Node server exposes all the REST endpoints needed by the client, and handles the communication with Couchbase Server.

There are some less common pieces, like using Server Sent Events together with the Couchbase Eventing Service. This allows pushing data to the client instead of polling the database.

Mobile/IoT Application Components

Working up through the other side, the architecture is more unique.

First off, there’s the temperature sensor. For this we used a battery-less NFC patch made by Texas Instruments. We read in temperatures using an NFC-enabled phone. This data gets stored in the mobile app’s built-in Couchbase Lite database. That let’s us easily record readings while the phone is online or off.

To sync the readings, Couchbase Lite connects to Couchbase Sync Gateway. Sync Gateway is specially designed to be a cloud-edge service, and core to making the sync process easy.

Among other things, Sync Gateway handles moving the data into a Couchbase Server Bucket. During the demo we also make a schema change on the fly. The changes automatically transfer down to the phone. That’s also managed by Sync Gateway.

Video

If you like, you can also find out more in this video walk-through. I talk a bit about the Couchbase Data Platform capabilities used in the demo as well.

[youtube https://www.youtube.com/watch?v=bmNVuLLkOpA?rel=0&w=640&h=360]

Couchbase Connect

This is just one of the keynote demos we’ve presented at our Couchbase Connect conferences. Don’t miss the chance to see upcoming demos and speak with Couchbase engineers, product managers, and other experts at our upcoming conferences and events. Find out more on our events page.

Postscript

Couchbase is open source and free to try out.
Get started with sample code, example queries, tutorials, and more.
Find more resources on our developer portal.
Follow us on Twitter @CouchbaseDev.
You can post questions on our forums.
We actively participate on Stack Overflow.
Hit me up on Twitter with any questions, comments, topics you’d like to see, etc. @HodGreeley

Author

Posted by Hod Greeley, Developer Advocate, Couchbase

Hod Greeley is a Developer Advocate for Couchbase, living in Silicon Valley. He has over two decades of experience as a software engineer and engineering manager. He has worked in a variety of software fields, including computational physics and chemistry, computer and network security, finance, and mobile. Prior to joining Couchbase in 2016, Hod led developer relations for mobile at Samsung. Hod holds a Ph.D. in chemical physics from Columbia University.

Leave a reply