In this short video we cover a best practice I stick to when specifying the
database_host in Doctrine's configuration.
I always use the IP address of the database server - primarily due to there being one less process to go through when Doctrine is communicating with the underlying database - i.e. no name resolution.
This comes from a couple of types of Stack Overflow issues I have seen over the last couple of years - but have to say, I haven't experienced myself first hand.
The first is that as above, name resolution can add an additional overhead to the process. If specifying an IP address directly will remove this problem before it even emerges, then why not do this before problems occur?
Secondly, I have seen issues whereby connectivity to the database itself isn't even possible when using a named host. As I say, I haven't encountered this myself, but again, if specifying the IP address is a quick solution to a problem I don't want to have, then why not just specify it ahead of time, and be done with the problem?
So there you go. It might seem obvious, but if my experience is anything to go by, the obvious is usually the one thing you overlook when troubleshooting, and instead spend 4 hours diving deep into some obscure technical arcana when simply turning it off and on again would have sufficed.
If you have found this video helpful, please consider sharing. I really appreciate it.
|1||Improving Page Load Time With Doctrine Join||03:03|
|2||Doctrine Extra Lazy Associations||03:47|
|3||What's In A Name?||00:58|
|4||Partial Objects - Holy Premature Optimisation Batman||05:05|
|7||Doctrine Cache Money||08:11|
|8||Please Provide At Least Two (2) Written References||04:19|