You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Justin Stanczak <ri...@gmail.com> on 2010/03/10 15:39:36 UTC

Server Side Language Confusion

I'm having a little trouble figuring out what to select as the server side
language for accessing CouchDB. I'm new to CouchDB so this paragraph will be
a long list of questions and sentences of how I understand things to this
point in time. Please feel free to correct me and help me better learn. I
like the idea of eliminating all the DB mapping and focus on programming
again, that CouchDB allows you to do. So I guess the first issue is you
don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as a
proxy, via some language. This language would provide the session tracking.
That session tracking would give you user logins and what not. This would
also restrict access to your CouchDB, as I don't see CouchDB has much in the
way of protection when it comes to access control to it's databases. This
leads to the issue of Javascript not being the language of choice for client
side, as you really don't want clients, duh. So now that's where my language
server side question comes from. What's a good option when using CouchDB? I
know everyone has their opinions, but really, if you are using CouchDB as
your back end database what language has been developed the most with
CouchDB? What works the best? Surely there is one that stands out over the
rest? Maybe I'm way off, any input is welcome, thanks.

Re: Server Side Language Confusion

Posted by kowsik <ko...@gmail.com>.
Yes, the included DB support is completely optional. You can just add
a new Couch.js module to the modules directory in Helma and
immediately have access to all Couch REST calls. You can also create a
views.js within your prototype directory (the URL mount-point) and
sync various Couch views directly from within Helma.

K.

On Wed, Mar 10, 2010 at 8:24 AM, Justin Stanczak <ri...@gmail.com> wrote:
> Ya, I've looked at Helma before. Can the included DB stuff be removed easy
> enough? I don't know much about it. I'm open to look at any language.
>
> On Wed, Mar 10, 2010 at 9:49 AM, kowsik <ko...@gmail.com> wrote:
>
>> Helma or node.js both work naturally with Couch. They are both
>> JavaScript servers and so getting and posting documents while sending
>> them upstream to the browser become very natural with little or no
>> translation. If you combine this with something like Sammy
>> (http://code.quirkey.com/sammy/) and jQuery, you can very rapidly
>> build a RESTful app with the rendering all on the browser side.
>>
>> Regards,
>>
>> K.
>>
>> On Wed, Mar 10, 2010 at 6:39 AM, Justin Stanczak <ri...@gmail.com>
>> wrote:
>> > I'm having a little trouble figuring out what to select as the server
>> side
>> > language for accessing CouchDB. I'm new to CouchDB so this paragraph will
>> be
>> > a long list of questions and sentences of how I understand things to this
>> > point in time. Please feel free to correct me and help me better learn. I
>> > like the idea of eliminating all the DB mapping and focus on programming
>> > again, that CouchDB allows you to do. So I guess the first issue is you
>> > don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as
>> a
>> > proxy, via some language. This language would provide the session
>> tracking.
>> > That session tracking would give you user logins and what not. This would
>> > also restrict access to your CouchDB, as I don't see CouchDB has much in
>> the
>> > way of protection when it comes to access control to it's databases. This
>> > leads to the issue of Javascript not being the language of choice for
>> client
>> > side, as you really don't want clients, duh. So now that's where my
>> language
>> > server side question comes from. What's a good option when using CouchDB?
>> I
>> > know everyone has their opinions, but really, if you are using CouchDB as
>> > your back end database what language has been developed the most with
>> > CouchDB? What works the best? Surely there is one that stands out over
>> the
>> > rest? Maybe I'm way off, any input is welcome, thanks.
>> >
>>
>

Re: Server Side Language Confusion

Posted by Justin Stanczak <ri...@gmail.com>.
Ya, I've looked at Helma before. Can the included DB stuff be removed easy
enough? I don't know much about it. I'm open to look at any language.

On Wed, Mar 10, 2010 at 9:49 AM, kowsik <ko...@gmail.com> wrote:

> Helma or node.js both work naturally with Couch. They are both
> JavaScript servers and so getting and posting documents while sending
> them upstream to the browser become very natural with little or no
> translation. If you combine this with something like Sammy
> (http://code.quirkey.com/sammy/) and jQuery, you can very rapidly
> build a RESTful app with the rendering all on the browser side.
>
> Regards,
>
> K.
>
> On Wed, Mar 10, 2010 at 6:39 AM, Justin Stanczak <ri...@gmail.com>
> wrote:
> > I'm having a little trouble figuring out what to select as the server
> side
> > language for accessing CouchDB. I'm new to CouchDB so this paragraph will
> be
> > a long list of questions and sentences of how I understand things to this
> > point in time. Please feel free to correct me and help me better learn. I
> > like the idea of eliminating all the DB mapping and focus on programming
> > again, that CouchDB allows you to do. So I guess the first issue is you
> > don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as
> a
> > proxy, via some language. This language would provide the session
> tracking.
> > That session tracking would give you user logins and what not. This would
> > also restrict access to your CouchDB, as I don't see CouchDB has much in
> the
> > way of protection when it comes to access control to it's databases. This
> > leads to the issue of Javascript not being the language of choice for
> client
> > side, as you really don't want clients, duh. So now that's where my
> language
> > server side question comes from. What's a good option when using CouchDB?
> I
> > know everyone has their opinions, but really, if you are using CouchDB as
> > your back end database what language has been developed the most with
> > CouchDB? What works the best? Surely there is one that stands out over
> the
> > rest? Maybe I'm way off, any input is welcome, thanks.
> >
>

Re: Server Side Language Confusion

Posted by kowsik <ko...@gmail.com>.
Helma or node.js both work naturally with Couch. They are both
JavaScript servers and so getting and posting documents while sending
them upstream to the browser become very natural with little or no
translation. If you combine this with something like Sammy
(http://code.quirkey.com/sammy/) and jQuery, you can very rapidly
build a RESTful app with the rendering all on the browser side.

Regards,

K.

On Wed, Mar 10, 2010 at 6:39 AM, Justin Stanczak <ri...@gmail.com> wrote:
> I'm having a little trouble figuring out what to select as the server side
> language for accessing CouchDB. I'm new to CouchDB so this paragraph will be
> a long list of questions and sentences of how I understand things to this
> point in time. Please feel free to correct me and help me better learn. I
> like the idea of eliminating all the DB mapping and focus on programming
> again, that CouchDB allows you to do. So I guess the first issue is you
> don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as a
> proxy, via some language. This language would provide the session tracking.
> That session tracking would give you user logins and what not. This would
> also restrict access to your CouchDB, as I don't see CouchDB has much in the
> way of protection when it comes to access control to it's databases. This
> leads to the issue of Javascript not being the language of choice for client
> side, as you really don't want clients, duh. So now that's where my language
> server side question comes from. What's a good option when using CouchDB? I
> know everyone has their opinions, but really, if you are using CouchDB as
> your back end database what language has been developed the most with
> CouchDB? What works the best? Surely there is one that stands out over the
> rest? Maybe I'm way off, any input is welcome, thanks.
>

Re: Server Side Language Confusion

Posted by Jo Giraerts <wh...@gmail.com>.
<?
$my_object = json_decode($data_from_couch);
$my_object->foo = 'bar';
$data_to_couch = json_encode($my_object);
?>

easy enough for me :)



On Wed, Mar 10, 2010 at 5:22 PM, Justin Stanczak <ri...@gmail.com> wrote:

> Do you find the JSON conversion easy with PHP, or is this just shoe fitting
> another mapping tool?
>
> On Wed, Mar 10, 2010 at 9:54 AM, Jo Giraerts <wh...@gmail.com> wrote:
>
> > In my case, i'm doing the development in PHP with a custom
> session-handler
> > that also uses couchdb as session-storage.
> > But couchdb is language-agnostic and since it's completely http-rest, you
> > can access it from any language that lets you access an url and is
> capable
> > of handling json - which is probably any language still in use today. So,
> > my
> > humble advice is just go with whatever language you are comfortable with
> > ;-)
> > if you're interested in my couchdb-session-handler, it's on github:
> > http://github.com/whachoe/Couchdb-PHP-Session-Handler
> >
> >
> >
> >
> > On Wed, Mar 10, 2010 at 3:39 PM, Justin Stanczak <ri...@gmail.com>
> > wrote:
> >
> > > I'm having a little trouble figuring out what to select as the server
> > side
> > > language for accessing CouchDB. I'm new to CouchDB so this paragraph
> will
> > > be
> > > a long list of questions and sentences of how I understand things to
> this
> > > point in time. Please feel free to correct me and help me better learn.
> I
> > > like the idea of eliminating all the DB mapping and focus on
> programming
> > > again, that CouchDB allows you to do. So I guess the first issue is you
> > > don't want your CouchDB exposed to the WWW, so you need a HTTPD to act
> as
> > a
> > > proxy, via some language. This language would provide the session
> > tracking.
> > > That session tracking would give you user logins and what not. This
> would
> > > also restrict access to your CouchDB, as I don't see CouchDB has much
> in
> > > the
> > > way of protection when it comes to access control to it's databases.
> This
> > > leads to the issue of Javascript not being the language of choice for
> > > client
> > > side, as you really don't want clients, duh. So now that's where my
> > > language
> > > server side question comes from. What's a good option when using
> CouchDB?
> > I
> > > know everyone has their opinions, but really, if you are using CouchDB
> as
> > > your back end database what language has been developed the most with
> > > CouchDB? What works the best? Surely there is one that stands out over
> > the
> > > rest? Maybe I'm way off, any input is welcome, thanks.
> > >
> >
>

Re: Server Side Language Confusion

Posted by Justin Stanczak <ri...@gmail.com>.
Do you find the JSON conversion easy with PHP, or is this just shoe fitting
another mapping tool?

On Wed, Mar 10, 2010 at 9:54 AM, Jo Giraerts <wh...@gmail.com> wrote:

> In my case, i'm doing the development in PHP with a custom session-handler
> that also uses couchdb as session-storage.
> But couchdb is language-agnostic and since it's completely http-rest, you
> can access it from any language that lets you access an url and is capable
> of handling json - which is probably any language still in use today. So,
> my
> humble advice is just go with whatever language you are comfortable with
> ;-)
> if you're interested in my couchdb-session-handler, it's on github:
> http://github.com/whachoe/Couchdb-PHP-Session-Handler
>
>
>
>
> On Wed, Mar 10, 2010 at 3:39 PM, Justin Stanczak <ri...@gmail.com>
> wrote:
>
> > I'm having a little trouble figuring out what to select as the server
> side
> > language for accessing CouchDB. I'm new to CouchDB so this paragraph will
> > be
> > a long list of questions and sentences of how I understand things to this
> > point in time. Please feel free to correct me and help me better learn. I
> > like the idea of eliminating all the DB mapping and focus on programming
> > again, that CouchDB allows you to do. So I guess the first issue is you
> > don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as
> a
> > proxy, via some language. This language would provide the session
> tracking.
> > That session tracking would give you user logins and what not. This would
> > also restrict access to your CouchDB, as I don't see CouchDB has much in
> > the
> > way of protection when it comes to access control to it's databases. This
> > leads to the issue of Javascript not being the language of choice for
> > client
> > side, as you really don't want clients, duh. So now that's where my
> > language
> > server side question comes from. What's a good option when using CouchDB?
> I
> > know everyone has their opinions, but really, if you are using CouchDB as
> > your back end database what language has been developed the most with
> > CouchDB? What works the best? Surely there is one that stands out over
> the
> > rest? Maybe I'm way off, any input is welcome, thanks.
> >
>

Re: Server Side Language Confusion

Posted by Jo Giraerts <wh...@gmail.com>.
In my case, i'm doing the development in PHP with a custom session-handler
that also uses couchdb as session-storage.
But couchdb is language-agnostic and since it's completely http-rest, you
can access it from any language that lets you access an url and is capable
of handling json - which is probably any language still in use today. So, my
humble advice is just go with whatever language you are comfortable with ;-)
if you're interested in my couchdb-session-handler, it's on github:
http://github.com/whachoe/Couchdb-PHP-Session-Handler




On Wed, Mar 10, 2010 at 3:39 PM, Justin Stanczak <ri...@gmail.com> wrote:

> I'm having a little trouble figuring out what to select as the server side
> language for accessing CouchDB. I'm new to CouchDB so this paragraph will
> be
> a long list of questions and sentences of how I understand things to this
> point in time. Please feel free to correct me and help me better learn. I
> like the idea of eliminating all the DB mapping and focus on programming
> again, that CouchDB allows you to do. So I guess the first issue is you
> don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as a
> proxy, via some language. This language would provide the session tracking.
> That session tracking would give you user logins and what not. This would
> also restrict access to your CouchDB, as I don't see CouchDB has much in
> the
> way of protection when it comes to access control to it's databases. This
> leads to the issue of Javascript not being the language of choice for
> client
> side, as you really don't want clients, duh. So now that's where my
> language
> server side question comes from. What's a good option when using CouchDB? I
> know everyone has their opinions, but really, if you are using CouchDB as
> your back end database what language has been developed the most with
> CouchDB? What works the best? Surely there is one that stands out over the
> rest? Maybe I'm way off, any input is welcome, thanks.
>

Re: Server Side Language Confusion

Posted by J Chris Anderson <jc...@couch.io>.
On Mar 10, 2010, at 10:09 AM, Justin Stanczak wrote:

> On Wed, Mar 10, 2010 at 12:51 PM, J Chris Anderson <jc...@couch.io> wrote:
> 
>> 
>> The soon to be released CouchDB 0.11 actually has a robust authorization
>> and authentication system built-in. Read-access control is on a per-database
>> basis, so you may end up using a database-per-user programming model.
>> CouchDB has been tested with millions of databases on a single server, no
>> problem, so this model is practical and supported.
>> 
> 
>> If I were going to use a middle tier layer I'd use Node.js. Generally
>> though a middle tier will just introduce scaling difficulties and muddy the
>> waters around security. Node.js (or other languages) still makes a lot of
>> sense for backend asynchronous processing, of course.
>> 
> 
> Node.js? This? I have not used this before. I'll look into it. Are you
> saying proxy a server, or use this server side?
> * http://nodejs.org/*
> 
> 
>> 
>> If you are interested in pure-CouchDB applications take a look at the
>> CouchApp project [1] or see my blog (itself a pure CouchApp) for posts
>> relating to the idea. [2]
>> 
> 
> Yes I used this. I've created a few example apps following along with the
> book. I understand the idea, but I'm having trouble wrapping my mind around
> opening the database to the world accessing my pages from it. Right there
> with all the data. You're saying the 0.11 will cure all those concerns? I'm
> sure I'm not the first of last to say that.

No, it won't cure all the concerns. There are absolutely apps that will benefit from a server side component for additional business logic and security. For those you should use whatever you are comfortable with, but recognize that non-blocking IO models are a better fit for CouchDB's high-concurrency.

However, my gamble is that many more apps than people realize, are amendable to a pure-Couch approach. If you aren't up for experimenting and want to stay in familiar territory, its probably better to use an app layer. But if you have specific concerns about the security model and how it applies to your use case, asking questions here is a good start.

Chris



Re: Server Side Language Confusion

Posted by Justin Stanczak <ri...@gmail.com>.
On Wed, Mar 10, 2010 at 12:51 PM, J Chris Anderson <jc...@couch.io> wrote:

>
> The soon to be released CouchDB 0.11 actually has a robust authorization
> and authentication system built-in. Read-access control is on a per-database
> basis, so you may end up using a database-per-user programming model.
> CouchDB has been tested with millions of databases on a single server, no
> problem, so this model is practical and supported.
>

> If I were going to use a middle tier layer I'd use Node.js. Generally
> though a middle tier will just introduce scaling difficulties and muddy the
> waters around security. Node.js (or other languages) still makes a lot of
> sense for backend asynchronous processing, of course.
>

Node.js? This? I have not used this before. I'll look into it. Are you
saying proxy a server, or use this server side?
* http://nodejs.org/*


>
> If you are interested in pure-CouchDB applications take a look at the
> CouchApp project [1] or see my blog (itself a pure CouchApp) for posts
> relating to the idea. [2]
>

Yes I used this. I've created a few example apps following along with the
book. I understand the idea, but I'm having trouble wrapping my mind around
opening the database to the world accessing my pages from it. Right there
with all the data. You're saying the 0.11 will cure all those concerns? I'm
sure I'm not the first of last to say that.

Re: Server Side Language Confusion

Posted by J Chris Anderson <jc...@couch.io>.
On Mar 10, 2010, at 6:39 AM, Justin Stanczak wrote:

> I'm having a little trouble figuring out what to select as the server side
> language for accessing CouchDB. I'm new to CouchDB so this paragraph will be
> a long list of questions and sentences of how I understand things to this
> point in time. Please feel free to correct me and help me better learn. I
> like the idea of eliminating all the DB mapping and focus on programming
> again, that CouchDB allows you to do. So I guess the first issue is you
> don't want your CouchDB exposed to the WWW, so you need a HTTPD to act as a
> proxy, via some language. This language would provide the session tracking.
> That session tracking would give you user logins and what not. This would
> also restrict access to your CouchDB, as I don't see CouchDB has much in the
> way of protection when it comes to access control to it's databases.

The soon to be released CouchDB 0.11 actually has a robust authorization and authentication system built-in. Read-access control is on a per-database basis, so you may end up using a database-per-user programming model. CouchDB has been tested with millions of databases on a single server, no problem, so this model is practical and supported.

If I were going to use a middle tier layer I'd use Node.js. Generally though a middle tier will just introduce scaling difficulties and muddy the waters around security. Node.js (or other languages) still makes a lot of sense for backend asynchronous processing, of course.

If you are interested in pure-CouchDB applications take a look at the CouchApp project [1] or see my blog (itself a pure CouchApp) for posts relating to the idea. [2]

[1] http://github.com/couchapp/couchapp
[2] http://jchrisa.net

Cheers,
Chris


> This
> leads to the issue of Javascript not being the language of choice for client
> side, as you really don't want clients, duh. So now that's where my language
> server side question comes from. What's a good option when using CouchDB? I
> know everyone has their opinions, but really, if you are using CouchDB as
> your back end database what language has been developed the most with
> CouchDB? What works the best? Surely there is one that stands out over the
> rest? Maybe I'm way off, any input is welcome, thanks.