Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Development Tools

nicholas maddren
nicholas maddren
12,793 Points

Live MySQL data updates?

Hey guys, I currently use a CSV file to update my database every 15 minutes using a cron job. This seems to be a little impractical as I really need live data and the whole CSV importing and replacing process is a little server thirsty.

Does anyone know of any methods to update a MySQL database with live data? For example let's say I have a called database1 on another server and I want to bridge any changes on database1 to my database which is named database2, how could I do this? It would need to post the changes instantly.

Thanks

1 Answer

Jonathan Petersen
Jonathan Petersen
45,548 Points

If I understand your question correctly, I believe you are asking about replication. There is some lag, but low in most cases.

Here is some links to MySQL replication resources --

http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html http://www.mysqlperformanceblog.com/2013/01/09/how-does-mysql-replication-really-work/

Hopefully this will get you started.