The document provides an overview of Couchbase, a distributed NoSQL document-oriented database, highlighting its key features like flexibility, scalability, and low operational costs. It explains the installation process and basic CRUD operations using Couchbase, alongside coding examples. Additionally, it emphasizes reasons for choosing Couchbase and its capabilities in an enterprise setting.
Steps of InstallationStepsof Installation
➔ Download Couchbase from their official website.
➔ Install the package using the dpkg command as a privileged
user under sudo.
For example: sudo dpkg –i couchbase-server-enterprise_4.0.0-beta-
ubuntu14.04_amd64.deb
Open abrowser and navigate to http://hostname:8091/ for
configuring your server.
Click Setup.
On the Configure Server screen, select check boxes for data,
query, and index services and click next, to start a new cluster.
Open a browser and navigate to http://hostname:8091/ for
configuring your server.
Click Setup.
On the Configure Server screen, select check boxes for data,
query, and index services and click next, to start a new cluster.
Steps for Configuring Couchbase Server
16.
➢ Sample Bucketsscreen:
Select bucket you want to include and then click Next.
➢
Default Bucket screen:
Click Next to accept the default values.
➢Notifications screen:
Agree to the terms and conditions, and click Next.
➢Configure Server screen:
Enter a password for the Administrator user name, and then click Next.
➢ Sample Buckets screen:
Select bucket you want to include and then click Next.
➢
Default Bucket screen:
Click Next to accept the default values.
➢Notifications screen:
Agree to the terms and conditions, and click Next.
➢Configure Server screen:
Enter a password for the Administrator user name, and then click Next.
Continued..
Setting up connectionSettingup connection
//Required imports
import com.couchbase.client.java.{Bucket,
CouchbaseCluster}
//Create cluster and open bucket
val cluster = CouchbaseCluster.create(“127.0.0.3”)
val bucket = cluster.openBucket(“user”)
//case class to store data in bucket
case class User(name:String, email: String)
21.
Create and UpdateOperationCreate and Update Operation
<BucketObject>.upsert(Document):Document
It updates a document according to the key,and if document is not present
it creates and it returns the document itself.
#14 many web application want to increase application throughput, responsivenesswhere one task can make progress without waiting for all others to completewhere more than one task can make progress at same time.Concurrent program can be executed on single core machine via time slicYou may execute concurrent program in parallelOverall you play with threads