News for hackers. Stuff that matters.
Re:Hoodie: very fast web app development by old-gregg on Monday April 08, 2013 @08:26PM (#5515672)
I have a question for experts in Hoodie and/or other similar projects (like Meteor):

How are database connections managed? If every client (browser) basically talks nearly directly to the database, don't you end up with of thousands of database connections?

Large number of connections is not a problem by itself, and servers like nginx handle them well, but I am not aware of a database which will feel comfortable being exposed this way. MongoDB, for example, really starts struggling with 2K+ connections. PostgreSQL can barely handle a hundred.

Is this why CouchDB is used? Is connection pooling used on the server? Or maybe the connections are short-lived and never persistent? Basically, how does this work with large number (say, 10K) of concurrent visitors?

Thanks!

Re:Hoodie: very fast web app development by janl on Monday April 08, 2013 @08:29PM (#5515690)
As long as the underlying OS can provide file descriptors, CouchDB can handle the concurrent connections through the magic of Erlang, both persistent and shorter lived.

There are obvious limits to this, but the Hoodie architecture allows easy scale out (more DB servers and manual sharding, or a dynamo-like BigCouch, more workers etc.) that we’ll get to making use of once Hoodie apps become that big.

Re:Hoodie: very fast web app development by tarabukka on Tuesday April 09, 2013 @06:40AM (#5517243)
Magic of Erlang? I hate to be cynical, but have you got benchmarks to back that up?
Re:Hoodie: very fast web app development by janl on Tuesday April 09, 2013 @10:37AM (#5518324)
Yeah.
Re:Hoodie: very fast web app development by OGC on Tuesday April 09, 2013 @09:13AM (#5517812)
To rephrase the other question: So what "magic" does Erlang do then? How does it work?
Re:Hoodie: very fast web app development by janl on Tuesday April 09, 2013 @10:36AM (#5518316)
tl;dr: keeping sockets open only uses very little memory and no CPU when idle.

dr: http://jlouisramblings.blogspot.co.uk/2013/01/how-erlang-doe... ff.