Introduction to Couchbase Server
Couchbase Server is a NoSQL document database for interactive web applications. It has a flexible data model, is easily scalable, provides consistent high performance and is ‘always-on,’ meaning it is can serve application data 24 hours, 7 days a week. Couchbase Server provides the following benefits:
Flexible Data Model
With Couchbase Server, you use JSON documents to represent application objects and the relationships between objects. This document model is flexible enough so that you can change application objects without having to migrate the database schema, or plan for significant application downtime. Even the same type of object in your application can have a different data structures. For instance, you can initially represent a user name as a single document field. You can later structure a user document so that the first name and last name are separate fields in the JSON document without any downtime, and without having to update all user documents in the system.
The other advantage in a flexible, document-based data model is that it is well suited to representing real-world items and how you want to represent them. JSON documents support nested structures, as well as field representing relationships between items which enable you to realistically represent objects in your application.
It is easy to scale your application with Couchbase Server, both within a cluster of servers and between clusters at different data centers. You can add additional instances of Couchbase Server to address additional users and growth in application data without any interruptions or changes in your application code. With one click of a button, you can rapidly grow your cluster of Couchbase Servers to handle additional workload and keep data evenly distributed.
Couchbase Server provides automatic sharding of data and rebalancing at runtime; this lets you resize your server cluster on demand. Cross-data center replication providing in Couchbase Server 2.0 enables you to move data closer to your user at other data centers.
Consistent High Performance
Couchbase Server is designed for massively concurrent data use and consistent high throughput. It provides consistent sub-millisecond response times which help ensure an enjoyable experience for users of your application. By providing consistent, high data throughput, Couchbase Server enables you to support more users with less servers. The server also automatically spreads workload across all servers to maintain consistent performance and reduce bottlenecks at any given server in a cluster.
Couchbase Server provides consistent sub-millisecond response times which help ensure an enjoyable experience for users of your application. By providing consistent, high data throughput, Couchbase Server enables you to support more users with less servers. The server also automatically spreads workload across all servers to maintain consistent performance and reduce bottlenecks at any given server in a cluster.
Features such as cross-data center replication and auto-failover help ensure availability of data during server or datacenter failure.
All of these features of Couchbase Server enable development of web applications where low–latency and high throughput are required by end users. Web applications can quickly access the right information within a Couchbase cluster and developers can rapidly scale up their web applications by adding servers.
Installing and Upgrading
To start using Couchbase Server, you need to follow these steps:
Make sure your machine meets the system requirements. See Preparation.
Install Couchbase Server. See Installing Couchbase Server.
For more information on Upgrading Couchbase Server from a previous version, see Upgrading to Couchbase Server 2.0.x.
Test the installation by connecting and storing some data using the native Memcached protocol. See Testing Couchbase Server.
Setup the new Couchbase Server system by completing the web-based setup instructions. See Initial Server Setup.
The following hardware requirements are recommended for installation:
Quad-core for key-value store, 64-bit CPU running at 3GHz
Six cores if you use XDCR and views.
16GB RAM (physical)
Block-based storage device (hard disk, SSD, EBS, iSCSI). Network filesystems (e.g. CIFS, NFS) are not supported.
A minimum specification machine should have the following characteristics:
Dual-core CPU running at 2GHz for key-value store
4GB RAM (physical)
For development and testing purposes a reduced CPU and RAM than the minimum specified can be used. This can be as low as 1GB of free RAM beyond operating system requirements and a single CPU core.
However, you should not use a configuration lower than that specified above in production. Performance on machines lower than the minimum specification will be significantly lower and should not be used as an indication of the performance on a production machine.
View performance on machines with less than 2 CPU cores will be significantly reduced.
You must have enough memory to run your operating system and the memory reserved for use by Couchbase Server. For example, if you want to dedicate 8GB of RAM to Couchbase Server you must have enough RAM to host your operating system. If you are running additional applications and servers, you will need additional RAM. For smaller systems, such as those with less than 16GB you should for instance you should allocate at least 40% of RAM to your operating system.
Installing Couchbase Server
To install Couchbase Server on your machine you must download the appropriate package for your chosen platform from http://www.couchbase.com/downloads. For each platform, follow the corresponding platform-specific instructions.
If you are installing Couchbase Server on to a machine that has previously had Couchbase Server installed and you do not want to perform an upgrade installation, you must remove Couchbase Server and any associated data from your machine before you start the installation. For more information on uninstalling Couchbase Server, see Uninstalling Couchbase Server.
To perform an upgrade installation while retaining your existing dataset, see Upgrading to Couchbase Server 2.0.x.
Ubuntu Linux Installation
The Ubuntu installation uses the DEB package. To install, use the
dpkg command-line tool using the DEB file that you downloaded. The following example uses
sudo which will require root-access to allow installation:
shell> cd /tmp
shell> sudo dpkg -i couchbase-server-enterprise_2.2.0_x86_64.deb
Selecting previously unselected package couchbase-server.
(Reading database ... 58859 files and directories currently installed.)
Unpacking couchbase-server (from couchbase-server-enterprise_2.2.0_x86_64.deb) ...
libssl1* is installed. Continue installing
Minimum RAM required : 4 GB
System RAM configured : 4000408 kB
Minimum number of processors required : 4 cores
Number of processors on the system : 1 cores
Setting up couchbase-server (2.2.0) ...
* Started couchbase-server
Please note that you have to update your firewall configuration to
allow connections to the following ports: 11211, 11210, 11209, 4369,
8091, 8092 and from 21100 to 21299.
By using this software you agree to the End User License Agreement.
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
shell> sudo reboot
And voila, couchbase is installed and listening on ports: 11211, 11210, 11209, 4369,
8091, 8092 and from 21100 to 21299.
Go to: http://yourIP:8091/index.html to find the installation-setup page
At this point you can choose to start a new cluster or to join an existing one.
I picked to join an existing server and that what it will be presented to the administrator.
That’s it, now we have a working cluster with two nodes.