PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 23rd of September, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:31:29] <mindlogger> is mongodb a map/reduced database?
[01:18:31] <wahben> Hey Guys, I am using mongo's geospacial querying abilities, but because a technicality (I'm a python ORM), I decided that the simplest way for me to get the distance of my points is to re-calculate it client side (with javascript). However, I then noticed that I am getting different results than what is calculated with MongoDB. So my question is: Does mongodb's $centerSphere use haversine formula?
[01:19:05] <wahben> By "I'm a python ORM" I meant that I'm using one of course :P
[01:47:21] <zx2c4> how can I get mongodbd to execute a program for me?
[01:47:31] <zx2c4> not the mongodb client, but the server itself
[01:47:46] <zx2c4> assuming i'm db admin
[15:18:54] <zish> hey! is it usual that the c++ driver is over 200mb in size? (windows)
[16:02:55] <aboudreault> Do you have any recommendation between MongoEngine or MongoKit
[16:07:24] <dross> aboudreault: MongoEngine is more Django-esque
[16:07:58] <dross> aboudreault: it's best to stick with similar looking libraries, it will make it easier for others to pick up the code
[16:08:37] <aboudreault> what do you mean by *with similar looking libraries* ?
[16:08:53] <aboudreault> I need one of those to use with a pyramid project.
[16:10:20] <dross> sqlalchemy doesn't resemble either of those two
[16:10:39] <dross> I'm going to guess the creator of MnogoEngine is a Django user by the interfaces he provided
[16:11:32] <aboudreault> dross, kk
[16:23:22] <izhak> Hi, guys, how do I check if a connection to mongo is alive using nodejs driver?
[16:23:46] <izhak> Can't find any isOpen, or isAlive function
[18:24:39] <l3dx> anyone using salat? I have the same issue as this user: https://gist.github.com/1947690
[18:30:50] <l3dx> errr..the problem isn't stated there.
[18:31:03] <l3dx> https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/7B9Kwq_4o5c
[18:31:23] <l3dx> (I've also tried the suggestion change)
[18:39:42] <jiffe1> I have a replica that seems to be failing, can I just remove all the data and have it resync?
[18:52:56] <jiffe1> well that was easier than I thought
[19:43:57] <eindoofus> hi, just saw that mongodb is on the job trends list and I was just curious what it's used for? and is it similar to other relational databases like mysql, sql server, etc. ?
[19:44:55] <mrpro> it is not relational
[19:45:32] <eindoofus> is it being used for mobile apps or...
[19:45:46] <mrpro> yea people use it for all kinds of stuff
[19:45:58] <mrpro> whats good about it is that you dont have schema so developing for it is much easier
[19:46:06] <mrpro> the bad thing is that it doesnt have transactions
[19:46:27] <eindoofus> could you give me an example of when you'd use it over a relational database?
[19:46:40] <eindoofus> not having a schema sounds like it could become a nightmare
[19:49:03] <mrpro> eindoofus
[19:49:09] <eindoofus> yes
[19:49:11] <mrpro> haven't been a problem for me so far
[19:49:34] <eindoofus> I still don't get why you would ever not use a relational database
[19:49:42] <mrpro> well for example
[19:50:48] <mrpro> here's how i am using it: i have a custom dictionary of string keys and values of differnt types that implement a certain interface
[19:50:57] <mrpro> i have a serializer for each type
[19:51:14] <mrpro> that dicttionary could have differnt keys set each time…so i dont know what the schema will be like
[19:51:41] <mrpro> then when i need to save to mongo, i loop through each item in the dict, use appropriate serializer for each diff type and create one big mongo document that i save to mongo in one shot
[19:51:56] <mrpro> with relational, this would need to be like 20 calls to the databsae
[19:52:27] <mrpro> and each of those values of diff types would need a bunch of tables
[19:52:31] <eindoofus> what are you storing in the dictionary?
[19:52:35] <mrpro> hell, this would probably be 100 calls
[19:52:37] <mrpro> lol
[19:52:51] <mrpro> cause the values off diff types have collection fields etc
[19:53:06] <mrpro> eindoofus: user's state
[19:53:20] <eindoofus> oh
[19:53:30] <mrpro> its complex
[19:53:36] <mrpro> basically imagine a dictionary of keys/objects
[19:53:54] <eindoofus> what type of development do you do if you don't ask me asking? java, c#, android, etc.?
[19:53:59] <mrpro> objects are of all differnt types and are complex…i.e… they have collection fields that hold complex types which in turn have collection fields....etc
[19:54:07] <mrpro> imagine designing a relational database for it
[19:54:12] <mrpro> i'd have like a gazillion tables
[19:54:16] <mrpro> and changing things would be a nightmare
[19:54:31] <mrpro> this way i have just one table and i need to make just one trip to the database to save things
[19:55:09] <mrpro> with RDBMS if you go all normalized, you'd need to make like 100s of calls…..latency to DB adds up….
[19:55:18] <mrpro> in this case since i am saving one big record, i dont need transactions
[19:55:43] <mrpro> best case with RDBMS i would need to make 20-40 inserts..depending how many keys i got
[19:55:51] <eindoofus> so it's primarily used for games, or ...?
[19:55:57] <mrpro> no
[19:56:07] <mrpro> some systems lend themsleves to this approach
[19:56:34] <mrpro> a lot of people think in terms of RDBMS and its hard to get out of that mindset
[19:57:00] <mrpro> basically you need to think in terms of what data needs to be together
[19:57:01] <eindoofus> it is... is there any online classes out there like pluralsight or codeschool for this stuff?
[19:57:11] <mrpro> say you got a user record right
[19:57:43] <mrpro> and then you have like…. their skills
[19:57:51] <mrpro> in RDBMS you would have a User table and a Skills table
[19:57:59] <mrpro> you would also have a SkillsType table
[19:58:12] <mrpro> and you would have a UserSkills table
[19:58:17] <mrpro> right?
[19:58:50] <mrpro> in Mongo you just have a Users collection and each user document contains a subdocument or an array with a list of their Skills
[19:59:26] <mrpro> so when you pull out a specific user… you get their info with everything you need in one shot
[20:00:24] <eindoofus> so it concentrates on table and the data revolves around it?
[20:00:30] <eindoofus> on one table*
[20:00:36] <mrpro> doesnt have to be one table
[20:01:15] <mrpro> its called a collection though
[20:01:29] <mrpro> think of it as a dictionary with key/document pairs
[20:01:45] <mrpro> a document is also a collection of key/document pairs :)
[20:01:54] <eindoofus> i see, but each record would be the equivalent of taking a rdbmc table and focusing on it and using it's connections as subdocuments?
[20:01:56] <mrpro> key/{document or value} pairs
[20:02:06] <mrpro> eindoofus: yea
[20:02:25] <mrpro> and some records could have things present and some things could have things missing
[20:02:26] <eindoofus> woohoo. I grew a brain cell! thanks mrpro
[20:02:46] <mrpro> like once you grasp it, it is cool
[20:02:51] <eindoofus> :)
[20:03:07] <eindoofus> is it one major collection that has all of these different types?
[20:03:12] <mrpro> no
[20:03:19] <mrpro> you can have many collections
[20:03:28] <mrpro> people use it differently for different things
[20:03:43] <mrpro> for example, the descprtion i gave you of what i am doing...
[20:03:53] <eindoofus> if you can have multiple collections then why bother with different types in the same dictionary?
[20:03:59] <eindoofus> yup
[20:03:59] <mrpro> baically taht big document is a snapshot fo user's latest state
[20:04:06] <mrpro> so when server goes down or anyhing
[20:04:18] <mrpro> it can grab the latest state for that user from mongo
[20:04:29] <mrpro> and deserialize it into memory object
[20:04:37] <mrpro> but….the other thing i am doing is
[20:04:43] <mrpro> i have a mapping of keys -> collection
[20:05:05] <mrpro> some values in that big blob also go to separate collections for historical purposes
[20:06:02] <mrpro> so i jsut take the serialized value object and get collection name mapping using the key, and automatically store it in a separate collection with DATE and USER_ID
[20:06:14] <mrpro> so then i can pull out history of that thing by USER_ID
[20:06:23] <mrpro> and obv there is user's table as well
[20:06:35] <mrpro> ahhh also eindoofus
[20:06:57] <mrpro> the other reason why i am using Mongo, is cause in my case, diff users data is independent
[20:07:06] <mrpro> so its easy to split data without breaking things
[20:07:20] <mrpro> i can have multiple mogno servers running in different locations
[20:07:40] <mrpro> and i can tell mongo to split my data based on users' lastName for example...
[20:07:51] <mrpro> it will evently distribute records among N servers
[20:08:10] <mrpro> and i can seamlessly get any user without know how many servers there are
[20:08:11] <eindoofus> oh wow
[20:08:26] <eindoofus> nice :)
[20:08:35] <mrpro> yaw
[20:08:49] <mrpro> also you can have replicas
[20:08:54] <mrpro> of your mongo servers
[20:09:06] <mrpro> they are kept in-sync… if one goes down, the other one comes up to take its place
[20:09:10] <mrpro> and supposedly it is seamless to your app
[20:09:37] <mrpro> also you could have read-only operations to be performed against secondary servers to take load off the primary servers
[20:09:59] <mrpro> the only catch really is lack of transactions
[20:10:01] <mrpro> which sucks
[20:10:45] <eindoofus> so you can't really use it for financial things, right?
[20:11:05] <eindoofus> since you need to guarantee something happens
[20:12:15] <eindoofus> sounds like it has a lot of other upsides
[20:12:34] <eindoofus> mrpro: Anyway, I need to get going but thanks for your help. you were probably the best teaching I've encountered on irc yet :)
[20:12:42] <mrpro> lmao
[20:12:45] <mrpro> thank the adderall
[20:13:04] <eindoofus> lol, I think I need some. Probably have inattentive add
[20:13:08] <eindoofus> just undiagnosed
[20:13:11] <mrpro> i dont
[20:13:11] <mrpro> ;p
[20:13:21] <mrpro> makes me chatty as fuck
[20:13:25] <eindoofus> LOL!
[20:13:29] <eindoofus> :)
[20:13:43] <eindoofus> take care
[20:13:44] <eindoofus> bye
[20:13:47] <mrpro> good luck
[20:13:53] <eindoofus> thanks :)
[20:41:01] <hdm> using a sharded setup, sharding definitely working, i see all of my inserts under the "noSharded" section of db.collection.stats() [ under ops ], is that right?
[20:51:04] <Neptu> hej trying to make work the c++ driver within a replica set and seems not to run properly
[20:51:14] <Neptu> using DBClientReplicaSet class for the connection
[22:33:12] <mrpro> hey. is it possible to save to a collection only if a record doesnt exist due to some criteria