The Couchbase Mobile Stack

Introduction

The Couchbase Mobile stack comprises three components, Couchbase ServerSync Gateway, and Couchbase Lite.

To get comfortable with the whole stack, it’s great to install and run everything on your development machine. In this series of posts, I’ll walk through the steps get to started with each component. I’ll show how to do a little extra exploring along the way, too.

I’ll only do minimal configuration. This is not intended to explain what you need for a production environment. I assume you’re familiar with some basics of NoSQL, have some understanding of Couchbase, and know how to build apps in something like Java, Android, or iOS. If you want to read up on NoSQL databases or Couchbase, you can find lots of resources on the Couchbase site.

Couchbase is open-source. Everything I’ll use here is free to try out. See the end of the post for more resources if you need help.

Couchbase Server

Couchbase Server (CBS) is an enterprise-class NoSQL database.

CBS runs on a wide variety of Linux distributions, different versions of Windows, and OSX from 10.8 on. The initial install of CBS takes around 3-4 steps. The steps depend on the platform. I’ll list what’s needed for OSX as an example. For other platforms, you can find the quick version of the setup instructions here. You can also view video tutorials for several Linux distributions (UbuntuRHEL, or CentOS), OSX, and Windows.

OSX

Initial Installation Steps

Both the Enterprise Edition and Community Edition are free to use for evaluation. I’ll illustrate with the Enterprise Edition, version 4.5.1.

  • Download Couchbase Server (zip archive)
  • Unpack the archive, open the resulting folder
  • Drag Couchbase Server to Applications
  • Locate Couchbase Server in Applications, click to start

On successful launch, you’ll see a control icon added to your menu bar. Couchbase also automatically launches the web-based setup page (http://127.0.0.1:8091/index.html). You should see this:

Couchbase Server Installation Start Page

Click “Setup” to configure your installation. That will take you to step 1 (of 5).

Configuration – Step One

Couchbase Server Installation Step 1

You can learn about all the other settings later. The only one I recommend you change is shown circled in red. This sets the maximum amount of main memory this instance of CBS will use. I often set it to 2GB, but you can try it out with anything down to 256MB.

Step Two

Couchbase Server Installation Step 2

CBS comes with sets of sample data. You don’t need to load any. Here I’m showing loading the beer sample. It’s helpful to explore, and I’ll refer to it in a later post, so you might want to include it.

Step Three

Couchbase Server Installation Step 3

A quick note on terminology. CBS organizes datasets into buckets. These roughly correspond to what other systems refer to as a database.

No need to change any settings here. CBS creates a bucket named “default”. We’ll use this in later examples. You should not deploy a production system with a bucket named “default”. It’s there to get you going. Some of the standard Sync Gateway example configurations use it, too.

Step Four

Couchbase Server Installation Step 4

Here you can set up to get software updates, register your product, and accept terms and conditions of use. To move to the next step only requires accepting the terms and conditions.

Step Five

Couchbase Server Installation Step 5

Finally, you need to set up an administrative account. Couchbase fills in a default username (you should change it for production). Set a password, and you’re done.

Ready To Go

Couchbase Server Administration Interface

That’s it! With those simple steps, you now have an active, configured Couchbase Server installation.

You should now see the Overview panel of the administration interface. Moving from top to bottom, we can see how the information reflects what we selected during the installation.

The green bar under shows the status of the 2GB of RAM we allocated for our Server instance. If you look closely, you’ll see 11MB of memory in active use. That includes the beer bucket sample data in memory.

Under the Buckets heading, you’ll see the active count includes the default bucket plus any sample buckets loaded. The activity graph shows a spike in operations. That corresponds to loading the beer sample data.

Under Servers, we see we have one server live. We only set up one instance, so the other indicators all show 0 servers.

Next Steps

That’s all for installing Couchbase Server on your machine. If you want to jump in further, you can look around the admin interface or try out your installation directly using command line tools to make REST calls. You’ve seen how easy it is to get going, so you needn’t worry about breaking anything. If you really get tangled up, just delete the installation and start over.

In the rest of this series, I’ll start by showing some interesting ways to explore Couchbase Server. This won’t be exhaustive. I’ll focus on a few items to get you comfortable exploring on your own.

Next up I’ll show how to get going with Sync Gateway. Sync Gateway (SG) is easier to install. It’s worth spending time to understand how sync works, so I’ll spend more time showing some things you can do with it.

I’ll wrap up the series with a demo app using Couchbase Lite that connects to the CBS and SG, all running on the same machine. We’ll loop back around to see what happens on CBS and SG when running the app.

Welcome to Couchbase Mobile. This is a great tech stack that solves tough problems in a flexible way. It’s currently the only product I know of that addresses all the core issues faced when developing apps that need solid offline availability combined with synchronization and back end integration. It’s exciting to work with, so I’m looking forward to showing you more ways to explore.

[button style=”btn-link btn-lg” icon=”fa fa-arrow-right” align=”left” iconcolor=”#dd3333″ type=”link” target=”false” title=”Next: Couchbase Web Console” link=”https://www.couchbase.com/blog/comfortable-couchbase-mobile-couchbase-web-console/” linkrel=””]

Postscript

Check out more resources on our developer portal and follow us on Twitter @CouchbaseDev.

You can post questions on our forums. And we actively participate on Stack Overflow.

You can follow me personally at @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.

4 Comments

  1. backlink from wikipedia

    doguvhkhq rviun ceugxii chyt vygclclgeonrvsg

  2. […] Previous: Installing Couchbase Server Next: Couchbase Server via the Command Line […]

  3. […] Lite embedded Database. You can learn more about getting started with Couchbase Server at the here and Couchbase Sync Gateway […]

  4. where are the follow up articles?

Leave a reply