I came across a client neded to sync his stock with his new online ecommerce website that I developed.
- Local PC running on windows with MySQL Community server 5 while th online ecommerc is running on CentOS cPanel CloudLinux server with Litespeed, PHP 7.4, MariaDB 10.
- The objective now is to create an extra temporary MySQL table for the stock to sync with.
- Before I can develop a PHP based platform to CRON the sync every 15 minutes, I need the connection to work first.
- I started to learn about this "FEDERATE" engine, which i found out on stackoverflow.com, instead of the comon innoD or MyISAM engines.
- The federated storge engine is very interesting, even though I have not find out the pros nd cons yet, but it saves a lot of my time and cost where befor that i am still not sure to use mysqldump etc.
- It tooks me 10 minutes to ty out the sample code, my time is actually wasting on diagnostic the MySQL 8 community server on Windows 10.
- I finally able to see how it's working and viola! This is what I want.
- The main feature of federated table is, what ever i did to the table locally, it will update the remote table exactly.
- [Continue and updated on 10-Aug-21]
- According no.8, today i found out it is vice versa, whatever i modified on remote table, it reflects on local pc database too. Cool!