I have one master database (MySQL
) hosted on Ubuntu Server
with the machine timezone set to America/New York (Default).
Below command is showing that MySQL
is using system timezone.
mysql> @@global.time_zone, @@session.time_zone
I have 3 Servers hosted on different regions. Basically regions near to user base.
Server 1 : Hosted on Europe Region.
Server 2 : Hosted on North America Region.
Server 3 : Hosted on South America Region.
These servers are managed through load-balancers and using Round-robin
method. All these servers are storing data on same MySQL
server.
All these servers have their native timezones and all are different timezones.
I want to scale master database to take on the extra load and also want to add some new servers at asia.
Does using different timezones for multiple servers cause problems in near future ? Or should I use same time zone for all servers (America/New York) and database server too ? But I want to use mysqli date functions when selecting data and also want to show the data into user native timezone.
Currently I am converting all dates to America/New York timezone and then storing in MySQL
database, but it may take performance hit. And displaying to users by converting them by their country.
What is the best approach to do this?
Btw I'm using Apache
,Mysql
and PHP
.
Thanks in advance.