Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upis it a best practice to call `establish_connection` for every request? #555
Comments
This comment has been minimized.
|
In production, you probably want to use connection pooling. Have a look at r2d2-diesel (and lazy_static). I think there is an iron-diesel crate, maybe you can have a look at how they did it.
We have a gitter.im channel (linked in the Readme; also works via IRC) if you want to say hello :)
… Am 28.12.2016 um 06:56 schrieb Robert Balicki ***@***.***>:
Happy to take this to an IRC channel/slack group, but couldn't find one. Not sure if rust-beginners is appropriate, either.
I'm writing a web app using diesel and rocket, and in every route handler I'm calling establish_connection (straight from the getting started guide). Is this unnecessary overhead? Should I store a single connection to a database somewhere, and reuse that one?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This comment has been minimized.
|
thank you! |
rbalicki2
closed this
Dec 28, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rbalicki2 commentedDec 28, 2016
Happy to take this to an IRC channel/slack group, but couldn't find one. Not sure if rust-beginners is appropriate, either.
I'm writing a web app using diesel and rocket, and in every route handler I'm calling
establish_connection(straight from the getting started guide). Is this unnecessary overhead? Should I store a single connection to a database somewhere, and reuse that one?