CouchDB

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

CouchDB

Todd Geist
Hello,

I am curious if anyone has worked with CouchDB and live code?

It has REST api so I know you can connect to it over the web. But I am
curios about using it embedding it in a Live Code app.  It has built in peer
to peer replication, and it runs on many Desktop and Mobile OSs, incuding
android and iOS.  This would make it an ideal database for building mobile
applications that sync either peer to peer or back to a central data store.

I wonder how one would go about embedding it?

Thanks

Todd




Todd Geist
------------------------------
geist interactive <http://www.geistinteractive.com>
805-419-9382
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

slylabs13
I don't think you can, directly. But if it has a way to access it via a shell, or if it is supported by ODBC then you can do it that way.

Bob


On May 13, 2011, at 6:53 AM, Todd Geist wrote:

> Hello,
>
> I am curious if anyone has worked with CouchDB and live code?
>
> It has REST api so I know you can connect to it over the web. But I am
> curios about using it embedding it in a Live Code app.  It has built in peer
> to peer replication, and it runs on many Desktop and Mobile OSs, incuding
> android and iOS.  This would make it an ideal database for building mobile
> applications that sync either peer to peer or back to a central data store.
>
> I wonder how one would go about embedding it?
>
> Thanks
>
> Todd
>
>
>
>
> Todd Geist
> ------------------------------
> geist interactive <http://www.geistinteractive.com>
> 805-419-9382
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Jeffrey Massung
In reply to this post by Todd Geist
Todd,

CouchDB (or Mongo, Riak, and other NoSQL alternatives) are excellent
databases in the right situation. I haven't used on with LC, but have used
CouchDB plenty. Their main benefits lie in A) no schema and B) replication.
If you have no need of either, then it might be more work to get working
than it's worth.

While most NoSQL solutions use a REST API to insert, select, update, etc.
the real trick is the JSON input and output through the HTTP protocol. So,
what you'd need to do is write a JSON library in LC for encoding and
decoding values. Once that's in place, everything else should be trivial.

## example encoding function... likely needs tweaked (doesn't handle
null/nil)
function encodeJSON pVal
  if pVal is true then
    return "true"
  elseif pVal is false then
    return "false"
  elseif isNumber(pVal) then
    return pVal
  elseif isArray(pVal) then
    local tObject = "{"

    repeat for each line tKey in the keys of pVal
      put quote & tKey & quote & ":" & encodeJSON pVal[tKey] & comma after
tObject
    end repeat

    return tObject & "}"
  end if

  return quote & pVal & quote
end encodeJSON

I don't have time to try and whip together an example decode, but it would
basically involve parsing JSON and creating either an array (from a JSON
object) or just returning the value (since everything in LC is a string).

After that it's just posting, getting, etc.

Jeff M.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Todd Geist
Thanks for the responses.


I believe there already is a JSON library in Live Code.  So that isn't the
main issue to me.  The main issue is how to get CouchDB bundled into a
standalone that runs on Desktops and Mobile devices. That is the part that I
have no idea how to do.  I am not even sure if it can be done.  Possiblly
through an external???

Todd




On Fri, May 13, 2011 at 8:51 AM, Jeff Massung <[hidden email]> wrote:

> Todd,
>
> CouchDB (or Mongo, Riak, and other NoSQL alternatives) are excellent
> databases in the right situation. I haven't used on with LC, but have used
> CouchDB plenty. Their main benefits lie in A) no schema and B) replication.
> If you have no need of either, then it might be more work to get working
> than it's worth.
>
> While most NoSQL solutions use a REST API to insert, select, update, etc.
> the real trick is the JSON input and output through the HTTP protocol. So,
> what you'd need to do is write a JSON library in LC for encoding and
> decoding values. Once that's in place, everything else should be trivial.
>
> ## example encoding function... likely needs tweaked (doesn't handle
> null/nil)
> function encodeJSON pVal
>  if pVal is true then
>    return "true"
>  elseif pVal is false then
>    return "false"
>  elseif isNumber(pVal) then
>    return pVal
>  elseif isArray(pVal) then
>    local tObject = "{"
>
>    repeat for each line tKey in the keys of pVal
>      put quote & tKey & quote & ":" & encodeJSON pVal[tKey] & comma after
> tObject
>    end repeat
>
>    return tObject & "}"
>  end if
>
>  return quote & pVal & quote
> end encodeJSON
>
> I don't have time to try and whip together an example decode, but it would
> basically involve parsing JSON and creating either an array (from a JSON
> object) or just returning the value (since everything in LC is a string).
>
> After that it's just posting, getting, etc.
>
> Jeff M.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


Todd Geist
------------------------------
geist interactive <http://www.geistinteractive.com>
805-419-9382
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Andre Garzia-3
Todd,

You should not try to bundle CouchDB.

CouchDB relies on Erlang OTB and friends, it is not something like SQLite
that you can embed. If you want some embedable solution look at Googles
LiveTable thing or some other key/value store but even so, those embedable
solutions will not present you with a REST interface, you will probably need
an external to talk to them. CouchDB and similar NoSQL are not built to be
used like components that you can simply carry around with your software,
just like MySQL and PostgreSQL, they are full servers. Packaging full
servers like that is not wise even though there are MAMP and LAMP pre
packaged solutions out there. You might be able to build them to a self
contained folder and carry all the needed libs or link static and whatever
but still, that was not what it was designed to do. If you want embedable
you'd better go with SQLite, BDB or Valentina and then build a schemaless
stuff on top of it.

Andre

On Fri, May 13, 2011 at 8:27 AM, Todd Geist <[hidden email]>wrote:

> Thanks for the responses.
>
>
> I believe there already is a JSON library in Live Code.  So that isn't the
> main issue to me.  The main issue is how to get CouchDB bundled into a
> standalone that runs on Desktops and Mobile devices. That is the part that
> I
> have no idea how to do.  I am not even sure if it can be done.  Possiblly
> through an external???
>
> Todd
>
>
>
>
> On Fri, May 13, 2011 at 8:51 AM, Jeff Massung <[hidden email]> wrote:
>
> > Todd,
> >
> > CouchDB (or Mongo, Riak, and other NoSQL alternatives) are excellent
> > databases in the right situation. I haven't used on with LC, but have
> used
> > CouchDB plenty. Their main benefits lie in A) no schema and B)
> replication.
> > If you have no need of either, then it might be more work to get working
> > than it's worth.
> >
> > While most NoSQL solutions use a REST API to insert, select, update, etc.
> > the real trick is the JSON input and output through the HTTP protocol.
> So,
> > what you'd need to do is write a JSON library in LC for encoding and
> > decoding values. Once that's in place, everything else should be trivial.
> >
> > ## example encoding function... likely needs tweaked (doesn't handle
> > null/nil)
> > function encodeJSON pVal
> >  if pVal is true then
> >    return "true"
> >  elseif pVal is false then
> >    return "false"
> >  elseif isNumber(pVal) then
> >    return pVal
> >  elseif isArray(pVal) then
> >    local tObject = "{"
> >
> >    repeat for each line tKey in the keys of pVal
> >      put quote & tKey & quote & ":" & encodeJSON pVal[tKey] & comma after
> > tObject
> >    end repeat
> >
> >    return tObject & "}"
> >  end if
> >
> >  return quote & pVal & quote
> > end encodeJSON
> >
> > I don't have time to try and whip together an example decode, but it
> would
> > basically involve parsing JSON and creating either an array (from a JSON
> > object) or just returning the value (since everything in LC is a string).
> >
> > After that it's just posting, getting, etc.
> >
> > Jeff M.
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> Todd Geist
> ------------------------------
> geist interactive <http://www.geistinteractive.com>
> 805-419-9382
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Ruslan Zasukhin-2
On 5/13/11 11:08 PM, "Andre Garzia" <[hidden email]> wrote:

> If you want embedable
> you'd better go with SQLite, BDB or Valentina and then build a schemaless
> stuff on top of it.

Note, that Valentina DB from yet 1998 year offers
Very reach NON-SQL API.

And V4REV - Valentina for Revolution/Livecode have it.


Just I am not sure, that string-based livecode language is best choice for
such kinds of API.


--
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Todd Geist
Thanks again for more responses

But my interest in couchDB is about getting  a database with built in world
class synchronization.

If it can be embedded in iOS apps and Android apps why can't it be embedded
in LiveCode apps.

Thanks

Todd

On Fri, May 13, 2011 at 2:07 PM, Ruslan Zasukhin <
[hidden email]> wrote:

> On 5/13/11 11:08 PM, "Andre Garzia" <[hidden email]> wrote:
>
> > If you want embedable
> > you'd better go with SQLite, BDB or Valentina and then build a schemaless
> > stuff on top of it.
>
> Note, that Valentina DB from yet 1998 year offers
> Very reach NON-SQL API.
>
> And V4REV - Valentina for Revolution/Livecode have it.
>
>
> Todd Geist
------------------------------
geist interactive <http://www.geistinteractive.com>
805-419-9382
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Andre Garzia-3
Todd,

You are mixing CouchDB Server with Mobile Couchbase. Mobile Couchbase (
http://www.couchbase.com/products-and-services/mobile-couchbase ) is a
product that will basically synchronizes your data on your device, it is not
a full featured CouchDB server but hey, mobile couchbase is a wonderful
product and it has a good use. I think mobile couchbase could be made into
an external with the new external API. This way, your application would be
able to syncronize and cache data from a CouchDB server.

but my opinion stands, can't embed CouchDB. Mobile couchbase might be what
you need.

On Fri, May 13, 2011 at 11:14 AM, Todd Geist <[hidden email]>wrote:

> Thanks again for more responses
>
> But my interest in couchDB is about getting  a database with built in world
> class synchronization.
>
> If it can be embedded in iOS apps and Android apps why can't it be embedded
> in LiveCode apps.
>
> Thanks
>
> Todd
>
> On Fri, May 13, 2011 at 2:07 PM, Ruslan Zasukhin <
> [hidden email]> wrote:
>
> > On 5/13/11 11:08 PM, "Andre Garzia" <[hidden email]> wrote:
> >
> > > If you want embedable
> > > you'd better go with SQLite, BDB or Valentina and then build a
> schemaless
> > > stuff on top of it.
> >
> > Note, that Valentina DB from yet 1998 year offers
> > Very reach NON-SQL API.
> >
> > And V4REV - Valentina for Revolution/Livecode have it.
> >
> >
> > Todd Geist
> ------------------------------
> geist interactive <http://www.geistinteractive.com>
> 805-419-9382
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Todd Geist
Hello Andre,

Mobile Couchbase is a slimmed down small as possible version of CouchBase.
 It is still written in Erlang.  And it still based on Apache CouchDB.  I
think they are much more like different distros  of the same application,
then they are different applications.

Again, I don't really care if it was written in Old English,  :>)

What care about is the Synchronization. And if mobile CouchBase can be
turned into an external for Live Code I think that would be a very good
thing.  Especially for the mobile platform.


Todd

On Fri, May 13, 2011 at 2:51 PM, Andre Garzia <[hidden email]> wrote:

> Todd,
>
> You are mixing CouchDB Server with Mobile Couchbase. Mobile Couchbase (
> http://www.couchbase.com/products-and-services/mobile-couchbase ) is a
> product that will basically synchronizes your data on your device, it is
> not
> a full featured CouchDB server but hey, mobile couchbase is a wonderful
> product and it has a good use. I think mobile couchbase could be made into
> an external with the new external API. This way, your application would be
> able to syncronize and cache data from a CouchDB server.
>
> but my opinion stands, can't embed CouchDB. Mobile couchbase might be what
> you need.
>
> On Fri, May 13, 2011 at 11:14 AM, Todd Geist <[hidden email]
> >wrote:
>
> > Thanks again for more responses
> >
> > But my interest in couchDB is about getting  a database with built in
> world
> > class synchronization.
> >
> > If it can be embedded in iOS apps and Android apps why can't it be
> embedded
> > in LiveCode apps.
> >
> > Thanks
> >
> > Todd
> >
> > On Fri, May 13, 2011 at 2:07 PM, Ruslan Zasukhin <
> > [hidden email]> wrote:
> >
> > > On 5/13/11 11:08 PM, "Andre Garzia" <[hidden email]> wrote:
> > >
> > > > If you want embedable
> > > > you'd better go with SQLite, BDB or Valentina and then build a
> > schemaless
> > > > stuff on top of it.
> > >
> > > Note, that Valentina DB from yet 1998 year offers
> > > Very reach NON-SQL API.
> > >
> > > And V4REV - Valentina for Revolution/Livecode have it.
> > >
> > >
> > > Todd Geist
> > ------------------------------
> > geist interactive <http://www.geistinteractive.com>
> > 805-419-9382
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
>
> --
> http://www.andregarzia.com All We Do Is Code.
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


Todd Geist
------------------------------
geist interactive <http://www.geistinteractive.com>
805-419-9382
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: CouchDB

Andre Garzia-3
Todd,

when the new external sdk is release, I am sure someone will be able to wrap
it. :-D

cheers
andre

On Fri, May 13, 2011 at 12:19 PM, Todd Geist <[hidden email]>wrote:

> Hello Andre,
>
> Mobile Couchbase is a slimmed down small as possible version of CouchBase.
>  It is still written in Erlang.  And it still based on Apache CouchDB.  I
> think they are much more like different distros  of the same application,
> then they are different applications.
>
> Again, I don't really care if it was written in Old English,  :>)
>
> What care about is the Synchronization. And if mobile CouchBase can be
> turned into an external for Live Code I think that would be a very good
> thing.  Especially for the mobile platform.
>
>
> Todd
>
> On Fri, May 13, 2011 at 2:51 PM, Andre Garzia <[hidden email]>
> wrote:
>
> > Todd,
> >
> > You are mixing CouchDB Server with Mobile Couchbase. Mobile Couchbase (
> > http://www.couchbase.com/products-and-services/mobile-couchbase ) is a
> > product that will basically synchronizes your data on your device, it is
> > not
> > a full featured CouchDB server but hey, mobile couchbase is a wonderful
> > product and it has a good use. I think mobile couchbase could be made
> into
> > an external with the new external API. This way, your application would
> be
> > able to syncronize and cache data from a CouchDB server.
> >
> > but my opinion stands, can't embed CouchDB. Mobile couchbase might be
> what
> > you need.
> >
> > On Fri, May 13, 2011 at 11:14 AM, Todd Geist <[hidden email]
> > >wrote:
> >
> > > Thanks again for more responses
> > >
> > > But my interest in couchDB is about getting  a database with built in
> > world
> > > class synchronization.
> > >
> > > If it can be embedded in iOS apps and Android apps why can't it be
> > embedded
> > > in LiveCode apps.
> > >
> > > Thanks
> > >
> > > Todd
> > >
> > > On Fri, May 13, 2011 at 2:07 PM, Ruslan Zasukhin <
> > > [hidden email]> wrote:
> > >
> > > > On 5/13/11 11:08 PM, "Andre Garzia" <[hidden email]> wrote:
> > > >
> > > > > If you want embedable
> > > > > you'd better go with SQLite, BDB or Valentina and then build a
> > > schemaless
> > > > > stuff on top of it.
> > > >
> > > > Note, that Valentina DB from yet 1998 year offers
> > > > Very reach NON-SQL API.
> > > >
> > > > And V4REV - Valentina for Revolution/Livecode have it.
> > > >
> > > >
> > > > Todd Geist
> > > ------------------------------
> > > geist interactive <http://www.geistinteractive.com>
> > > 805-419-9382
> > > _______________________________________________
> > > use-livecode mailing list
> > > [hidden email]
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> >
> > --
> > http://www.andregarzia.com All We Do Is Code.
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> Todd Geist
> ------------------------------
> geist interactive <http://www.geistinteractive.com>
> 805-419-9382
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



--
http://www.andregarzia.com All We Do Is Code.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode