Stay ahead of today’s intensive data processing requirements

Change is a constant. It continuously challenges architects and developers to design and develop revolutionary applications that are more flexible and versatile. While applications may start small, user bases inevitably explode and their requirements change, new regulations come into effect and evolve, and breaches can surprise at any time. Our NoSQL document database and key-value store was purposefully designed to minimize these impacts. Couchbase is architected for change.

Couchbase architectural advantages

Purple pink gradient man on computer with people
Flexible schema for continuous delivery

  • Flexible JSON data model enables on-the-fly schema change for continuous delivery
Fully featured SQL for JSON database

  • SQL extended to JSON for query and analytics, including support for JOINs
  • Storage, retrieval, structured querying, full-text search, real-time analytics and triggers, in the cloud or on mobile and edge devices
No hassle scale out

  • Application behavior unchanged on 1-node development laptop to multi-node production deployment
  • No manual sharding, or re-sharding
Matt Cain
Memory and network centric

  • Memory-first architecture with integrated document cache
  • Network-centric architecture with a high-performance replication backbone allows new workloads to be easily added while maintaining performance at scale
Always-on, edge-to-cloud

  • Architected as a scale-out distributed database across physical, virtualized, container, and public cloud environments
Consistent performance at any scale

  • Intelligent, direct application-to-node data access without additional routing and proxying
  • Independent data and index partitioning to optimize mixed and varied workloads
  • Multi-Dimensional Scaling enables workloads to be added quickly and scaled independently with no impact on the existing performance
Matt Cain
Global deployment with low write latency

  • Active-active cross datacenter replication (XDCR) with flexible topologies and low latency
  • Hybrid-cloud deployment and management with Docker containers and Kubernetes/OpenShift Operator
Consistent performance when adding microservices

  • Auto-sharding, replication, and failover for easy scale out and high availability
  • Autonomously maintain application availability 24x365 across upgrades, node failures, network failures, or even cloud provider failures
  • All functionality available across physical, virtualized, public cloud, container, and Couchbase Managed Service environments
Full stack security

  • End-to-end encryption over the wire and at rest
  • Role-based authentication, with support for LDAP, PAM, and X.509
  • Data and administrative auditing
dummy-image

Get under the hood

Click the graphic to explore the Couchbase architecture

Memory First

Customers expect and demand fast, responsive applications. Many enterprises will add an in-memory caching product in front of their relational and NoSQL database to increase performance and throughput, and to ensure responsiveness. However, this adds operational and management complexity as well as additional cost.

Built on a memory-first architecture, Couchbase ensures that all operations occur in-memory and supports special memory-optimized data management options, including 100% memory resident indexes and data buckets. This optimizes data-access performance and throughput while also simplifying operational management and reducing costs. By achieving memory-speed data transfer between nodes in the cluster, Couchbase avoids traditional database disk I/O bottlenecks.

couchbase_dataplatform_data_movement
expand icon Expand

The Couchbase Data Platform leverages its memory-first architecture to transfer data between nodes in the cluster at the speed of memory, thus avoiding traditional database disk I/O bottlenecks.

Elastic Scalability

As part of the core database engine, Couchbase provides an elastic Multi-Dimensional Scaling (MDS) architecture that supports both scale-up and scale-out approaches.

MDS allows you to separate the different data processing workloads as distinct, independently scalable services. You can independently configure and scale (up or out) the data, index, query, Full Text Search, and Analytics Services based on your data management processing requirements and application workloads. This gives you both the scalability to deliver responsive customer applications and the flexibility to adapt to new and changing workloads and application requirements.

couchbase_dataplatform_data_movement
expand icon Expand

MDS is particularly well-suited for the cloud where compute, storage, and memory resources are typically allocated and expensed separately. MDS allows you to independently configure and scale your compute, storage, and memory resources for each service. This results in a more efficient allocation and use of resources, ultimately reducing your overall cost of operations in the cloud.

Persistence

Couchbase Server’s architecture guards against most forms of failure, and protects against data loss. Buckets can be configured for replication to create data redundancy and to allow for the failure of copies – as long as the data is available somewhere, it’s not lost. Data is also written to the disk, so in the case of a power outage or software crash, data can be retrieved from the disk during recovery. Depending on durability and performance requirements, users can configure the right durability options to meet their application needs.

Replication

Couchbase Server provides high availability for reading and writing of data through a variety of features. Couchbase provides high availability using intra-cluster replication and index replication, and disaster recovery using cross datacenter replication (XDCR).

Intra-cluster replication 
Intra-cluster replication involves replicas that are placed on another node in the same cluster. In the event of failure of a single node, this ensures that data is still available on other nodes that can provide full read and write ability to the applications.

Cross datacenter replication
Using the cross datacenter replication (XDCR) capability, you can set up replication of data between clusters. XDCR helps protect against datacenter failures and also helps maintain data locality in globally distributed mission-critical applications.

Index replication
Index replication support has been added to improve high availability and manageability of indexes. Users can specify the number of replicas to create, and the system will manage the placement of the index replicas on different index nodes, server groups, and availability zones.

Eventing

Couchbase Eventing is a highly available, performant and scalable service which enables user-defined business logic to be triggered in real-time on the server when application interactions create changes in data. Eventing makes it easy to develop, deploy, debug and maintain data-driven functions from a centralized platform. Natively integrated with the Couchbase Data Platform, it requires no third party solutions to license or new dataops skills to manage.

Query

Build and evolve web, mobile, and IoT apps faster using Couchbase’s own query language, N1QL (“nickel”). N1QL combines the power and familiarity of SQL with the flexibility and agility of the JSON data model.

N1QL is a declarative query language that extends SQL for JSON data. You can query data via native framework and language integrations, a fluent and easy-to-use API, several Couchbase utilities, or available JDBC/ODBC drivers.

With N1QL you can query JSON documents without any limitations: sort, filter, transform, group, and combine data with a single query. You can combine data from multiple documents with a JOIN. And you’re not limited to the “single table” and “table per query” data models often found in other NoSQL products.

query table document key select
expand icon Expand

In the Couchbase Mobile 2.0 release, N1QL has also been added to Couchbase Lite. This allows mobile application developers to leverage their existing SQL programming skills along with the flexibility of JSON.

Analytics

Powerful parallel query processing over JSON data allows you to:

  • Efficiently execute complex, long-running SQL-like queries that contain complex joins and set, aggregation, and grouping operations
  • Address the challenges of supporting responsive, scalable apps and ad hoc analytics on the same dataset

Couchbase Analytics powerfully combines a common JSON data model with:

  • A SQL-like query language extended for JSON 
  • Effective analytical workload isolation
  • Up-to-date data freshness via a fast memory-to-memory transfer protocol in a single platform

This allows app developers and DevOps to build intelligent applications and dashboards that surface insights to customers and business users in real time without the overhead and latency of performing separate extract, transform, load (ETL) operations.

Analytics Diagram Couchbase
expand icon Expand

Full-Text Search

Built-in Full-Text Search (FTS) makes it simple for developers to add intelligence to apps. Full-text indexes are automatically managed within the Couchbase cluster, avoiding the delay, overhead, and complexity of managing a separate full-text search product and infrastructure.

FTS enables you to create, manage, and query full-text indexes on JSON documents stored in a Couchbase bucket. It provides powerful capabilities for natural language queries, including:

  • Stemming, which provides a language-aware manner of searching (e.g., users can type "beauties" and find results for "beauty")
  • Scoring, which provides relevance ranking for results
  • Fast multipurpose indexes where a single index can support a wide range of possible text searches 
     
Full Text Search FTS
expand icon Expand

In the Couchbase Mobile 2.0 release, Full Text Search has also been added to Couchbase Lite. This allows mobile application developers to incorporate device-local FTS queries and intelligence into their mobile applications. 

Indexing

An index is a data structure that provides a quick and efficient means to query and access all your data without scanning every document. Applications can query Couchbase Server in one of the following ways:

  • Using key-value access – Applications directly access data through the data service with document keys for fastest access
  • Using N1QL – Applications use SQL-like syntax with global secondary indexes or MapReduce views to speed up queries
  • Using Couchbase View API directly – Applications directly query the MapReduce view indexes or spatial views for purpose-built precomputed indexes

Key Value

Customer experience depends on app performance and behavior, which in turn depends largely on database performance and throughput.

At the heart of the Couchbase Data Platform is a distributed key-value (KV) data store. It’s an extremely simple, lightning fast, schemaless data management system that stores a unique ID (key) and a piece of arbitrary information (value). The key is hashed by the Couchbase client library, automatically sharded, and directly sent to the appropriate data service node in the Couchbase cluster. 

The KV store is accessed using simple create, read, update, delete (CRUD) APIs, and thus provides a simpler interface when accessing documents using their IDs (primary keys). Due to their simplicity, KV operations execute with extremely low latency, often sub-millisecond.

Applications can access data stored in the Couchbase Data Platform using a variety of interfaces, including the KV API, MapReduce views, N1QL queries, Full Text Search, and the Analytics Service. For simple CRUD operations using the primary key, the KV API is the fastest and most efficient way of accessing the data. 

Mobile

Couchbase gives you a full-stack data platform for your mobile and IoT apps, including built-in real-time data synchronization, enterprise-level security, and data integration with your existing ecosystem.

Your mobile and IoT apps leverage the full power of the Couchbase Data Platform by using Couchbase Server, Couchbase Sync Gateway, and Couchbase Lite to enable secure online and offline data access, as well as automatic data synchronization from device to the backend.

Data integration APIs let you integrate with your existing systems of record, data warehouses, and other legacy systems via Sync Gateway or Couchbase Server.

mobile iot design
expand icon Expand

Whether you have hundreds, thousands, or millions of devices, Couchbase Server and Sync Gateway are independently scalable in real time, enabling you to keep up with changing demands.

Big Data and SQL Integrations

Rich, immersive apps need to leverage data across the entire data management ecosystem, including SQL and big data databases and tools. Couchbase includes built-in big data and SQL integration to allow you to build intelligent apps in less time by leveraging your tools, processing capacity, and data – wherever it may reside.

Big data integration is provided via high-performance scalable connectors for Hadoop, Kafka, Spark, and Elasticsearch that leverage the latest advances and features available in these rapidly emerging technologies.

SQL integration is enabled in a couple of different ways. The JDBC and ODBC drivers by Simba and the ODBC, JDBC, ADO.NET, OData, SSIS, BizTalk, and Excel drivers by CData allow you to use any standards-compliant tool with Couchbase. Couchbase also provides instructions and connector technology for specific BI, visualization, and ETL tools, including Tableau, Qlik, SlamData, Knowi, Excel, Power BI, Looker, Informatica, Talend, TIBCO, and many others.

Unified Programming Model

Couchbase gives you simple connectors and tools and uniform application development APIs across multiple programming languages, making it easier to build applications and reducing your time to market. Are you a Mobile or IoT developer? Couchbase lets you seamlessly move data from the datacenter to the cloud and the edge.

The Couchbase SDKs provide native support for synchronous, asynchronous, and event-driven programming models in the languages that support them. A set of Server and Mobile REST APIs are also available for queries, system configuration, and administration.

Additional SDKs – including specific API implementations and SDKs for Java, PHP, Ruby, Erlang, Perl, TCL, and ColdFusion – are available from the open source community. For more information, see the open source projects from the community list

Full-stack Security

Although security is fairly standard in the relational database world, in the NoSQL world it varies significantly from product to product.

With Couchbase, your data is secure everywhere – on the wire, on the device, in the cloud, and in the datacenter. The Couchbase Data Platform provides built-in and configurable full-stack security for authentication, authorization, encryption over the wire, and auditing. Via our technology partners, we also provide encryption, data masking, and field-level security.

Container and Cloud Deployments

A cloud-first strategy is key to constant innovation and the ability to respond to fast-changing business needs. However, a successful cloud-first strategy must weigh the options of public, private, hybrid, and multi-cloud deployments, while trying to avoid vendor lock-in and unforeseen operational issues.

The Couchbase Data Platform is cloud-native and architected to work on any cloud. Differentiated functionality like auto-sharding, shared-nothing, memory-first architecture, Multi-Dimensional Scaling, cross datacenter replication (XDCR), zone- and region-aware replication, and a cloud-based Sync Gateway make Couchbase uniquely suited for cloud deployments.

Couchbase provides easily deployed pre-built modules on AWS, Google Cloud Platform, and Microsoft Azure marketplaces. Couchbase also supports a variety of container and virtualization technologies, including partnerships with Joyent, Docker, and Red Hat OpenShift, to enable operational excellence across any kind of public, private, hybrid, or multi-cloud deployment. 

couchbase_wheel_animation_loader
Loading....

Get started

  • Server
  • Mobile
Couchbase Server
Download Couchbase Server
  • Enterprise
  • Community
Compare
Couchbase Server 6.0.0 Enterprise

Couchbase Server 6.0 Enterprise Edition is a full-featured NoSQL Database available free of charge for unlimited pre-production development and testing, with support from our Couchbase Forums. Built on the most powerful NoSQL technology, Couchbase Server gives you the flexibility to constantly reinvent the customer experience. Experience unmatched agility, flexibility, and unparalleled performance on the easiest platform to manage, all risk-free as you revolutionize and deploy your mission-critical applications. Note: Enterprise and Community editions are largely API compatible, so if you later decide you do not need enterprise-grade features and support, you can deploy on Community Edition.

Couchbase Server 6.0 was released in October 2018.  This release brings you the latest in the Couchbase Analytics offering – with this release, start crunching real-time query results using N1QL for Analytics – No ETL required! Eventing and Full-text Search also have significant updates that we know you will enjoy. Read more to learn about the latest new features.
 

Couchbase Server 6.0.0 Community

Couchbase Server 6.0 Community Edition is the open source version of our non-proprietary data platform. It is supported by the community on Couchbase Forums, and is best suited for non-enterprise developers or non-commercial development where basic availability, performance, tooling, and query is sufficient. The Community Edition is available free of charge for both development and production, but is not subjected to the same rigorous "test, fix, and verify" quality assurance cycle as the Enterprise Edition, and is generally released several months behind Enterprise Edition.

Code Intro
Code Intro
                                                                                                Read
                                                                                              // Get (Sync)
  JsonDocument myAirline = bucket.get("airline_5209");

  // Get (Async)
  Observable<JsonDocument>  myAirline = bucket.async().get("airline_5209"); // async using RxJava Observables!
                                                                                                Write
                                                                                              // Insert (Sync)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  JsonDocument stored = bucket.upsert(JsonDocument.create("walter", passenger));

  // Insert (Async)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  Observable<JsonDocument> stored = bucket.async().upsert(JsonDocument.create("walter", passenger));

  // Upsert (Sync)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  JsonDocument stored = bucket.upsert(JsonDocument.create("walter", passenger));

  // Upsert (Async)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  Observable<JsonDocument> stored = bucket.upsert(JsonDocument.create("walter", passenger));

  // Replace (Sync)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  JsonDocument replaced = bucket.replace(JsonDocument.create("walter", passenger));

  // Replace (Async)
  JsonObject passenger = JsonObject.empty()
  .put("firstname", "Walter")
  .put("lastname", "White");
  Observable<JsonDocument> walter2 = bucket.async().replace(JsonDocument.create("walter", passenger));
                                                                                                Query
                                                                                              // Query (String)
  Observable<AsyncN1qlQueryResult> theAirline = bucket
         .query(N1qlQuery
         .simple("SELECT name FROM `travel-sample` AS Airline WHERE id = 5209"));

  // Query (fluent API)
  Observable<AsyncN1qlQueryResult> theAirline = bucket
         .async()
         .query(N1qlQuery.simple(
           select("name")
             .from("travel-sample")
             .as("Airline")
             .where(x("id")
             .eq(5209))));
																					
                                                                                                Read
                                                                                              // Get Document
  bucket.get("walter", function (err, resRead) {/* handle results */});
                                                                                                Write
                                                                                              // Insert
  var key = "walter";
  bucket.insert(key, {firstname: "Walter", lastname: "White"},function(err, res) {/* handle results */});

  // Upsert
  var key = "walter";
  bucket.upsert(key, {firstname: "Walter", lastname: "White"},function(err, res) {/* handle results */});

  // Replace
  var key = "walter";
  bucket.replace(key, {firstname: "Walter", lastname: "White"},function(err, res) {/* handle results */});
                                                                                                Query
                                                                                              // Query (String)
  var N1qlQuery = couchbase.N1qlQuery;
  var query = N1qlQuery.fromString("SELECT name FROM `travel-sample` AS Airline WHERE id = 5209");
  bucket.query(query,function(err,result){/* handle results */});
																					
                                                                                                Read
                                                                                              // Get
  $res = $myBucket->get(‘document_name’);
                                                                                                Write
                                                                                              // Insert
  $res = $myBucket->insert('document_name', array('some'=>'value'));

  // Upsert
  $res = $myBucket->upsert('document_name', array('some'=>'value'));

  // Replace
  $res = $myBucket->replace('document_name', array('some'=>'value'));
                                                                                                Query
                                                                                              // Query (String)
  $myBucket->enableN1ql(array('http://1.1.1.1:8093/','http://1.1.1.2:8093/'));
  $query = CouchbaseN1qlQuery::fromString('SELECT * FROM default');
																					
                                                                                                Read
                                                                                              ' Get (Sync)
  var result = bucket.GetDocument("airline_5209");
                                                                                                Write
                                                                                              ' Insert (Sync)

  var passenger = new Document() {
   Firstname = "Walter",
   Lastname = "White"
  };
  bucket.Insert(passenger);

' Upsert (Sync)

  var passenger = new Document() {
   Firstname = "Walter",
   Lastname = "White"
  };
  bucket.Upsert(passenger);

  ' Replace (Sync)

  var passenger = new Document() {
   Firstname = "Walter",
   Lastname = "White"
  };
  bucket.Replace(doc);
                                                                                                Query
                                                                                              ' Query (String)
  var query = new QueryRequest("SELECT name FROM `travel-sample` AS Airline WHERE id = 5209");

  ' Query (using LINQ)

   var airlinesQuerySyntax = (
     from fromAirport in ClusterHelper.GetBucket(CouchbaseConfigHelper.Instance.Bucket).Queryable<Airport>()
     where fromAirport.Airportname == @from
     select new { fromAirport = fromAirport.Faa, geo = fromAirport.Geo })
         .ToList() // need to execute the first part of the select before call to Union
         .Union<dynamic>(
             from toAirport in ClusterHelper.GetBucket(CouchbaseConfigHelper.Instance.Bucket).Queryable<Airport>()
             where toAirport.Airportname == to
             select new { toAirport = toAirport.Faa, geo = toAirport.Geo });
																					
                                                                                                Read
                                                                                              # Get
  rv = bucket.get('document_name')
                                                                                                Write
                                                                                              # Insert
  rv = bucket.insert('document_name', {'some': 'value'})

  # Upsert
  rv = bucket.upsert('document_name', {'some': 'value'})

  # Replace
  rv = bkt.replace('document_name', {'some':'newvalue'}
                                                                                                Query
                                                                                              # Query (Simple)
  for row in bkt.n1ql_query('SELECT * FROM default'):

  # Query (Placeholders)
  q = N1QLQuery('SELECT fname, lname, age FROM default WHERE age > $age', age=22)
  for row in bkt.n1ql_query(q):
     ...
																					
                                                                                                Read
                                                                                              // Get
  cas, err := myBucket.Get("document_name", &myValue)
                                                                                                Write
                                                                                              // Insert
  cas, err := myBucket.Insert("document_name", &myDoc, 0)

  // Upsert
  cas, err := myBucket.Upsert("document_name", &myDoc, 0)

  // Replace
  cas, err := myBucket.Replace("document_name", &testValue, 0, 0)
                                                                                                Query
                                                                                              // Query (String)
  myQuery := gocb.NewN1qlQuery("SELECT * FROM default")
  rows, err := myBucket.ExecuteN1qlQuery(myQuery)
																					
Download Couchbase

Download Couchbase Server

Code Intro

Code Intro

Download Couchbase Mobile
Download Couchbase Mobile
  • Enterprise
  • Community
Compare
Couchbase Lite 2.1.x Enterprise

Couchbase Lite 2.1.x Enterprise Edition extends the Couchbase Data Platform to the edge with a full-featured embedded database that supports key-value, query, full-text search, eventing, sync, and security -- both online and offline. It is available free of charge for unlimited pre-production development and testing, with support from our Couchbase Forums. Experience the unmatched agility, flexibility, and unparalleled performance on the easiest full-stack platform to manage, from the cloud to the edge, all risk-free as you revolutionize and deploy your mission-critical mobile applications. Note: Enterprise and Community editions are largely API compatible, so if you later decide you do not need enterprise-grade features and support, you can deploy on Community Edition. 

Couchbase Lite 2.1 was released in August 2018 with 2.1.1 being released in September 2018 for Swift and Objective-C. In addition to bug fixes, this release includes peer-to-peer synchronization, on-device data encryption, and much more.

Couchbase Lite 2.1.x Community

Couchbase Lite 2.1.x Community Edition is the open source version of our non-proprietary embedded database. It is supported by the community on Couchbase Forums, and is best suited for non-enterprise mobile developers or non-commercial development where basic availability, performance, tooling, and query is sufficient. The Community Edition is available free of charge for both development and production, but is not subjected to the same rigorous "test, fix, and verify" quality assurance cycle as the Enterprise Edition and is generally released several months behind Enterprise Edition.

  • Enterprise
  • Community
Compare
Sync Gateway 2.1.1 Enterprise

Couchbase Sync Gateway 2.1.1 Enterprise Edition provides seamless data synchronization from any cloud to the edge using WebSocket-based replication with fine-grained access control, enterprise-grade security, and elastic scalability. It is available free of charge for unlimited pre-production development and testing, with support from our Couchbase Forums. Experience the unmatched agility, flexibility, and unparalleled performance on the easiest platform to manage, all risk-free as you revolutionize and deploy your mission-critical mobile applications. Note: Enterprise and Community editions are largely API compatible, so if you later decide you do not need enterprise-grade features and support, you can deploy on Community Edition.

Couchbase Sync Gateway 2.1.1 was released in October 2018. Couchbase Sync Gateway 2.1.1 is the first maintenance release in the 2.1.x series and includes important bug fixes.

Sync Gateway 2.1.1 Community

Couchbase Sync Gateway 2.1.1 Community Edition is the open source version of our non-proprietary sync technology. It is supported by the community on Couchbase Forums, and is best suited for non-enterprise mobile developers or non-commercial development where basic availability, performance, tooling, and query is sufficient. The Community Edition is available free of charge for both development and production, but is not subjected to the same rigorous "test, fix, and verify" quality assurance cycle as the Enterprise Edition, and is generally released several months behind Enterprise Edition.

Code Intro
Code Intro
                                                                                              OPEN DATABASE
// Get the database (and create it if it doesn’t exist).
let database = try Database(name: "my-database")

ADD  DOCUMENT
let newTask = MutableDocument()
       .setString("John", forKey: "firstName")
try database.saveDocument(newTask)


READ AND UPDATE  DOCUMENT
 guard let document = database.document(withID: "xyz") else { return }
let mutableDocument = document.toMutable()
mutableDocument.setString("jonny", forKey: "firstName")
try database.saveDocument(mutableDocument)
     
DELETE DOCUMENT
 try database.deleteDocument(mutableDocument)

ENABLING SYNC
let url = URL(string: "ws://localhost:4984/db")!
var replConfig = ReplicatorConfiguration(withDatabase: database, targetURL: url)
replConfig.replicatorType = .pull
let replication = Replicator(withConfig: replConfig)
replication.start()

QUERY
let query = QueryBuilder
   .select(SelectResult.all())
   .from(DataSource.database(database))
 .where(Expression.property("firstName").equalTo(Expression.string("jonny")))
   .limit(10)
																					
                                                                                              OPEN DATABASE
CBLDatabase *database = [[CBLDatabase alloc] initWithName:@"my-database" error:&error];


ADD  DOCUMENT
CBLMutableDocument *newTask = [[CBLMutableDocument alloc] init];
[newTask setString:@"firstName" forKey:@"john"];
CBLDocument *saved = [database saveDocument:newTask error:&error];

READ/ UPDATE  DOCUMENT
CBLDocument *document = [database documentWithID:@"xyz"];
CBLMutableDocument *mutableDocument = [document toMutable];
[mutableDocument setString:@"jonny" forKey:@"firstName"];
[database saveDocument:mutableDocument error:&error];

DELETE  DOCUMENT
[database deleteDocument: doc error: &error];


ENABLING SYNC
NSURL *url = [NSURL URLWithString:@"ws://localhost:4984/db"];
CBLURLEndpoint *target = [[CBLURLEndpoint alloc] initWithURL: url];
CBLReplicatorConfiguration *config = [[CBLReplicatorConfiguration alloc] initWithDatabase:database target:target];
config.replicatorType = kCBLReplicatorTypePull;               
CBLReplicator *replicator = [[CBLReplicator alloc] initWithConfig:config];
[replicator start];


QUERY
CBLQuery *query = [CBLQueryBuilder select:@[[CBLQuerySelectResult all]]
                                    from:[CBLQueryDataSource database:database]
                      where:[[CBLQueryExpression property:@"firstName"]
equalTo:[CBLQueryExpression string:@"jonny"]]
   groupBy:nil having:nil orderBy:nil
   limit:[CBLQueryLimit limit:[CBLQueryExpression integer:10]]];
																					
                                                                                              OPEN DATABASE
// Get the database (and create it if it doesn’t exist).
DatabaseConfiguration config = new DatabaseConfiguration(/* Android Context*/ context);
Database database = new Database("my-database", config);


CREATE DOCUMENT
MutableDocument newTask = new MutableDocument();
newTask.setString("firstName", "john");

database.save(newTask);

READ/ UPDATE  DOCUMENT
Document document = database.getDocument("xyz");
MutableDocument mutableDocument = document.toMutable();
mutableDocument.setString("firstName", "jonny");
 database.save(mutableDocument);

DELETE DOCUMENT
database.delete ( document);


ENABLING SYNC
URI uri = new URI("ws://localhost:4984/db");
Endpoint endpoint = new URLEndpoint(uri);
ReplicatorConfiguration config = new ReplicatorConfiguration(database, endpoint);
config.setReplicatorType(ReplicatorConfiguration.ReplicatorType.PULL);
Replicator replication = new Replicator(config);
replication.start();

QUERY
Query query = QueryBuilder
       .select(SelectResult.expression(Meta.id),
               SelectResult.property("name"),
               SelectResult.property("type"))
       .from(DataSource.database(database))
       .where(Expression.property("firstName").equalTo(Expression.string("jonny")))
       .orderBy(Ordering.expression(Meta.id));
																					
                                                                                              OPEN DATABASE
// Get the database (and create it if it doesn’t exist).
 var database = new Database("my-database");


CREATE DOCUMENT
var dict = new Dictionary {
   ["firstName"] = "john"
};

var newTask = new MutableDocument(dict);
database.Save(newTask);


READ/ UPDATE  DOCUMENT
var newTask = database.GetDocument(“docId”).toMutable();
// We can directly access properties from the document object:
newTask.SetString("firstName", "jonny");
database.Save(newTask);

DELETE DOCUMENT
database.Delete(newTask);

ENABLE SYNC
var url = new Uri("ws://localhost:4984/db");
var replConfig = new ReplicatorConfiguration(database, url);
replConfig.ReplicatorType = ReplicatorType.Pull;
var replication = new Replicator(replConfig);
replication.Start();

QUERY
using(var query = QueryBuilder.Select(SelectResult.Property("name"))
   .From(DataSource.Database(database))
   .Where(Expression.Property("firstName").EqualTo(Expression.String("jonny")))
   .Limit(10))
																					
Sample Projects
Sample Projects

Couchbase Todo Training App: Step by Step

1. Couchbase Travel Sample Training App: A step-by-step walkthrough of all the various features of Couchbase 2.0 using a sample travel application. Available for Swift, Java (Android), and C# (UWP, Xamarin).

2. Todo Sample App: A started to-do task list app for iOS, Android, and Windows.

3. A Query Playground for iOS: Playground for testing the Couchbase Lite 2.0 Query and Full-Text Search (FTS) capabilities.

Download Couchbase Mobile

Download Couchbase Mobile

Code Intro

Code Intro

Sample Projects

Sample Projects

form close button

Start today!

Get started in a few easy steps and join the NoSQL movement today!

By checking this box you are agreeing to be updated on offers, products, and services from Couchbase. You can unsubscribe at any time. Please review our Privacy Policy for additional details.

View our Privacy Policy.

I agree to the License Agreement

5 reasons customers are making the switch.

How Couchbase beats MongoDB™

See How
Retail and eCommerce


Office Depot ensures seamless shopping by serving rich
product information from Couchbase at blazing speed.

See all retail and e-commerce customers

$1.5B+

online commerce
spa face mask selfie


Marriott relies on Couchbase to process billions of dollars
in reservations annually with 99.995% availability.

Learn more

13M

documents


Comcast uses Couchbase and a Customer 360 solution to deliver
better visibility and support across its lines of business.

See digital media customers

40+

million documents

61K

users
female doctor talking to kid

BD’s Briight offers patients an always-on personal
diabetes companion supported by Couchbase.

Learn more

24/7

assisted
care

+100K

users
tommy hilfiger customer

Powered by Couchbase, FICO’s fraud detection platform is No. 1
in the world and scores 65% of the world’s credit/debit cards.

See financial services customers

<1ms

response times

24x365

application uptime

Discover common use case patterns

Customer 360

Customer 360

Aggregate data collected from different sources in one platform to build a single view of your customer or business.

Catalog and Inventory

Catalog and Inventory

Publish new product and inventory content in real time and scale to millions of products and requests per second to present the right data at the right time.

Field Service

Field Service

Enable field employees with one platform to manage data from different sources, push that data to the edge, and ensure that data is available online and offline.

IoT Data Management

IoT Data Management

Manage, support, and drive real-time data insights at the edge with embedded and cloud databases, sync, and guaranteed data availability.

Why you need an Engagement Database powered by NoSQL