Difference between couchbase and couchbase lite? [

2020-07-22 18:30发布

问题:

What is Couchbase and what is Couchbase Lite? Is there any difference between the two? How could I create couchbase lite in mobile and how could i communicate to a server?

回答1:

Do you happen to know about CouchDB? I don't know how far apart couchdb and couchbase are at the moment but I think very far. What I've understood so far is, Couchbase, Inc took the couchdb code and decided that they wanted to focus on speed.

One of the most difficult parts (speed wise) of couchdb is the synchronisation, so they dropped the synchronisation. Then they began restructuring the code to focus on speed and other issues their customers wanted (or what couchbase thinks potential customers want).

To add the ability to synchronise they started developing the sync gateway. Meantime, They developed TouchDB, a lightweight CouchDB-compatible database engine suitable for embedding into mobile apps. As mentioned in doc's, think of it this way: If CouchDB is MySQL, then TouchDB is SQLite. They used existing CouchCocoa framework to make the interaction between remote CouchDB server and local TouchDB. Later on, they improved the touchDB code to eliminate the use of CouchCocoa and also renamed touchDB into Couchbase-Lite (aka TouchDB 1.5). They wanted to make TouchDB, a real product (The presentation on this link might help you, Here).

They then started to alter CBL (aka touchdb 1.5) so it could work with the sync gateway (the only way a couchbase server can synchronise) and in the process make the synchronisation code in Couchbase-Lite better.

Replication is one of coolest thing CBL can do it for you.There are enough doc's on github repo to hit the road. If you are held up at some point, reach CBL's mailing list named 'Mobile Couchbase'. Perhaps, you can find few questions there which are similar to yours.

Hope that helps.



回答2:

Couchbase Lite is the renamed version of what was previously TouchDB.

It allows you to have database directly on mobile device storage... such as when you don't have access to the Internet or for performance reasons you want data local. It is available for Apple devices(IOS) and Android.

It can also replicate data to a full version of Couchbase. Even thought he code that runs the engine is not the same, the data replication format is compatible.



回答3:

Couchbase Lite is lightweight database engine for mobile applications mainly and small desktop applications ! you an see the following links :

https://github.com/couchbase/couchbase-lite-ios/wiki/Why-Couchbase-Lite%3F

https://groups.google.com/forum/#!forum/mobile-couchbase



回答4:

I think we should start here:

CouchDB, Couchbase and Cloudant

Today there are two major database companies that can trace their lineage back to Apache CouchDB: Couchbase and Cloudant. Both of them are separate products compared to CouchDB.

However, all three of these databases share the same CouchDB sync protocol.

Now Couchbase

Main Products: Couchbase Server, Sync Gateway, Couchbase Lite

"Couchbase Lite or Couchbase Mobile": creates a iOS/Android database on the device, accesible by default on http://localhost:5984. You can then replicate the local "Couchbase Lite" with other external Couchbase/CouchDB services. Couchbase Lite has native APIs, you normally work with those for native apps, rather than ReST calls. See http://developer.couchbase.com/mobile for details.

You also have LiteGap/Phone Gap Plugin that allows you to create and use a "Couchbase Lite" db in a PhoneGap project.

How to create a Couchbase Lite App

  1. Building your first "Couchbase Lite" Android app
  2. Building your first "Couchbase Lite" iOS app

PouchDB

Another interesting tool that worth to take a look is PouchDB : which is a JavaScript implementation of CouchDB. Its goal is to emulate the CouchDB API with near-perfect fidelity, while running in the browser or in Node.js.

More, a very nice answer about Differences between PouchDB and CouchBase Lite + LiteGap