I'm writing two Django applications: one that generates a lot of data in time, and another part that displays it. The app that generate it will run on a machine at my home and the one that displays the data will be a machine on the internet.
What do you believe it will be the best way to transfer the data from the application that generates the content (SQL entries + documents) to the ap开发者_JAVA百科plication that displays it ?
My fist thoughts are to somehow send it though FTP (from code) as a zip payload, and on the display server to have a cron that will periodically process the new payloads and merge the data to the existing one.
Any other ideas? I would prefer python/django
Setup two databases - one master and one slave. Write on the master and make the slave to sync with the master. This way you will not need to worry when your connection is down.
This is what RESTful web services are all about.
Your web server does two things.
"displays the data". Presumably via HTML web pages. But maybe not. The question is too vague.
Collects the data created by your application "that generates a lot of data in time". This is ordinary REST requests, usually using a POST, with authentication and a reasonable level of security.
Your application "that generates a lot of data in time" will do two things.
"generates a lot of data in time". Whatever that means.
Use
urllib2
to make RESTful web service requests to your web server to provide that data which is displayed.
This is a really, really standard design pattern. That's how Amazon.com, eBay and just about every web site with RESTful API's works.
精彩评论