We’ve done a high-level overview of what’s involved in building a Customer 360 solution on Couchbase and all the thinking involved here

Then dug into the integration part of bringing in data from disparate sources and combining them in Couchbase, and how that results in an ETL process here (excuse me while I go wash my mouth out with soap)…

So, now let’s look at one aspect of what you can do with this wonderful world of combined data.

Imagine, if you will, you have an Account Executive…

One that actually spends his or her time interacting with your customers…

Instead of just spending time out on the golf course.

Well, some do spend time interacting with customer while out on the golf course…

OK, so let’s just stop at the “imagine you have an Account Executive” part.

Since this AE (Account Executive) will be spending his or her time meeting with the various customers, wouldn’t it be nice if they had all of the information about those customers at their fingertips?

I’m talking readily available with a few finger-taps on their phone…

All their purchases…

All their support issues…

All their workshops and interactions with your Professional Services team…

All on the AE’s phone…

Even when out on the 7th green, where there is no cell coverage…

I’m talking no bars…

None!

Can’t even call the drink cart over for a refill…

Well, have we got a solution for you!!!

Offline Mobile Synchronization

See, our mobile stack was designed with the attitude that connectivity sucks!

It’s never there when you need it…

The only time you’ve got all five bars is when some robo-caller wants to give you a ring…

Right as you’re in the midst of your wind-up for your tee-shot…

Perfect time to throw you off your rhythm…

Cause you to hook your shot into the water…

But when you want to discuss with your customer their latest order…

No bars!

Nothing but spinning wheels as you wait for data that’s never going to arrive…

But what if, back on the tee box, where you had five bars, your phone could silently gather all the data you needed…

So when you need it, there’s nothing to retrieve.

No waiting!!!

And you didn’t have to do a thing.

See, up till now, mobile apps have all been written using something called REST calls to retrieve data.

REST?

As in my phone is taking a nap?

Not quite.

REST stands for REpresentational State Transfer.

Yep, a bit of techno-babble.

Don’t ask your local nerd what it means.

He’ll put you to sleep faster than you can say “Representa…ZZZZ”

Oh, sorry, where was I?

Oh yeah, REST…

The short answer is that it’s a web site for apps.

Let’s just leave it at that.

To summarize, every time the app on your phone needed data, it had to go to a web site to retrieve it.

And we’ve all tried to pull up web sites on our phones…

Sometimes they load fast…

And sometimes they load s…l…o…w…

That is, if they load at all.

And on the 7th green, with no bars, guess what kind of response you’re going to be getting…

Yep, none at all.

So we eliminated the need for REST calls in our mobile apps.

Your app just interacts with a small database loaded on the phone, and your data just magically appears!

Well, it’s not really magic…

Just a lot of technical mumbo-jumbo where the database automatically pulls the data when it can…

So it already has it when you need it.

It’s like it’s predicting your future, anticipating your needs and wants…

Automatic Data Sync

So how does this work? What’s involved?

If you take another look at our Customer 360 reference architecture diagram again, you’ll notice in the upper-right corner a rectangle labeled “Mobile” with a couple of lines going from databases to something called “Sync Gateway”, and then on to the Couchbase Data Platform.

This is a piece of magic sauce that goes between the database on your phone and our Couchbase Data Platform.

Magic sauce?

Yes, it is the key to our mobile database, which we call Couchbase Lite, retrieving data from the Couchbase cluster in the background.

See, the last thing you want to do is try to push all of the data in your Couchbase cluster down to your phone.

It just won’t fit.

Not to mention the massive amount of pseudo-5-G bandwidth that would be required.

So, we need some way of designating which data goes to what user.

Or rather, to their phone.

Traditionally, this would be done with some sort of query, which would have been run as part of the REST call mentioned above…

Something like…

And then the wheel would spin as all that data is gathered and returned to the phone.

Hope you’re not in a hurry…

We have a better way…

What we do is to organize the data into “channels”, and then assign the channels to users.

And we do this organization when the data is written to the database.

Why? Why not wait?

Well, because this enables our Sync Gateway product to look ahead and queue up all the data updates each users is going to need.

That means, when your phone goes from zero bars to five, Sync Gateway already has the data ready for you to receive.

No running of any queries to select it.

Kinda like a beer bong for data…

OK, I seem to have wandered from the golf course over to spring break at Daytona Beach…

Either that or the drink cart is unlike any I’ve seen…

It could explain all the bad golf cart driving videos we’ve all seen…

Anyway, back to how Sync Gateway works…

So what we do is we put the organization of your data in your hands.

Sync Gateway has what we call a “sync” function, written in JavaScript.

And you can modify it to use whatever logic (or lack thereof) to assign documents to channels.

Simple, isn’t it?

Well, at least until someone turns it into the JavaScript equivalent of War and Peace…

So now, because your Account Executive had five bars back at the first tee, he now has the data he needs to discuss his customer’s issues when he has zero bars on the 7th green…

Keeping Things Simple

So, I have a few rules that I try to code by…

Have most of my professional life…

At least, since it was hammered into my head by an early boss…

Keep things as simple as possible.

The simpler I keep anything I build, the easier it is to maintain and update it…

The fewer bugs it has…

And the easier my life is.

Makes it easier to make my tee times…

And that’s what we strive for here at Couchbase…

Not to make our tee times…

To keep things as simple as possible.

See, the more systems you have to plug together to build your Customer 360 Solution, the more complex your solution will be.

The more headaches you’ll have…

The fewer tee times you’ll make…

I mean, with our integrated Full Text Search, Analytics, Eventing, N1QL querying, and Key/Value data service, with built-in data caching, it’s all pre-integrated out of the box.

Keeps your life simple.

After all, we can’t have our Account Executives out on the golf course by themselves…

That just wouldn’t be right.

Posted by Davis Chapman

Davis Chapman calls himself a Solution Architect, claims to be employed by Couchbase, and is supposedly part of our Professional Services team. He says that he’s been in the industry for decades, and has been involved in application development for most of that time. Hmm, we'll have to check on that...

Leave a reply