is CounchDB mobile supported (or will be in future)?

Hi All, 

I was wondering if there is (or will be) support for any NoSQL local mobile databases, for example CouchDB Mobile: http://docs.couchbase.com/couchbase-lite/

Any pointers will be appreciated. 

Cheers,

Anshuman

It is not supported for Corona SDK.  After looking at it, I don’t see why any Corona Enterprise subscribers could not get it working.  It’s something that could possibly be turned into a plugin as well, but until we get the Marketplace setup, plugins created by subscribers can only be used by other Enterprise subscribers.

I don’t know if you want to reach out to the creators of ConchDB and see if they would be interested in developing a plugin for the community or not.  You can also go to http://feedback.coronalabs.com and fill out a feature request for it there and get it voted up and if enough people vote for it, then it’s something Engineering might consider adding.

Rob

Thanks Rob

It is not supported for Corona SDK.  After looking at it, I don’t see why any Corona Enterprise subscribers could not get it working.  It’s something that could possibly be turned into a plugin as well, but until we get the Marketplace setup, plugins created by subscribers can only be used by other Enterprise subscribers.

I don’t know if you want to reach out to the creators of ConchDB and see if they would be interested in developing a plugin for the community or not.  You can also go to http://feedback.coronalabs.com and fill out a feature request for it there and get it voted up and if enough people vote for it, then it’s something Engineering might consider adding.

Rob

Thanks Rob

@anchuman, did you ever submit a feature request for this? A nosql database for Corona would be a massive win for everyone. Please post the link with your proposal and I’ll give you my upvote.

Have added it to the feature request list now: http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/7237698-nosql-couchbase-couchdb

Cheers

I am happily saving to www.cloudant.com, I have code in the code exchange.

Cloudant DBaaS 101

and 

Saving to Cloudant DBaaS from Corona SDK

Cloudant.com (CouchDB) is ridiculously simple, cheap and easy to setup.

Also if you need to fill a Couch DB with sample data from say a php web server check out this code:

https://github.com/dready92/PHP-on-Couch/blob/master/doc/couch_client-database.md

My quick script here (yes, I should not have the tokens in the url).

\<?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header('Content-Type: text/html; charset=utf-8'); $startTime = microtime(true); $time\_now = time(); //epoch time // Help: https://github.com/dready92/PHP-on-Couch/blob/master/doc/couch\_client-database.md include('couch.php');include('couchClient.php');include('couchDocument.php'); try { $client = new couchClient ('https://youruseridapitoken:youruserapipassword@yourcloudaccount.cloudant.com','tablename'); $doc = new couchDocument($client); $doc-\>set( array( 'event\_title'=\>"Title goes here", 'event\_text'=\>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'event\_lon'=\>"150.1", 'event\_lat'=\>"-31.1", 'event\_datetime\_utc\_epoch'=\>"$time\_now" ); echo 'Saved Record ID: ' . $doc-\>\_id ; } catch (Exception $e) { echo "Error: ".$e-\>getMessage()."\<BR\>\n"; } echo "\<br /\>\<br /\>Elapsed time is: ". (microtime(true) - $startTime) ." seconds"; ?\>

I have pumped thousands of records into my test databases and the bill is 0.44c (but bills are free if you use less than $50 a month free).

I was going to use a shared hosting plan with PHP and MySQL to store data but scalability and speed encouraged me to use CouchDB.

Im in Australia and I can save a fair sized record into a West US coast server in under 600ms.  Cloudant allows you to move your database around the world (europe, Singapore, east/west coast of america (bit not Australia yet). 

I know I am banging on about Cloudant.com but they are great value and have excellent support.  The Live chat was helpful, they even Skyped me and talked me through many things for free.  They have heaps of free webinars too.

How:

  1. Signup for an account: https://cloudant.com/sign-up/

  2. Review my blog posts to shortcut saving to Cloudant from Corona.

  3. Consider the book https://pragprog.com/book/rwdata/seven-databases-in-seven-weeks

  4. Consider buying this course (often discounts to $30)

  5. Create a database on cloudant (you get many GB’s free and hundreds of thousands of reads/writes free a month).

  6. Read the documentation: https://cloudant.com/for-developers/crud/

  7. Create a database, follow the crud demos (using curl and php).

  8. Switch to Corona CRUD operations.

  9. Secure

  10. Optimize.

Best of luck.

Because CouchDB is all HTTP based you can switch to other providers or use local Couch Servers during development.

Hi FearTec, 

Thanks for all the info, good to know about the online hosted NoSQL option.

However, this thread was to enquire about “local on-mobile” NoSQL options for the App (apart from the usual onboard Sqlite). 

Cheers

Right you are (sorry I did not notice the “local” bit in your post).

I use sqllite3 (I’d imagine it would be good enough for most scenarios locally)?

http://docs.coronalabs.com/daily/api/library/sqlite3/index.html

Anshuman, I just upvoted your feature request.

Feartec, while I too was looking forward for a local solution and I too use sqlite3 for pretty much all my Corona stuff, I wasn’t aware of Cloudant. Thanks for posting.

Cheers chillfok

@anchuman, did you ever submit a feature request for this? A nosql database for Corona would be a massive win for everyone. Please post the link with your proposal and I’ll give you my upvote.

Have added it to the feature request list now: http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/7237698-nosql-couchbase-couchdb

Cheers

I am happily saving to www.cloudant.com, I have code in the code exchange.

Cloudant DBaaS 101

and 

Saving to Cloudant DBaaS from Corona SDK

Cloudant.com (CouchDB) is ridiculously simple, cheap and easy to setup.

Also if you need to fill a Couch DB with sample data from say a php web server check out this code:

https://github.com/dready92/PHP-on-Couch/blob/master/doc/couch_client-database.md

My quick script here (yes, I should not have the tokens in the url).

\<?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header('Content-Type: text/html; charset=utf-8'); $startTime = microtime(true); $time\_now = time(); //epoch time // Help: https://github.com/dready92/PHP-on-Couch/blob/master/doc/couch\_client-database.md include('couch.php');include('couchClient.php');include('couchDocument.php'); try { $client = new couchClient ('https://youruseridapitoken:youruserapipassword@yourcloudaccount.cloudant.com','tablename'); $doc = new couchDocument($client); $doc-\>set( array( 'event\_title'=\>"Title goes here", 'event\_text'=\>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'event\_lon'=\>"150.1", 'event\_lat'=\>"-31.1", 'event\_datetime\_utc\_epoch'=\>"$time\_now" ); echo 'Saved Record ID: ' . $doc-\>\_id ; } catch (Exception $e) { echo "Error: ".$e-\>getMessage()."\<BR\>\n"; } echo "\<br /\>\<br /\>Elapsed time is: ". (microtime(true) - $startTime) ." seconds"; ?\>

I have pumped thousands of records into my test databases and the bill is 0.44c (but bills are free if you use less than $50 a month free).

I was going to use a shared hosting plan with PHP and MySQL to store data but scalability and speed encouraged me to use CouchDB.

Im in Australia and I can save a fair sized record into a West US coast server in under 600ms.  Cloudant allows you to move your database around the world (europe, Singapore, east/west coast of america (bit not Australia yet). 

I know I am banging on about Cloudant.com but they are great value and have excellent support.  The Live chat was helpful, they even Skyped me and talked me through many things for free.  They have heaps of free webinars too.

How:

  1. Signup for an account: https://cloudant.com/sign-up/

  2. Review my blog posts to shortcut saving to Cloudant from Corona.

  3. Consider the book https://pragprog.com/book/rwdata/seven-databases-in-seven-weeks

  4. Consider buying this course (often discounts to $30)

  5. Create a database on cloudant (you get many GB’s free and hundreds of thousands of reads/writes free a month).

  6. Read the documentation: https://cloudant.com/for-developers/crud/

  7. Create a database, follow the crud demos (using curl and php).

  8. Switch to Corona CRUD operations.

  9. Secure

  10. Optimize.

Best of luck.

Because CouchDB is all HTTP based you can switch to other providers or use local Couch Servers during development.

Hi FearTec, 

Thanks for all the info, good to know about the online hosted NoSQL option.

However, this thread was to enquire about “local on-mobile” NoSQL options for the App (apart from the usual onboard Sqlite). 

Cheers