Forums

Regular data import from an external database

Hi, I am testing my ecommerce web app based on Django and I would like regularly import data from outside database. I work in warehouse that has the ERP system. There is possibility to extract from there such data I need. I thought about it to create on our company server a database that would contain such data as price_A, price_B, price_C, quantity, name, code and id of products. Let's call it Mydb. This database would be synchronized with ERP database. I would like to import data from Mydb to ecommerce database on PythonAnywhere (let's say once a day).

In conclusion, I would like my ecommerce web app with own database work on PythonAnywhere but I would like to be able to import data from my company server. Because I need to have relatively up-to-date data in my web app.

What is the best way to do this on PythonAnywhere?

You can ether periodically pull your data from the warehouse system or make it push it to some endpoint in your web app on PythonAnywhere.

I thought about replication database. Our internal server would be as master while slave would be located on PA. Every changes on master will be save on a slave. Is it possible to do that?

That's not something we can do. If you only need it updated once a day, then you could have a scheduled task that connects to your ERP system an updates your PythonAnywhere database from there.

Through the api, for example?

If it was running as a scheduled task on PythonAnywhere, it could make requests to eternal sites and then write stuff directly to the filesystem (or to your MySQL DB, or anything like that). Alternatively, if you wanted to run the task on some external system to "push" data to PythonAnywhere, then yes, our file API would be a good way to get that done.

And is it possible to connect with Mysql database on PA remotely? From our internal server I have possibility to send the company data to another database in outside - I mean to database on PythonAnywhere in this case. I just need the data to connect with this base. It would be perfect for me.

I found https://help.pythonanywhere.com/pages/AccessingMySQLFromOutsidePythonAnywhere/

I think it will be helpful for me

Yes, that help page should explain everything you need to know bout that.

Thank you for your help

Glad to hear that it is helpful for you.