远程Mysql Curl还是Cron?忠告

时间:2016-04-23 05:35:59

标签: php mysql curl cron

这可能听起来很傻但我不确定我是否走正确的道路。我正在关闭www的内联网上工作。我有一个每日更新的日历,我想在公共网站上显示使用的时间段,以便特定用户进行任命。现在我不想出于安全原因将内联网暴露给外部世界,所以我复制远程服务器上的表以从我的localhost更新它,这给我留下了一些我能想到的选项:

1) Run a cron that update my local table and remote table each 10 minutes.     
   This work ok but that 10 min gap (or x min gap) may cause overlapping and i am not fan to query 
   the db without need specially the local one.
2) Allow mysql remote access of the remote server only to the IP of the local server and 
   this would update the remote tables in real time when the user add an event locally.
   This is the path i am taking as is fast and will avoid overlapping but not sure if its the best way.
   Im not using SSL o tunnel for this, as the remote table is just a copy of the local one, 
   i will just have to run by force a cron to ask for new data on the remote server and if so
   update the local one.
3) Use curl as to talk with the remote server and vice versa and let them handle the db
   individually. This one is really slow on my tests and a bit tricky to post query results 
   via curl plus this would have to run on a cron as well taking me back to the point 1)

如果对这个想法有任何更好的方法或建议,我将欣赏任何灯光。

0 个答案:

没有答案