PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 13th of January, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:24:10] <jrua_> hello anybody passed C100DBA cert ? is difficult ?
[00:25:26] <cheeser> hrm. i should give that a whirl
[00:27:55] <lexi2> any reason that the ns file cant be larger then 2017mb
[00:28:03] <lexi2> i am guessing it has somthing to do with 32 bit systems
[00:28:08] <lexi2> or fat32
[00:29:01] <jrua_> yep that's a limitation of 32 bit systems lexi2
[00:29:25] <jrua_> mmap can't map into memory files bigger than 2Gi
[00:29:54] <lexi2> jrua_: if i am on 64bit system can i have the file larger then that
[00:32:19] <jrua_> lexi2: yep
[00:35:56] <jrua_> so nobody passed C100DBA here ? What a pity :S, not sure if register for the exam
[00:38:09] <StephenLynx> I don't even knew about that :V
[00:38:27] <StephenLynx> most people that use noSQL are not DBA's, IMO.
[00:38:31] <StephenLynx> they just use it.
[00:38:58] <StephenLynx> so theres not much point into getting a certification concerning a DB
[00:39:58] <cheeser> for me, the value would be in learning the material not so much padding the resume
[00:42:10] <StephenLynx> yeah. so no point into paying and doing an exam
[00:44:37] <lexi2> jrua_: so even though the docs say 2047 it can be larger if i sett that there
[00:55:46] <lqez> ??
[00:56:13] <lqez> mmap v1 does not extend ns file larger than 2GiB
[00:56:17] <lqez> https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/mmap_v1/data_file.cpp#L71-81
[00:56:37] <lqez> this function is used while extending collection
[00:57:23] <lqez> https://github.com/mongodb/mongo/blob/master/src/mongo/db/storage/mmap_v1/extent_manager.cpp#L60-80
[02:13:50] <FFForever> What is the best use-case example for mongodb compared to a traditional k/v database?
[02:14:43] <cheeser> well, mongodb and k/v stores are for entirely different uses.
[02:14:45] <dimon222> prolly working with huge amounts of data
[02:14:53] <cheeser> might was well compare redis and postgresql
[02:15:01] <dimon222> kv is only for pairs, mongo is for documents
[02:15:21] <FFForever> What defines a document? just a json array?
[02:15:47] <dimon222> json itself, array of jsons is a collection (kinda equivalent to table)
[02:17:33] <dimon222> basically its mongo is not a great opponent of k/v databases, its just serves its purpose, and does it great
[02:18:06] <cheeser> i'm not that "array of jsons" is quite right. or sensible.
[02:19:26] <FFForever> Would you recommend using mongo for a full stack backend or using it as more of a in-ram cache service?
[02:19:38] <dimon222> full stack backend
[02:20:46] <dimon222> mongo is not supposed to be used as in-ram cache service. It mostly relies on hard drive speeds since it usually stores huge amounts of data (when RAM is obviously not enough)
[02:20:57] <cheeser> in fact, the mongo docs discourage using is it a cache layer
[02:21:00] <dimon222> if you want in-RAM, then look for memcached or redis
[02:22:25] <dimon222> that may be rough, but i would call Mongo is some kind of solution for non-relational data warehouse
[02:30:25] <FFForever> So if it's for non-relational data I would still be using it in conjunction with postgres or miriadb, right?
[02:30:53] <FFForever> Or would I just map the document?
[02:31:51] <cheeser> if you need another db like that, you're probably doing it wrong.
[02:32:23] <dimon222> i'm not sure what do you mean for that
[02:32:45] <dimon222> so you just want cache layer?
[02:32:50] <dimon222> in-ram or whatever
[02:33:53] <FFForever> No. It was just trying to figure out what was a proper use case. One moment, let me write up a sample json.
[02:35:37] <dimon222> http://docs.mongodb.org/ecosystem/use-cases/#product-data-management
[02:35:48] <dimon222> prolly this page may help little bit with use cases
[03:23:04] <pikapp> I can’t seem to connect to mongodb remotely. I am pretty sure my firewall is open is on port 27017. What else could I be doing wrong?
[03:24:30] <bmillham> You mean 37017 pikapp ?
[03:24:54] <cheeser> 37017?
[03:25:18] <cheeser> pikapp: make sure you're binding to either 0.0.0.0 or your public IP and not localhost.
[03:25:22] <Boomtime> pikapp: check if you have bindIp set: http://docs.mongodb.org/manual/reference/configuration-options/#net.bindIp
[03:25:22] <bmillham> And make sure mongo isn't bound to 127.0.0.1, it has to be bound to your actual IP
[03:25:26] <Boomtime> *snap*
[03:25:59] <dimon222> pikapp
[03:26:08] <dimon222> vi /etc/mongod.conf - bindip 0.0.0.0
[03:26:18] <bmillham> Opps, yea, 27017, my bad
[03:26:28] <pikapp> Why would it be port 37017? Says here the default port is 27017 http://docs.mongodb.org/manual/reference/default-mongodb-port/
[03:26:38] <dimon222> jk
[03:26:46] <bmillham> My bad pikapp 27017 is correct
[03:27:07] <pikapp> ok cool. i wouldn’t know any different :)
[03:28:35] <pikapp> cheeser: Boomtime: it was indeed the binding, thank you, fixed now
[03:30:09] <pikapp> which is odd because the default is 127.0.0.1 when installing from yum on centos, so you would think one of the 3 tutorials i am using would mention it as a setup step
[03:30:33] <cheeser> pikapp: good to know
[03:32:08] <bmillham> I think it was also the default for Mint.
[03:32:24] <pikapp> probably for security reasons
[03:33:13] <pikapp> it was just leading me down the iptables road and that wouldn’t have been good, so glad I asked here first
[09:11:52] <winem_> good morning. I'm a bit confused and need some help. I downloaded mongodb 2.6.6. tar.gz for linux from the website and tried to add an user with createUser but it says it's not a function. but the deprecated addUser works
[09:17:53] <winem_> can anyone explain why an addUser works in version 2.6.6?
[09:22:13] <winem_> damn, it's a version conflict between the client and the server
[09:40:31] <hmsimha> if you have a field you want to either increment or set to a value if upserted, can that be done atomically?
[09:42:05] <hmsimha> for example if a user is given $100 then I want to either increment that user's piggybank field by 100 or set it to 100 if that user doesn't already have a document
[13:21:54] <swaagie> Are there issues with mongodb 2.6.6 and debian with geoNear queries? Got a script that runs fine on my local ubuntu machine but fails on some debian server claiming the special index: 2d is missing, while my debug statement after ensureIndex returns: Ensured index ran, result: location_2dsphere (no errors
[13:24:42] <swaagie> the query I'm running is just a basic: `{ location: { $near: { $maxDistance: 5E4, $geometry: { type: 'Point', coordinates: [lng, lat] }}}` as its 2dsphere I don't get why it complains about missing 2d indexes in the first place
[13:33:27] <hagb4rd> ~
[13:49:58] <StephenLynx> what is neoGear?
[13:50:16] <StephenLynx> ah
[13:50:19] <StephenLynx> geoNear
[13:57:21] <swaagie> lol
[13:57:44] <swaagie> did I type that somewhere? :)
[13:57:56] <jiffe> how can I tell what each replica set member is synced up to with respect to one another?
[13:58:48] <cheeser> rs.status()
[14:01:07] <jiffe> can that be manupulated? it seems that after starting a replica member it crashes soon after it starts to sync. I found a related issue where someone had the same condition and it was based on detecting data corruption
[14:02:17] <jiffe> although they did a full resync to detect the problem which suggests the corruption was on the side of the member that was crashing
[14:02:30] <jiffe> full resync to resolve the problem that is
[14:03:18] <jiffe> a full resync is really a last ditch option in my case though because there's just too much data and these machines should be mostly in sync already
[14:04:34] <jiffe> I don't know if the comment that mongodb shuts itself down to prevent further damage is correct either
[14:04:59] <jiffe> a bus error 'Invalid access at address' doesn't sound like a graceful shutdown
[14:05:56] <jiffe> so really I have no idea what the problem is here
[14:07:05] <jiffe> the optime on the working member is two operations higher than the non-working member
[14:07:22] <jiffe> I don't know if I can just try to ignore those two operations
[14:28:11] <stava> Doing db.collection.update({...}, {$pull: {myArray: 'foo'}, $addToSet: {myArray: 'bar'}}) I get the error "Cannot update 'myArray' and 'myArray' at the same time". But how then can I remove "foo" and add "bar" to myArray in a single update()?
[14:30:18] <cheeser> doesn't look like you can
[14:31:02] <stava> I thought that I atleast would be able to nest some $-operators to accomplish something like this
[14:31:21] <cheeser> seems like arrays have certain constraints.
[14:31:36] <cheeser> you can definitely do multiple updates at once. but maybe not on arrays...
[14:32:04] <stava> {myArray: $concat: [{$pull: ...}, {$addToSet: ...}} is what i imagined :)
[14:32:31] <stava> or $diff, but whatever I see what you're saying
[14:32:39] <stava> It's not the first time i struggle with arrays :)
[14:35:22] <swaagie> Would anyone know if there are issues with mongodb 2.6.6 and debian with geoNear queries? Got a script that runs fine on my local ubuntu machine but fails on some debian server claiming the special index: 2d is missing, the query I'm running is just a basic: `{ location: { $near: { $maxDistance: 5E4, $geometry: { type: 'Point', coordinates: [lng, lat] }}}`
[14:35:22] <swaagie> as its 2dsphere I don't get why it complains about missing a 2d index in the first place
[14:35:46] <cheeser> what version is on your local machine?
[14:37:22] <swaagie> cheeser: 2.6.6 also :)
[14:43:01] <swaagie> would raising the loglevel of mongodb provide more insight? or would that just blur the issue
[14:43:55] <cheeser> might help
[14:46:10] <StephenLynx> stava
[14:46:12] <StephenLynx> are you there?
[14:46:19] <StephenLynx> I managed to update an element in the array
[14:46:44] <StephenLynx> if you wish to just remove ONE element and add ONE element, this could word
[14:46:51] <StephenLynx> db.collection.update({array:'a'},{$set:{'array.$':'d'}})
[14:52:23] <StephenLynx> but the overall impression I am getting from searching is that indeed is a mongo deficiency, you can't perform multiple updates on sub arrays in a single query.
[14:54:20] <swaagie> cheeser: got it working, thanks for the help, silly me, appearantly the reinstall did not kill the current older running mongod, somehow the client did connect like it was working normally/regularly tricking me into thinking 2.6.6 was running
[14:55:10] <jiffe> well my crashing does seem to be due to rsyncing, if I shut the other replica member down then the member that crashes doesn't crash until I start the other member up again
[14:55:18] <jiffe> syncing, not rsyncing
[14:55:41] <StephenLynx> swaagie probably it happens because from what I heard linux keeps the files in memory. unlike windows, it won't lock files that are in use by the system
[14:56:14] <swaagie> StephenLynx: that would fit the symptoms perfectly
[14:56:47] <StephenLynx> lesson learned: makes sure stuff is shutdown for good when uninstalling/reinstalling :v
[14:56:51] <swaagie> xD
[14:56:57] <swaagie> yup
[14:57:39] <jiffe> files aren't removed from disk until there are 0 references, they are just unlinked from the filesystem
[14:59:17] <StephenLynx> jiffe if the file is just loaded into RAM does it counts as a reference?
[14:59:38] <jiffe> define loaded into ram
[15:00:20] <jiffe> if you're talking something like fopen, fread, the read doesn't have anything to do with referencing but the open does
[15:00:38] <jiffe> so while the file is open it is still referenced, but as soon as you close it, that reference is removed
[15:00:40] <StephenLynx> hm
[15:00:50] <jiffe> you can still have the contents of that file in memory with no references
[15:02:09] <FunnyLookinHat> I'm not sure what I should be googling for - feel free to suggest the keywords I'm missing... but I want to create a report that looks for a nested key/value pair within a collection... what would that be called?
[15:02:47] <FunnyLookinHat> i.e. { 'someObj': { 'someKey': 'someVal' } } - I want to look through data on 'someKey' - if it exists.
[15:03:53] <StephenLynx> $elemMatch
[15:04:15] <StephenLynx> or dot notation
[15:04:24] <StephenLynx> like someKey.subfield
[15:04:36] <StephenLynx> I think dot notation is what you are looking for
[15:05:31] <StephenLynx> in your case, someObj.someKey : value
[15:06:02] <FunnyLookinHat> StephenLynx, Ah oh
[15:06:13] <FunnyLookinHat> I wasn't sure if I should be generating a view or something... ( totally new to NoSQL )
[15:06:43] <StephenLynx> but I wouldnt add fields that would hold objects.
[15:06:53] <StephenLynx> would create complexity without actually adding anything.
[15:07:15] <StephenLynx> for one I only have objects in arrays, where said objects makes sense.
[15:07:27] <StephenLynx> I aim for the most plain model I can.
[15:08:34] <FunnyLookinHat> StephenLynx, Yeah - this field is for arbitrary data that's specific to the use case... it's a one-off compared to the other top-level fields I have
[15:09:04] <FunnyLookinHat> StephenLynx, i.e. https://github.com/funnylookinhat/tetryon/blob/master/spec/particles.json
[15:09:11] <FunnyLookinHat> Feel free to tell me if I'm doing things totally wrong./
[15:09:22] <FunnyLookinHat> gosh that syntax highlighting is awful
[15:09:39] <StephenLynx> yeah
[15:09:44] <StephenLynx> going to paste on jsonviewer
[15:09:54] <StephenLynx> oh
[15:09:58] <StephenLynx> you saved as .json
[15:10:04] <StephenLynx> and the file is not json formatted
[15:10:09] <StephenLynx> shouldve saved as .txt
[15:10:19] <StephenLynx> wait, no
[15:10:22] <FunnyLookinHat> hehe - yeah just realized /* */ isn't valid json
[15:10:28] <StephenLynx> oh
[15:10:29] <StephenLynx> yeah
[15:10:30] <FunnyLookinHat> :D
[15:10:37] <FunnyLookinHat> ( late night spec writing - bad idea 0
[15:11:08] <StephenLynx> I don't try and format my docs. https://gitlab.com/mrseth/lynxchan/blob/master/doc/Model.txt
[15:12:51] <FunnyLookinHat> StephenLynx, better? :) https://github.com/funnylookinhat/tetryon/blob/master/spec/particles.txt
[15:13:05] <StephenLynx> much
[15:13:29] <StephenLynx> but could be better, the comments seems to be isolated from what they should define
[15:14:05] <StephenLynx> and you are including the mongoId while also having your own id.
[15:14:10] <StephenLynx> you might as well ignore _id
[15:14:20] <StephenLynx> since it is not part of your model
[15:15:54] <StephenLynx> and you are declaring the collection is an array. that should be pretty obvious, so is redundant.
[15:16:17] <StephenLynx> instead of just specifying how each object in the collection is built
[15:16:34] <FunnyLookinHat> Ahhh ok - yeah that does seem redundant now that I think of it
[15:17:10] <FunnyLookinHat> beam_id referenences https://github.com/funnylookinhat/tetryon/blob/master/spec/beams.txt
[15:17:34] <FunnyLookinHat> I can't use the built-in ID as it's not unique enough for my use case ( has to be client generated and nearly-guaranteed unique )
[15:17:57] <StephenLynx> I know, I don't use the build in id either.
[15:20:41] <FunnyLookinHat> StephenLynx, thanks for the feedback and help :)
[15:21:31] <StephenLynx> and as I said, I would remove the data field and just add the fields to the object.
[15:21:35] <StephenLynx> there is really no gain in doing that
[15:21:49] <StephenLynx> all fields are data
[15:23:10] <FunnyLookinHat> StephenLynx, it doesn't help to keep things organized at all? these will be user-customizable - so I was thinking it would just muddy the collections
[15:23:22] <FunnyLookinHat> The top level fields are the only non-customizable ones
[15:23:27] <StephenLynx> it really doesn't help.
[15:23:36] <StephenLynx> you are just going to add more verbose on queries
[15:23:56] <StephenLynx> you might as well set categories in your documentation
[15:24:07] <StephenLynx> and say "these are the non-customizable fields"
[15:24:14] <StephenLynx> but don't apply it to your model.
[15:28:21] <StephenLynx> I took that lesson from python.
[15:28:43] <StephenLynx> even though I don't like the language, I like bits of it's philosophy
[15:32:52] <FunnyLookinHat> StephenLynx, yeah good pt.
[15:33:24] <mrx1> I will be storing data logs from different devices (~100 devices) and there will be many data points (let's assume 10M in total). I would like to be able to quickly retrive contents of last data point for each device. How to do it nicely? I could store last record of each device in devices collection in a separate field, but this would require updating 2 fields when inserting records - so it wouldn't be atomic and I would have to mimic transactions. It's p
[15:33:24] <mrx1> ossible to do, but mayeby there are some other possibilities?
[15:34:01] <mrx1> and by quickly I mean less then 0.5 sec spend on db query on average pc
[15:34:44] <mrx1> "this would require updating 2 fields" --> "this would require updating 2 documents"
[15:35:30] <StephenLynx> mrx1 the collection holds objects with A: device ID, B: device logs
[15:35:52] <StephenLynx> then you just get the last element of B where the document matches the device ID you are looking for
[15:36:01] <StephenLynx> would that work?
[15:36:40] <mrx1> that's my plan currently, but will it be fast enough ? I would prefer some constant-time per device solution
[15:37:12] <StephenLynx> constant-time?
[15:38:10] <mrx1> time independent of size of data log collection
[15:39:21] <StephenLynx> how do you know it will not be like that?
[15:39:30] <StephenLynx> you are just asking for the last element of the array all the tim
[15:41:12] <mrx1> Not last element of the array, but last element for each device. One of that elements can be actually last in whole collection, but most of them won't be last :)
[15:43:09] <StephenLynx> in that case it can never be constant
[15:43:28] <StephenLynx> if you have 1 device, you will read 1 element, if you have 10000 device you will read 10000 elements
[15:43:46] <mrx1> it can when there would be some mechanism to store log for each device during inserting that log
[15:44:05] <mrx1> but probably there is no such thing which would be atomic
[15:44:07] <StephenLynx> but that what I told you to do
[15:44:17] <StephenLynx> have an array in the document holding an array of logs for that device
[15:44:29] <StephenLynx> so you just read the last element of the array in the returning devices
[15:45:38] <mrx1> I can't hold logs of device in one document, because there can be lot of logs per device (more than 16 MB)
[15:45:52] <mrx1> So I will have collection of logs, with device field
[15:46:37] <StephenLynx> yeah, you can have that, but that would be even more expensive, IMO because then you will have to splice and group.
[15:46:51] <StephenLynx> or can't mongo have documents with more than 16mb?
[15:47:20] <mrx1> yeah, as far as I read, mongo can't have documents larger than 16 mb
[15:47:58] <StephenLynx> what about gridFS?
[15:48:20] <mrx1> it won't help me here
[15:49:02] <StephenLynx> hm, then yeah, I would use 2 collections.
[15:49:15] <mrx1> 2 collections for what
[15:49:31] <StephenLynx> or have a sort of complex query
[15:49:45] <StephenLynx> maybe not so complext
[15:49:49] <StephenLynx> hold on
[15:53:25] <StephenLynx> you could try and aggregate
[15:53:34] <mrx1> yeah, that's my plan also
[15:53:52] <cheeser> swaagie: good to hear. :)
[15:54:00] <mrx1> but it won't be constant-time solution, but I hope it will be just fast enough
[15:54:02] <StephenLynx> yeah, that seens to be the best solution. use the device id for the _id when grouping
[15:55:20] <StephenLynx> you can use $last, afaik
[15:55:36] <StephenLynx> so you will get the latest log for each device
[16:21:39] <sekyms> I have a query question, not sure if this is the proper place
[16:23:22] <sekyms> I need to know the number of "up" or "down" "direction" for a product by ISBN
[16:23:29] <sekyms> https://gist.github.com/smykes/22891565810dd2ffc40c
[16:28:58] <StephenLynx> group in aggregate
[16:29:35] <StephenLynx> I think you could do that
[16:29:50] <sekyms> StephenLynx: Was that directed towards me?
[16:29:56] <StephenLynx> yes
[16:30:16] <sekyms> i think im staring to get into transactional land here
[16:30:53] <StephenLynx> nah
[16:30:58] <sekyms> yeah this could work i think
[16:31:08] <StephenLynx> in the _id field you set the value
[16:31:23] <StephenLynx> and on a secondary field you count it
[16:31:54] <StephenLynx> first you unwind the feedback list
[16:32:11] <StephenLynx> then you group assigning the direction to _id
[16:32:13] <StephenLynx> and count it
[16:32:39] <StephenLynx> using $inc
[16:36:52] <sekyms> yeah databases are hard...
[16:37:08] <StephenLynx> not much
[16:37:57] <StephenLynx> I mean, theres always C++
[16:38:04] <StephenLynx> and then real low level stuff
[16:38:08] <StephenLynx> like assembly
[16:38:54] <StephenLynx> db's are just a really different and constrained way to lay out instructions
[16:39:05] <StephenLynx> but it either fails or not.
[16:39:36] <StephenLynx> when it fails but looks like it it's working only to crumble later and you have absolutely no idea what the problem is then you will say "this is hard"
[16:47:58] <sekyms> can you do db.products[objectid].count({"isbn":"00-00-110"})
[16:48:03] <sekyms> or something of the ilk
[16:48:35] <StephenLynx> don't think so.
[16:48:39] <StephenLynx> but you could try.
[16:48:49] <sekyms> there is no chaining?
[16:48:52] <StephenLynx> mongo is very lacking when it comes to sub-arrays
[16:50:31] <cheeser> db.products.find({_id:xxxx, "feedBack.isbn" : "123"}).count()
[16:51:00] <sekyms> yeah that gives me the count of products
[16:51:08] <sekyms> where I want the count of isbn
[16:52:17] <StephenLynx> doing a group is not hard and it seems to be the most optimal way
[16:52:33] <StephenLynx> just make sure you use a match before
[16:52:48] <StephenLynx> so you only unwind the array of the exact object you want
[17:02:08] <rodd> Hi I'm new to mongo, I'd like to setup a document for countries with lat and long, can I user whatever geospatial index I choose or would it be better to use a specific one, like 2dsphere?
[17:03:19] <rodd> or just 2d, maybe 2dsphere is too much?
[17:06:13] <keso_> anybody used morphia for java before? I have a question about the UpdateOperations class
[17:10:42] <StephenLynx> rodd you can use anything for index, you just set it as unique. but personally I would use something human friendly
[17:11:33] <rodd> StephenLynx: hm what do you mean by human friendly in terms of data storage?
[17:11:46] <StephenLynx> a name, for example
[17:12:12] <rodd> StephenLynx: oh right, but I'd like to be able to detect a user's position through lat and long
[17:12:29] <rodd> anyway thanks, I think 2d is enough
[17:12:54] <StephenLynx> if you want to have that everytime you read the user, then yes, I would use that.
[17:13:51] <StephenLynx> if you are ok with making occasional additional queries for that, and want to show something in the GUI regarding the country, then I would use something else.
[17:14:04] <StephenLynx> it varies on how you want to use it.
[17:14:07] <StephenLynx> depends*
[17:14:42] <rodd> StephenLynx: it's more for detection than displaying specific points on a map
[17:14:59] <rodd> hence I think 2dsphere would be too much
[17:15:11] <StephenLynx> but will be location be among the first things you show about the user?
[17:15:22] <StephenLynx> and will always be shown?
[17:15:32] <StephenLynx> will the location be*
[17:15:40] <rodd> yes
[17:16:14] <rodd> the location is the starting point of the service
[17:17:33] <StephenLynx> yeah, then use that
[17:18:07] <ac360> HI all, I'm a bit new to MongoDB and database infrastructure and I have a fundamentals question. In general, if I have an application running online on a server, I want my Mongo database to be hosted on the same server so that both could communicate quickly without any network latency, correct?
[17:19:31] <ac360> I'm just curious how this works in AWS EC2. If I spin up an EC2 instance with a web application, and then use a managed-mongoDB-provider like MongoLab who claims they can also host the database on AWS to "host the database where my app is".
[17:20:09] <ac360> How does my app connect to that database over the most optimal connection?
[17:20:41] <StephenLynx> what is AWS ec2?
[17:20:44] <ac360> (Sorry for the vague language. I just don't know a lot about the connection protocol through which apps connect to the databases)
[17:21:14] <ac360> Amazon Web Services EC2 is a cloud computing service which lets you spin up computing instances you can use for launching web applications
[17:21:18] <kali> ac360: they will allow you to pick an ec2 zone, iirc. so the database will not run on the same server, but it will not be very far
[17:21:46] <kali> ac360: it's not that common to have the DB and the app on the same hardware actually
[17:21:53] <StephenLynx> that is very specific to their services. you would get more people to help you contacting them or in their forums
[17:22:10] <ac360> kali: Thanks. So Every query to the database is actually a network request and is subject to network latency?
[17:22:22] <ac360> It's just a "close network request"?
[17:22:31] <kali> yes, low latency lan request
[17:23:11] <ac360> Hmmm, Ok.
[17:23:39] <kali> ac360: i'm not sure they allow you to pick a zone or region, but don't worry too much about that
[17:24:03] <kali> i mean. it's either a zone or a region. but definitely one of them. just can't remember which :)
[17:24:19] <ac360> lol,right.
[17:25:32] <ac360> I ask because I'm intrigued by AWS's new Lambda service. It allows me to simply upload javascript functions to the cloud and uses the most minimal amount of computing resources to process it. I'd like to write javascript that connects to a Mongo Database, but I don't know the best way to set up the infrastructure to be as fast as possible.
[17:27:09] <kali> as far as i understand it, lambda is not for low latency problems (like answering http request), more for high bandwith problem (async jobs, generating stats, thumbs, etc.)
[17:27:22] <StephenLynx> ac360 if performance is an issue maybe you could rent servers and handle them via SSH
[17:27:57] <StephenLynx> minimal solutions are usually the fastest.
[17:28:35] <ac360> Kali: Right, but I need persistance to run those jobs
[17:30:39] <ac360> StephenLynx: That's what I do, but I'm looking to stop paying monthly fees for server infrastructure and instead pay only for the precise infrastructure required when my code is actually run. This is what AWS Lambda represents.
[17:30:58] <ac360> It will result in a significant cost savings
[17:31:27] <StephenLynx> indeed.
[17:32:20] <ac360> Monthly fees are kicking my butt
[17:33:58] <StephenLynx> how much youre paying currently?
[17:36:44] <winem_> ac360, IBM Bluemix might be another option :)
[17:38:49] <ac360> winem_ Thanks I'll check them out!
[17:41:58] <sijojose> Hi all, IN MongoDB can we auto generate id for a subelement in a document...?
[17:48:47] <StephenLynx> dont think so.
[18:14:56] <jiffe> can you skip operations when replicating?
[18:42:34] <jcox1> hey everyone. I'm looking for some advice on configuring replica set members. The docs seem ambiguous regarding what I want to do so I figured I'd check here to see if anyone has experience
[18:43:07] <mrx1> Is it OK to use username as object id in Users collection? I will have only 1 user with any name and I won't change usernames. But that username will be less random then autogenerated ID. Is it okay or will it introduce some performance penalty or something ?
[18:43:41] <cheeser> your ID can be whatever you need it to be. but mongo won't let you change the _id value of a document.
[18:44:03] <mrx1> ok, that's fine for me
[18:44:37] <mrx1> thanks.
[18:48:49] <jcox1> I have replica sets with three members (1 prim., 2 sec). I want to add a node that I am solely going to use for dumping data into our data warehouse. I'm going to configure this member to be hidden (and priority:0) so it doesn't receive any read traffic. But now I have 4 voting members in the replica set. So I either need to make the new member non-voting or add an arbiter. Ideally I'd just make it non-voting, but the documentation seems to discourage changing
[18:50:22] <cheeser> simple enough to add the arbiter
[18:54:17] <jcox1> @cheeser are there disadvantages to having the new member be non-voting? I'll be deploying this setup to many many replica sets across many mongo clusters. So if there's no disadvantage, it'd be cheaper to have the warehouse nodes not vote.
[20:04:46] <dman777_alter> much...not sure how this happened but I have a duplicate collection. In otherwards, I have 2 foos...one is (empty) bytes and the other is 2 gigs
[20:04:54] <dman777_alter> how do I get rid the of the empty one?
[21:06:21] <digicyc> You sure they have the same exact name?
[21:06:42] <digicyc> I can't even figure out how to add a collection with the same exact name of an existing collection. o_O
[21:07:17] <digicyc> > db.createCollection("blah")
[21:07:18] <digicyc> { "ok" : 0, "errmsg" : "collection already exists" }
[21:08:24] <digicyc> > db.createCollection("blah ")
[21:08:25] <digicyc> { "ok" : 1 }
[21:08:30] <digicyc> hah
[21:14:11] <jiffe> db.getCollectionNames()
[21:14:17] <jiffe> that would at least quote them
[21:15:41] <digicyc> http://icephoenix.us/stuff/mongodb-deleting-collection-with-a-space-in-the-name/
[21:15:50] <digicyc> db["blah "].drop();
[22:18:48] <liamkeily> In my app, there would be some relations. Like a user would own some objects. Is this something you would/could use mongo for.
[22:21:12] <Torkable> yea
[22:21:48] <Torkable> it would just be a sub-object/array of things
[22:22:25] <liamkeily> So a query on a collection of tweets for example. Could be queried by user_id in a similar way to mysql
[22:22:40] <cheeser> of course. it's a database after all.
[22:23:20] <liamkeily> cool :) i've always had a bad impression of document databases so i've avoided them for a while lol
[22:28:33] <Torkable> is there any way to ensure writes across two or more collection?
[22:29:08] <Torkable> say I want to create a new user, and I need to insert the data in more than one collection, and if one write fails, roll back
[22:29:54] <Torkable> can I still implement two-phase pattern here?
[22:30:56] <cheeser> mongodb.org has something about that.
[22:31:03] <cheeser> gotta run, though. good luck.
[22:31:08] <Torkable> :\
[22:32:27] <joannac> Torkable: http://docs.mongodb.org/manual/tutorial/perform-two-phase-commits/
[22:32:59] <Torkable> joannac, yea I'm looking at that page now, can that pattern be applied to multiple collections
[22:34:13] <joannac> yes?
[22:34:38] <Torkable> is that a question?
[22:35:02] <joannac> No, I'm just not sure why you think it's not possible to do across multiple collections
[22:35:34] <Torkable> looked like it was making use of bulk inserts, can't bulk insert on multiple collections
[22:35:44] <Torkable> perhaps I misunderstood
[23:27:53] <Torkable> good overview of strategies I found
[23:27:54] <Torkable> http://edgystuff.tumblr.com/post/93523827905/how-to-implement-robust-and-scalable-transactions
[23:28:01] <Torkable> so edgy