Tag Archives: nosql

Couchbase Connect 2016 Call for Papers

Couchbase Connect is an event where the best Devs and Ops mind in NoSQL get together!

Inviting all developers, architects, administrators, and CxOs to Save The Date for Couchbase Connect. This event is happening in the beautiful Bay Area and could be your excuse to visit Silicon Valley! And if you are living near by, then there is no excuse not to attend!


You will hear from best speakers in the NoSQL industry. You’ll also get an opportunity to meet Couchbase Product Managers, Engineers who build the technology, Developer Advocates, Community Champions and Experts, Executive Team of Couchbase, and many more. Who knows which discussion will help you replatform your application and get ready to meet the demands of Digital Economy!

You’ll not only learn about the some of the coolest features in Couchbase, but also get to hear about our product roadmap. There will be hands-on workshops, sessions by practitioners, quick tips, informal Birds of Feather discussions and a lot more. And of course, the hallway track will allow you to socialize with attendeesand other Couchbasers.

Couchbase Connect 2016 Call for Papers

Are you using Couchbase and would like to share your success story? We’d love to have you submit a talk.

Some of the suggested topics are …

  • Build a polyglot application with microservices and using Couchbase
  • Deploy Couchbase container using any of the orchestration frameworks like Docker Swarm, Kubernetes, Mesos, and AWS ECS
  • Using Couchbase Mobile in a creative way
  • Making Couchbase Mobile offline work for you in an interesting environment
  • Provisioning, managing, scaling, and monitoring Couchbase clusters
  • Integration with Big Data platform such as Hadoop, Spark, and Kafka
  • Any interesting tools that you’ve built around Couchbase
  • Migration from RDBMS or other NoSQL databases to Couchbase
  • Using Couchbase in production with hundreds of nodes and multiple clusters
  • Connecting edge/IoT devices using Couchbase Mobile and Server

And these are only a suggestion. Feel free to get creative and go crazy!

Submit your talks at: info.couchbase.com/Connect_2016_call_for_papers.html.

Each talk is usually 40 mins long. But you can submit a lightning talk for 10 or 20 mins as well. The Call for Papers end on Sep 1, but don’t delay. Start thinking about those abstracts and submit a session today!

All speakers will be invited to a VIP dinner, get some exclusive swag, and a whole lot more.

Sessions from Connect 2015 can be viewed at connect15.couchbase.com/sessions/.

Check out some pictures from Connect 2015:

connect15.1 connect15.2
connect15.3 connect15.4
connect15.5 connect15.6
connect15.7 connect15.8
connect15.9 connect15.10

If pictures are any indication, Connect will be a complete NoSQL geekgasm. You don’t want to miss the party and all the fun!

Couchbase Connect References

  • Website: couchbase.com/connect-16
  • Venue: Santa Clara Convention Center, California, USA
  • Dates: Nov 7-9, 2016
  • CFP ends: Sep 1, 2016
  • Call for Papers: info.couchbase.com/Connect_2016_call_for_papers.html

Source: blog.couchbase.com/2016/july/couchbase-connect-2016-call-for-papers

Microservices using WildFly Swarm, Docker and Couchbase

Containers, Microsoervices, and NoSQL provide an awesome threesome for building your modern applications. These applications need to be agile, meet constantly evolving customer demands, be pervasive, and should work across mobile, web and IoT platforms.

This blog will explain a simple microservices stack using WildFly Swarm, Docker, and Couchbase. Complete code and instructions in this blog are documented at: github.com/arun-gupta/wildfly-swarm-couchbase.

Let’s understand the key components of this stack first!


WildFly Swarm allows to package and run JavaEE applications by packaging them with just enough of the server runtime to java -jar your application. With built-in service discovery, single sign-on using Keycloak, monitoring using Hawkular, and many more features, WildFly Swarm provides all the necessary components to develop your microservice.


Docker for Mac provides native support for running Docker containers on Mac OSX. It relies upon Hypervisor.framework in OSX. Docker engine runs in an Alpine Linux distribution on top of an xhyve Virtual Machine, and even the VM is managed by Docker. There is no need for Docker Machine or VirtualBox, and it integrates with OSX security sandbox model. DockerCon 2016 removed the private beta restriction from Docker for Mac, and so its available for everybody now.

Couchbase Logo

NoSQL provides the agility and flexibility of schema-less databases. This allows the application to evolve independently and rapidly without going through cumbersome database migrations. Couchbase offers true horizontal scaling with homogenous architecture, as opposed to non-scalable master/slave architecture. It also offers auto-sharding, SQL-like query language for JSON (N1QL), mobile database and synchronization with the backend server, and much more.

The complete sample application in this blog is at: github.com/arun-gupta/wildfly-swarm-couchbase.

WildFly Swarm Application

Let’s look at the Java EE REST endpoint:

It uses standard JAX-RS annotation to convert a POJO into a REST endpoint. Couchbase Java API provide a fluent API and used N1QL statement to query the documents and return the results. The N1QL statement returns the first 10 elements from the query result. Learn more about N1QL syntax in this interactive tutorial.

Database abstraction is defined as:

This is a singleton EJB that is eagerly initialized. It uses Couchbase Java SDK to connect to Couchbase. Database endpoint can be specified using the COUCHBASE_URI environment variable.

Next up is pom.xml for configuring the WildFly Swarm and Couchbase Java Client:

It uses WildFly Swarm “bill of materials” to pull in all the dependencies. Only the specific dependencies needed for the build are specified in <dependencies>. These are then packaged in the “fat jar”.

WildFly Swarm Maven plugin is used to package and run the application:

COUCHBASE_URI is used to read the host of where Couchbase database server is running.

Run Couchbase Server

Run the Couchbase server using Docker for Mac:

The arungupta/couchbase is built upon the standard Couchbase image and uses Couchbase REST API to configure the server.

Wait for a couple of minutes for the sample bucket to be populated with the JSON documents.

Invoke the Couchbase CLI tool cbq create a primary index on the sample bucket:

This will show the output as:

This output shows that result of creating index was successful.

One of the advantages of running Docker for Mac is that all the containers are accessible at localhost. This means Couchbase Web Console can be accessed at localhost:8091.


This screen ensures that Couchbase is configured  correctly.

Run WildFly Swarm Microservice


Package and run the self-contained microservice as:

If Couchbase is running on a different host, then the command will change to:

It shows the output as:

Now the application can be accessed as:

And a formatted output looks like:

So you built a simple microservice using WildFly Swarm accessing a Couchbase database running as a Docker container.

Now, ideally this WildFly Swarm service should be packaged as a Docker image and then that Docker image would serve as the service. A Maven profile with the name docker is already added to pom.xml but issue #3 is making that scenario fail.

Microservices References

  • docs.docker.com
  • WildFly Swarm
  • Getting Started with NoSQL
  • GitHub Repo: github.com/arun-gupta/wildfly-swarm-couchbase

Source: blog.couchbase.com/2016/june/microservices-wildfly-swarm-docker-couchbase

Couchbase 4.5 Developer Preview Now Available!

Couchbase 4.5 Developer Preview is now available!

Couchbase 4.5 Developer Preview

As we head towards 4.5 GA, this is a significant milestone packed with many exciting features for more efficient querying, advanced data access, powerful indexing, and more comprehensive administration.

For developers, this is going to be a big preview release as it brings some exciting features including:

  • Query Workbench – a built-in query editor for writing and executing queries as well as exploring the data model with automatically inferred schemas
  • Full-text Search – support for term, fuzzy, phrase, match, and prefix queries has been added – faceting, scoring, and highlighting, too.
    • Blog: Full-text Search in Couchbase 4.5 Developer Preview by @ldoguin and @willgardella
    • Blog: Preview of Full-text Search in Couchbase using the Java SDK by @simonbasle
  • Sub-document API – enables clients to add, remove, and modify individual fields (or read them), including objects and arrays, without reading and writing the entire document
    • Blog: Sub-documents: find and change only what you need by @matthewrevell
  • Array Indexing – index specific fields of elements within nested arrays to improve query performance
  • Extended N1QL joins – support a new query optimization for filtering the right side first, with an index, resulting in added flexibility and improved query performance
  • Query Profiling and Monitoring – monitor active queries and connections as well as profile queries to identify and diagnose performance issues
  • Many more

We’ve also introduced Debian 8 builds and this adds to the existing wide list of platforms we already run on.

Here are some quick links:

  • 4.5 Developer Preview Download
  • 4.5 Developer Preview features at a glance
  • Blog Announcement
  • Docs
  • Release Notes
  • Docker images

Interested in learning more about each feature, then watch different videos (more coming) in this playlist:


Originally posted at: http://blog.couchbase.com/2016/february/couchbase-4.5-developer-preview-available

Query JSON using SQL with Couchbase Query Workbench – Coffee on Couchbase


You’d like to query JSON document database using SQL-like syntax?

Couchbase has N1QL for you.

N1QL is a declarative query language that extends SQL for JSON. You can query data via native framework and language integration, a fluent API, or the JDBC/ODBC drivers.

N1QL enables you to query JSON documents without any limitations – sort, filter, transform, group, and combine data with a single query. That’s right. You can combine data from multiple documents with a JOIN. That flexible data model you were promised? This is it. You’re no longer limited to “single table” and “table per query” data models.

N1QL Tutorial is a great resource to learn the concepts of querying JSON documents using SQL-like syntax. Here are some examples:

So you are ready to experiment with N1QL? You can certainly use CBQ tool.

Alternatively you can use Couchbase Query Workbench. The query workbench provides a rich graphical user interface to prepare and execute simple to complex N1QL queries. It provides a convenient way to perform query development by enabling you to browse, create, and run N1QL statements, and view results.

Want to learn how to get started?

Learn all about it in this brief session with Eben Haber:

Ask your questions at Stack Overflow or Couchbase Forums.

You can also follow us at @couchbasedev and @couchbase.


JBoss EAP 7 and NoSQL using Java EE and Docker

JBoss EAP 7 Beta is now released, many congratulations to Red Hat and particularly to the WildFly team!

There are plenty of improvements coming in this release as documented in Release Notes. One of the major themes is Java EE 7 compliance.

JBoss EAP 7 and Java EE 7

IBM and Oracle already provide commercially supported Java EE 7-compliant Application Servers. And now Red Hat will be joining this party soon as well. Although WildFly has supported Java EE 7 for 2+ years but commercial support is a critical for open source to be adopted enterprise-wide. So this is good news!

You can learn all about different Java EE 7 APIs in the DZone Refcardz that I authored along with @alrubinger.

Java EE 7 Refcardz

There are plenty of “hello world” Java EE 7 Samples that should all run with JBoss EAP. Hopefully somebody will update the pom.xml and add a new profile.

Why NoSQL?

If you are building a traditional enterprise application then you might be fine using an RDBMS. There are plenty of advantages of using RDBMS but using a NoSQL database instead has a few advantages:

  • No need to have a pre-defined schema and that makes them a schema-less database. Addition of new properties to existing objects is easy and does not require ALTER TABLE. The unstructured data gives flexibility to change the format of data any time without downtime or reduced service levels. Also there are no joins happening on the server because there is no structure and thus no relation between them.
  • Scalability, agility and performance is more important than the entire set of functionality typically provided by an RDBMS. This set of databases provide eventual consistency and/or transactions restricted to single items but more focus on CRUD.
  • NoSQL are designed to scale-out (horizontal) instead of scale-up (vertical). This is important knowing that databases, and everything else as well, is moving into the cloud. RBDMS can scale-out using sharding but requires complex management and not for the faint of heart. Queries requiring JOINs across shards is extremely inefficient.
  • RDBMS have impedance mismatch between the database structure and the domain classes. An Object Relational Mapping, such as one provided by Java Persistence API or Hibernate is needed in such case.
  • NoSQL databases are designed for less management and simpler data models lead to lower administration cost as well.

So you are all excited about NoSQL now and want to learn more:

  • Why NoSQL?
  • Why do successful enterprises rely on NoSQL?
  • Top 10 Enterprise NoSQL Usecases

In short, there are four different types of NoSQL databases:

  • Document: Couchbase, Mongo, and others
  • Key/Value: Couchbase, Redis, and others
  • Graph: Neo4J, OrientDB, and others
  • Column: Cassandra and others

Java EE 7 provides Java Persistence API that does not provide any support for NoSQL. So how do you get started with NoSQL with JBoss EAP 7?

This blog will show how to query a Couchbase database using simple Java EE application deployed on JBoss EAP 7 Beta.

What is Couchbase?

Couchbase is an open-source, NoSQL, document database. It allows to access, index, and query JSON documents while taking advantage of integrated distributed caching for high performance data access.

Developers can write applications to Couchbase using different languages (Java, Go, .NET, Node, PHP, Python, C) multiple SDKs. This blog will show how you can easily create a CRUD application using Java SDK for Couchbase.

Run JBoss EAP 7

There are two ways to start JBoss EAP 7.

Download and Run

  • Download JBoss EAP 7 Beta and unzip.
  • Start the application server as:

Docker Run

In a containerized world, you just docker run to run your JBoss EAP. However, JBoss EAP image does not exist on Docker Hub and so the image needs to be explicitly built. You still need to explicitly download JBoss EAP and then use the following Dockerfile to build the image:

The image is built as:

And then you can run the JBoss EAP 7 container as:

Notice, how application and management ports are bound to all network interfaces. This will simplify to deploy the application to this JBoss EAP instance later.

Stop the server as we will show an easier way to start it later.

Start Application Server and Database

The Java EE application will provide a HTTP CRUD interface over JSON documents stored in Couchbase. The application itself will be deployed on JBoss EAP 7 Beta. So it would require to start Couchbase and JBoss EAP.

Use the Docker Compose file from github.com/arun-gupta/docker-images/blob/master/jboss-eap7-nosql/docker-compose.yml to start Couchbase and JBoss EAP 7 container:

The application is started as:

The started containers can be seen as:

Configure Couchbase Server

Clone couchbase-javaee application. This Java EE application uses Couchbase Java SDK APIs to connect to the Couchbase server. The bootstrap code is:

and is invoked from Database abstraction.

Couchbase Server can be configured using REST API. These REST APIs are defined in a Maven profile in pom.xml of this application. And so configure Couchbase server as:

Deploy Java EE Application to JBoss

Java EE Application can be easily deployed to JBoss EAP 7 Beta using the WildFly Maven Plugin. This is also defined as a Maven profile in pom.xml as well.

Deploy the application as:

Access the Application

As mentioned earlier, the application provides HTTP CRUD API over JSON documents stored in Couchbase.

Access the application as:

CRUD operations (GET, POST, PUT, DELETE) can be performed on Airline resource in the application. Complete CRUD API is documented at github.com/arun-gupta/couchbase-javaee.

This blog explained how to access a NoSQL database from JBoss EAP 7.

Read more about Couchbase 4:

  • What’s New in Couchbase Server 4.1
  • Couchbase Server documentation
  • Talk to us on Couchbase Forums
  • Follow @couchbasedev or @couchbase

Learn more about Couchbase in this recent developer-focused webinar:

Why Couchbase over MongoDB? #SayNoToMongoDB

MongoDB is one of the most popular NoSQL databases. Its easy to start, has good documentation, works well with a few nodes. But it starts to fall apart as the number of users increase or more nodes are added.

Do you keep struggling with MongoDB? Thought about Couchbase over MongoDB? But don’t know where to start.

Couchbase Logo MongoDB Logo

Why are companies switching from MongoDB to Couchbase?

  1. MongoDB is hard to scale from a single replica set to a fully sharded environment
  2. MongoDB’s performance rapidly degrades with increasing users
  3. MongoDB is significantly susceptible to data loss under failure
  4. MongoDB requires a third-party cache to help it perform
  5. When deployed in multiple geographies, MongoDB can’t perform all writes locally
  6. MongoDB lacks a mobile solution
  7. MongoDB is time-consuming to manage and maintain

Read how Couchbase avoids all of these problems in Struggling With MongoDB.

Couchbase vs MongoDB Architectural Differences and Their Impact whitepaper provide more details.

Talk to a Couchbase Solutions Engineer and learn if/how  Couchbase can yield better results for your non-performing MongoDB.

Some more useful references:

  • NoSQL Evaluation Guide
  • Getting Started with Couchbase
  • FREE Online Training for NoSQL and Couchbase
  • Couchbase Developer Portal

Viber replaced MongoDB with 50% fewer Couchbase servers. AT&T, Comcast, eBay, GE, LinkedIn, Marriott, PayPal, Tesco, Verizon, VISA, Wells Fargo and many other customers are using Couchbase.

You can too! Why wait?

#MakeTheSwitch and #SayNoToMongoDB!

Couchbase 4.0 Datasheets – Server, N1QL, Multi-dimensional Scaling

Couchbase Server 4.0 was released recently and getting good reviews so far.

Couchbase Datasheets

Are you looking for Couchbase datasheets that provide a quick overview of the key features?

Now you’ve them!

  • Couchbase Server 4.0 – Develop with Agility, Operate at Any Scale
  • What’s New – N1QL, Multi-dimensionsal Scaling, Global Secondary Indexes, Enhanced Security, ForestDB Storage Engine, Cross-Data Center Replication Filtering, Geospatial views, and much more
  • N1QL
  • Multi-Dimensional Scaling

Download Couchbase Server 4.0 and start building your web, mobile, and IoT applications in a true polyglot fashion using Java, Go, Python, .NET, PHP, or Node.js SDKs.

Complete list at Couchbase Server.


Getting Started with Couchbase using Docker

Couchbase Server 4.0 was recently released and can be downloaded and easily installed. Getting Started with Couchbase explains in very simple and easy steps on how to get started with Couchbase.  But when living in a container world, everything is a Docker image. And Couchbase also has a Docker image.

Couchbase Logo


This blog will explain how you can easily start a Couchbase Server 4.0 as a Docker image.

Install and Configure Docker

Docker is natively supported on Linux. So apt get docker-engine on Ubuntu or yum install docker-engine on CentOS will get you ready to use Docker.

On Mac or Windows, this is achieved by install Docker Machine. Docker Machine to Setup Docker Host explain in detail on how to install and configure Docker Machine.

Here is a brief summary to get you started with Docker:

  1. Download Docker client:
  2. Download Docker Machine script:
  3. Create Docker Machine host:
  4. Setup Docker client to connect to this host:

Now your current shell is configured where the Docker client can run containers on the Docker Machine.

Run Couchbase Docker Container

  1. Starting a Docker container on this machine is pretty straight forward. The CLI downloads the image from Docker Hub and then runs it on the Machine:
    In this CLI, run command runs the container using the image id specified as the last argument, -p publish port 8091 from the container to 8091 on the Docker Machine, -d runs the container in background and prints the container id.
  2. Watch the container status as:
  3. Find out IP address of the Docker Machine:
  4. Access the setup console at, make sure to specify the exact IP address in your case. This will show the screen:Couchbase Docker Getting Started 1

Configure Couchbase Server

First run of Couchbase Server requires you to configure it, lets do that next!

  1. Click on the Setup button. Scroll to bottom of the screen, change the Data RAM Quota to 500 (MB-16530), and click on Next.Couchbase Docker Getting Started 2
  2. In Couchbase, data is stored in buckets. The server comes pre-installed with some sample buckets. Select the travel-sample bucket to install it and click on Next.Couchbase Docker Getting Started 3
  3. Configure the bucket by taking defaults:Couchbase Docker Getting Started 4

    Click on Next.
  4. Enter personal details, agree to T&C, click on Next:Couchbase Docker Getting Started 5
  5. Provide administrator credentials:Couchbase Docker Getting Started 6

    Click on Next to complete the installation. This brings up Couchbase Web Console:

    Couchbase Docker Web Console

It takes a few seconds for the travel-sample bucket to be fully loaded. And once that is done, your Couchbase server is ready to roll!

You can also watch the following presentation from Couchbase Connect:

Talk to us at Couchbase Forums or @couchbase.

Hibernate OGM: NoSQL solutions for Java EE (Hanginar #4)

Hibernate OGM Hibernate OGM brings the power and simplicity of JPA for NoSQL datastores.

It provides one standard way to access a variety of NoSQL datastores such as Infinispan, Ehcache, MongoDB, Neo4J. And support for others is coming. It even allows rich querying capabilities and convert them into datastore-specific query (if supported). You can even mix/match Persistence Unit in persistence.xml for a RBDMS and NoSQL datastore.

This hanginar (#1, #2, #3) with Emmanuel Bernard (@emmanuelbernard) shows how to get started with Hibernate OGM. It specifically addresses the following questions:

  • What NoSQL datastores are supported?
  • Can I build support for other datastores?
  • What application servers can it run on?
  • Do I need Hibernate for it, or does it work with EclipseLink?
  • Can I have a SQL and NoSQL PU in persistence.xml and access them from Java EE application?
  • Can I use this in Java SE applications?

Learn everything about Hibernate OGM at hibernate.org/ogm/.

Source code used in the webinar is at github.com/hibernate/hibernate-demos/tree/hanginar-201501.