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.
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.
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