These are chat archives for rsercano/mongoclient

3rd
May 2016
Rodrive
@Rodrive
May 03 2016 09:33
Hi there
Sercan Özdemir
@rsercano
May 03 2016 13:39
Hello
I recommend you to read this blog post, it's useful http://blog.mlab.com/2013/11/deep-dive-into-connection-pooling/
But unfortunately I'm not using the pooling system, since it's too dangerous in my situation. If any connection stays open, I have to handle it's timeouts or closings manually and it costs me a lot for a mongodb management tool. But I'm open suggestions at this point :) And by the way connection pool which I mentioned in the issue comment is a different term from pooling.
Rodrive
@Rodrive
May 03 2016 13:44
Ok i will have to read this
Sercan Özdemir
@rsercano
May 03 2016 13:45
Soon, I can change this implementation as described in this blog post. But I haven't encountered any issue about ram or connection pools so far. (Since database-stats section executes serverStatus query internally, that could cause a problem)
(but not)
Rodrive
@Rodrive
May 03 2016 13:45
Its just when i saw you were making a new mongoclient in each command i was wondering if this was good or not
I'm currently trying to understand how mongoclient is structured to be able to switch database
Sercan Özdemir
@rsercano
May 03 2016 13:47
It depends. Of course I'm not saying it's a good example but as I told, I've never encountered an issue about ram or connection pools.
Rodrive
@Rodrive
May 03 2016 13:48
This is why i'm running through all your code to try to understand how it works :D
Sercan Özdemir
@rsercano
May 03 2016 13:50
In this situation I got some good points. Such as every query which user executes on server tries to re-connect and this leads me to show correct error if server goes down or something happens to it.
Rodrive
@Rodrive
May 03 2016 13:51
Ok
Sercan Özdemir
@rsercano
May 03 2016 13:51
if you are doing something simultaneously, of course it's the best way to not creating mongoclient every time
and I don't have to keep tracking timeouts or connection errors and so on.
Rodrive
@Rodrive
May 03 2016 13:52
You did a really great job here
First time i'm working on meteor but this is really impressive
Ok your explanation confirms what i had understand so far
So to be able to 'switch database' i have to create a new Connection in our database
and switch the currentConnection on this new document
Sercan Özdemir
@rsercano
May 03 2016 13:57
Well, thank you so much :) If you mean switching database in mongoclient
yes unfortunately, current version of mongoclient supports only one database connection for each connection*
This is in the queue :)
Rodrive
@Rodrive
May 03 2016 13:58
yes i tried at first to execute db.getSiblingdb
then i understood that each command was a 'new connection' and the informations of this connection came from our local database
Sercan Özdemir
@rsercano
May 03 2016 14:00
yeah, that's correct.
Rodrive
@Rodrive
May 03 2016 14:01
So for now i will just copy my connection and change the database and user if necessary
and connect to this new connection
Sercan Özdemir
@rsercano
May 03 2016 14:02
yeah, soon I'll implement to capability of browsing a server regardless of database counts
Rodrive
@Rodrive
May 03 2016 14:02
That will be great :)
Sercan Özdemir
@rsercano
May 03 2016 14:04
:+1: :smile:
Rodrive
@Rodrive
May 03 2016 14:36
I have a question how do you compile this webapp into a desktop client
Sercan Özdemir
@rsercano
May 03 2016 14:37
There's an app called electron distributed by github. It helps you to build desktop apps from javascript applications. I used electrify github project for this purpose
Rodrive
@Rodrive
May 03 2016 14:37
You have to run the app on each os ?
Sercan Özdemir
@rsercano
May 03 2016 14:38
for electron you don't have to. But there's no fully-supported qualified electron project to build apps builtin meteor. So with electrify yes I had to build every distribution on each os.
Rodrive
@Rodrive
May 03 2016 14:39
Ok so you run it in vm each time you release
Sercan Özdemir
@rsercano
May 03 2016 14:39
yes.
Rodrive
@Rodrive
May 03 2016 14:40
Ok thanks