[03:46:50] <Techdeck> Hey everyone. Question: I'm building an app where I have a huge catalog of items a user can buy, and once he buys them, they're added to his account. How would you suggest designing the collection of UserContent? would I copy the entire item into his collection? will I only store the catalog item IDs in his collection? one item that I may have in the catalog is rating, which keeps changing
[03:46:50] <Techdeck> obviously, so I wouldn't copy that. But wouldn't 'joining' the two collections be a performance issue? how would you design this?
[03:47:08] <Techdeck> (many things except the ratings can be changed on the global level, like the name of the item, price, etc)
[03:47:57] <Techdeck> the user could also have tens of thousands of items in his account, so just saving IDs might be slow when I fetch the records for him (I will need to do a join too)
[05:22:56] <Lope> Is there any way to snapshot and resume a snapshot of a mongodb DB, besides mongodump and mongorestore>
[05:53:52] <Boomtime> alternatively you can shutdown the mongod and copy the dbpath
[05:54:09] <Boomtime> though what problem are you trying to solve that mongodump/mongorestore is no good for?
[05:54:58] <Lope> It's not that mongodump and mongorestore are "no good" it's just that it seems a little inefficient for me to drop the database and then do a restore every time.
[05:55:22] <Lope> I'm testing a new application and want to restore the DB to a fresh state every time I run my app (during development)
[05:55:36] <Boomtime> and of course: https://docs.mongodb.org/manual/core/backups/
[05:56:24] <Boomtime> so you want to "restore the DB to a fresh state" but don't want to drop what is already there which is in some way 'no fresh'?
[05:56:53] <Lope> I'm just saying it's inefficient.
[05:57:01] <Boomtime> what do you expect to happen?
[05:57:13] <Lope> My app might change a few tiny fields, then restoring the entire DB fresh seems a bit overkill.
[05:57:23] <Lope> I was wondering if there's a snapshotting function
[05:57:27] <Boomtime> what is your definition of 'fresh state' and what is your defintion of the converse - i.e what state is the database _in_ that isn't fresh?
[05:58:02] <Boomtime> so you make some changes - and what you really want is a record of those changes so you can undo them
[05:58:12] <Lope> fresh state has my data in a state when it's ready to test. not fresh is after my app has possibly corrupted it or made undesirable changes.
[05:58:24] <Boomtime> without implementing something complicated, i'd say a fileystem copy is your best bet
[05:58:52] <Lope> What about putting the DB on LVM or something, and using a LVM snapshot?
[05:59:03] <Lope> or maybe inside a qcow2 backed filesystem?
[05:59:27] <Lope> otherwise I can just put the db in a randisk and overwrite it with a fresh copy and restart mongodb.
[05:59:34] <Boomtime> yes, that is fine too - if you always ensure the mongod is shutdown when you make the switches (and copies) you won't have any trouble
[06:00:37] <Lope> AFAIK there's no convenient to mount a QCOW2 filesystem. So that leaves LVM or ramdisk copy.
[06:00:40] <Boomtime> mongod uses the dbpath for everything - if you wholly restore it back to a previous snapshot (and a COW FS can make that fast) then it will happily use that earlier snapshow
[10:03:47] <yossarianuk> hi am trying to get replication setup in Mongo...
[10:04:18] <yossarianuk> Presently using security: ' authorization: enabled' and ssl to connect to the mongo servers
[10:05:06] <yossarianuk> I'm using this command to connect -> mongo -u username -p "pass" --authenticationDatabase "admin" --ssl --sslCAFile /etc/ssl/mongodb.pem host.name
[10:06:23] <yossarianuk> when I try to setup relication I get the error
[10:06:25] <yossarianuk> "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 192.168.253.55:27017; the following nodes did not respond affirmatively: host.name:27017 failed with Failed attempt to connect to host.name.co.uk:27017; couldn't connect to server host.name.co.uk:27017 (192.168.254.55), connection attempt failed",
[10:06:35] <yossarianuk> is this due to using authentcation ?
[10:06:59] <yossarianuk> do I need to change to keyfile ?
[10:43:36] <yossarianuk> ie in order to do replication do I have to turn off ' authorization: enabled'' -> keyFile: ?
[12:09:29] <yossarianuk> hi - is anyone aware for doing replication do I have to disable 'authorization: enabled'' and change to -> keyFile: authentication?
[12:09:55] <yossarianuk> trying to add a replication server and getting the error -> "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 192.168.253.55:27017; the following nodes did not respond affirmatively: host.name:27017 failed with Failed attempt to connect to host.name.co.uk:27017; couldn't connect to server host.name.co.uk:27017 (192.168.254.55), connection attempt failed",
[13:21:05] <ihre> Hi, I've been testing mongodb (1.2.4.10) a bit, and had a replicaset with 3 nodes die. Before the documentation was read, every node has been restarted and now I'm stuck without a primary node. Reconfiguring by breaking the mirror wasn't possible due to the fact that I didn't have a primary, so I couldnt run rs.add (replSetReconfig command must be sent to the current replica set primary.). I've removed 2
[13:21:07] <ihre> nodes by forcing reconfiguration, but the remaining node is stuck in state STARTUP2. Do I have any other options than rebuilding the replicaset and losing the users in the local db ( as pointed out in the answer @ http://stackoverflow.com/questions/21642396/mongodb-all-replset-stuck-at-startup2 ) ?
[13:26:20] <Trinity> if I have a user who owns a service should I be creating just a user collection and have it contain an array of services
[13:26:42] <Trinity> or should I create a user collection and a service collection with a reference to the service collection's document from the user collection?
[17:13:23] <nalum> hello, is there a way to have the mongodb date object output the full datetime including the seconds/milliseconds even if they are 0?
[23:16:09] <mattmaybeno> question for pymongo users. any experience in optimizing tailing the oplog? what kind of speed are people getting if you start from the back and try to ingest to the front?
[23:20:12] <yoofoo> a newbie question. I have what is probably really simple for you guru's. Here's a usecase, very typical in SQL where I came from: So, here it is. I have a customer, who has orders, each order having details, and payment attached to it. Should this be separated into two collections (customer with embedded customer info such as address and etc. And Order with embedded details and payment info? Please advise.
[23:22:39] <cheeser> for orders, i'd embed everything. you want a snapshot view of items, prices, taxes, etc.
[23:28:02] <yoofoo> Cheeser, for complex reporting would you recommend some sort of process, such as map reduce or similar to a secondary repository/cache? Please advise
[23:29:31] <yoofoo> assuming we decided to push to secondary repository/cache, what would you recommend?
[23:30:12] <cheeser> i don't know what that means.
[23:33:26] <yoofoo> here's my thinking. For complex reporting, we may want to reorganize the data into SQL, just to make reporting easier. if this is the case, what tools/processes would you recommend?
[23:34:16] <cheeser> you can do reporting directly out of mongodb