Can Server side functions scale???

393 views
Skip to first unread message

Amit Piplani

unread,
Jan 2, 2011, 5:31:57 AM1/2/11
to mongodb-user
Hi,

Like Stored procedure, the server side functions also don't scale????
Just wanted to know the experts view on the same.

Thanks,
Amit

Sam Millman

unread,
Jan 2, 2011, 5:41:06 AM1/2/11
to mongod...@googlegroups.com
Scale in what manner? There are many measurements for scaling you need to pick one.

From what I know many sites such as Facebook etc use stored procedures and from what I have read they are more scalable than inline querying (tbh I wouldnt truely know since I dont use SQL on such a large scale).



--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.




--
Bow Chicka Bow Wow

Scott Hernandez

unread,
Jan 2, 2011, 12:34:12 PM1/2/11
to mongod...@googlegroups.com
In mongodb server side javascript functions are not like stored
procedures in other products.

Generally server-side javascript code is used during map/reduce, or in
a db.eval or $where statements; running javascript on the server has
limitations because it only runs in a single thread and is slower than
native operations, and doesn't use indexes.

If is best to search the list/group to find answers like this:
http://groups.google.com/group/mongodb-user/browse_thread/thread/3ed8f8506e74ca/c1b7612f6f6aab98

Amit Piplani

unread,
Jan 2, 2011, 9:36:01 PM1/2/11
to mongodb-user
Thanks for the answer....
So is system.js the collection which stores the server side functions
or some other collection?? Is that collection available across the
shards??? If yes, then how come eval doesn't work with sharding?

Thanks,
Amit

On Jan 2, 9:34 am, Scott Hernandez <scotthernan...@gmail.com> wrote:
> In mongodb server side javascript functions are not like stored
> procedures in other products.
>
> Generally server-side javascript code is used during map/reduce, or in
> a db.eval or $where statements; running javascript on the server has
> limitations because it only runs in a single thread and is slower than
> native operations, and doesn't use indexes.
>
> If is best to search the list/group to find answers like this:http://groups.google.com/group/mongodb-user/browse_thread/thread/3ed8...

Scott Hernandez

unread,
Jan 2, 2011, 10:05:55 PM1/2/11
to mongod...@googlegroups.com

Amit Piplani

unread,
Jan 2, 2011, 10:09:59 PM1/2/11
to mongodb-user
Yes Scott..my questions came after reading that link only....

Scott Hernandez

unread,
Jan 2, 2011, 10:28:23 PM1/2/11
to mongod...@googlegroups.com
I understand that there simply isn't support for db.eval() across
shards (with mongos) because it hasn't been written.

http://groups.google.com/group/mongodb-user/browse_thread/thread/9b7413e6f1fcf232
http://groups.google.com/group/mongodb-user/browse_thread/thread/dcf27a352b1e0e2c

db.eval() support and using system.js global functions are two different things.

Is there something you are trying to accomplish, or are you just
wondering about technical details?

Amit Piplani

unread,
Jan 3, 2011, 12:37:05 AM1/3/11
to mongodb-user
Yes....Deep diving into MongoDB ...


On Jan 2, 7:28 pm, Scott Hernandez <scotthernan...@gmail.com> wrote:
> I understand that there simply isn't support for db.eval() across
> shards (with mongos) because it hasn't been written.
>
> http://groups.google.com/group/mongodb-user/browse_thread/thread/9b74...http://groups.google.com/group/mongodb-user/browse_thread/thread/dcf2...
>
> db.eval() support and using system.js global functions are two different things.
>
> Is there something you are trying to accomplish, or are you just
> wondering about technical details?
>
Reply all
Reply to author
Forward
0 new messages