Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Mobile

CouchDB on Android device

3 replies [Last post]
  • Login or register to post comments
Tue, 12/06/2011 - 03:38
SMarek
Offline
Joined: 12/06/2011
Groups: None

Hi,

I am really very interested into CouchDB on Android project. But unfortunately I haven't found big documentation or tutorials (which is obvious, as the project is still in hard development)

I've read few articles, and now I have few questions before I will start implementing this great DB :)

1) Is it still that CouchDB is installed on External SD memory?
2) What about memory requirements on device? How big it is in memory and on storage?
3) Is it good to use CouchDB with JSON data from REST API, not in combination with Couchbase on Server (which is main purpose of this project) ?

Thanks
Mark

Top
  • Login or register to post comments
Tue, 12/06/2011 - 09:01
mschoch
Offline
Joined: 08/03/2011
Groups: None

You are right, the documentation is still coming together. Right now the best example of a native application using Couchbase Mobile for Android is the GrocerySync project hosted here:

https://github.com/couchbaselabs/AndroidGrocerySync

Regarding your questions:

1. By default Couchbase Mobile stores the database in the device's external storage. However, this is configurable using the "database_dir" setting.
2. Memory usage is a bit more difficult to measure and interpret. One of the easier to measure numbers is PSS. This can vary from device to device, I usually see it between 15MB and 25MB. Where PSS is defined as "the amount of memory shared with other processes, accounted in a way that the amount is divided evenly between the processes that share it. This is memory that would not be released if the process was terminated, but is indicative of the amount that this process is "contributing" to the overall memory load." Generally speaking CouchDB's design is such that it relies on the operating system's disk cache rather than explicitly caching data.
In terms of space on disk, the compressed application size with a bare minimum Couchbase Mobile installation is around 4.2MB. Unpacked on the device after installation it takes around 10-12MB. After installation these numbers go up based on document/attachment and log storage.
3. I'm not sure I understand what you're asking in this question. Could you try to rephrase it?

Finally, I would recommend you join the Mobile Couchbase Google Group https://groups.google.com/forum/#!forum/mobile-couchbase By asking your questions there they are seen by a larger audience.

marty

Top
  • Login or register to post comments
Tue, 12/06/2011 - 12:00
SMarek
Offline
Joined: 12/06/2011
Groups: None

Oh, so glad somebody got attention to my post :)
Thanks marty

About my third question.

Do you think that it is worth to use CouchDB without using its primary goal, which is connection with server couchbase ?
I do currently think about using it as a storage for my REST API, where communication is done in JSON, so the Document-Based (not SQL-Based) Model is very cheap to use.

About your answer on second question

In this stage of project, is it already memory/storage optimized or this stage is yet to come? If i'd speak about memory use, today, most of devices, are capable of 128MB of memory and higher. So 20MB or so is very good value. But the storage space is very variable, and if I cannot rely on sufficient memory on SD card, I'd like to see I can use the application with CouchDB on device whether there is let's say 20MB of free space. Can you please do some kind of benchmarks and make some kind of "minimal hardware requirements to use Android version of CouchDB" after each stable version?

Is there any roadmap we can watch to see the progress of android version of Couch ?

Thanks for Mobile GG link, I will join there and take it as most reliable source of support.

And I will connect this thread, to thread on StackOverflow QA site, because both of my start messages are related to same questions.
http://stackoverflow.com/questions/8399070/what-are-requirements-to-use-...

Mark

Top
  • Login or register to post comments
Tue, 12/06/2011 - 12:22
mschoch
Offline
Joined: 08/03/2011
Groups: None

I would say that our focus right now is towards use cases where Couchbase Mobile is taking advantage of synchronization with Couchbase Server. But, the product is very young and I wouldn't want to discourage anyone from using it in a different way. It certainly works fine as just a local database without any replications being used.

The size of the download is mostly optimized right now. There are two opportunities I'm aware of for future optimization.

1. spidermonkey and snappy both statically link to the stdc++ library, having them both link to the same library dynamically would offer small (200k or so) savings
2. we would like to support design documents with Java as the implementation language, this would allow a version to be shipped without the spidermonkey javascript library (this would save ~2MB, but means giving up JavaScript) this would be optional, we are not planning to eliminate JavaScript at this time.

The memory usage of Couchbase at runtime is also mostly optimized, there is one garbage collection option we are still evaluating, which may reduce the memory footprint.

The space used on external storage is highly application dependent. Couchbase does use snappy compression on data stored to disk, but the best thing to do is to load your actual data and see how big database gets (remembering that you'll need to run compaction to keep the file as small as possible). I do know that some users have added code to monitor the space used in the database directory and use this to control their replication.

The iOS version recently got a roadmap here: http://www.couchbase.org/wiki/display/membase/Roadmap+for+iOS

Some of this is applicable to the Android version as well, but I would expect we will produce a roadmap for Android soon.

marty

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker