[01:54:32] <symbol> I'm using the node mongodb native driver...can't seem to figure out how to create a mongodb connection in a DRY way. Can anyone recommend an open source app to look at?
[01:55:16] <symbol> With Postgres I just passed a query to the client so one block of code handled all CRUD.
[01:58:45] <StephenLynx> what runtime environment?
[02:00:37] <StephenLynx> https://gitlab.com/mrseth/LynxChan/blob/master/src/be/db.js#L569 its where I open the connection.
[02:00:48] <symbol> I used it for a hack spike on this project...definitely not a fan of it but it'll do. In the meantime, I can at least move us off postgres :D
[02:00:51] <StephenLynx> then I assert indexes and get pointers to the collections
[22:26:48] <janitto> is there anything to be aware of when using it this way? i've read a bunch of stuff about data loss and unreliability but i'm beginning to think it's been exaggerated
[22:27:06] <janitto> also heard some advice not to use it as a primary data store
[22:32:42] <StephenLynx> about primary data store: that would be redis, from what I heard. from what I read, once your dataset exceeds your RAM, you are boned.
[22:33:07] <StephenLynx> mongo does have its own memcache, but as long as your indexes fit RAM, you are fine.
[22:37:12] <janitto> StephenLynx: thanks for the advice. i definitely have some relations but nothing too crazy i hope
[22:37:31] <StephenLynx> yeah, some relations here and there are not bad if you don`t abuse them.
[22:37:41] <StephenLynx> I do have some too on my systems.
[22:48:42] <janitto> i have publishers who have sites and zones within those sites, and advertisers who have campaigns and flights within campaigns, and creatives that can be applied to flights. those flights can be applied to specific zones. is that doing too much with relations for mongo?
[22:51:15] <StephenLynx> see how my boards have owners
[22:51:22] <StephenLynx> but users also have an array of owned boards.
[22:51:57] <StephenLynx> that way I don`t have to look for all boards and see which ones match the user as owner when I want to list the user's owned boards.
[22:52:04] <StephenLynx> or how threads have an array of latest posts
[22:52:22] <StephenLynx> so I don't have to look for all posts, see which ones match the thread, sort by date and limit.
[22:52:31] <StephenLynx> I already have that array of the latest X ones.
[22:53:49] <StephenLynx> or just take a look at the board stats collectiom.