Forums

PA mysql performance vs aws

For a hacker account, how is the PA MySQL performance equal to a aws MySQL? can I just migrate from aws MySQL without any changes of code?

It would be similar to a much larger aws MySQL instance than you would get, but you would be sharing it with other users.

The biggest thing to look out for with respect to migrating is that you probably don't want to make your own aws MySQL instance available over the internet (PythonAnywhere restricts it to access it just within it's own machines). Otherwise it may be a security hazard. There is a python library called sshtunnel that may help with that.

i need to let outside user to access. previously, the aws MySQL, I allow my mobile app user to access some of my data. Able to do the same in pythonanywhere?

you will be able to access an external aws MySQL database yes. (but you'd have to be a paying user)

when external user query from MySQL, will it consume my CPU usage? It will cause me into tarpit if it will

Just to clarify -- you can't access your PythonAnywhere MySQL server from outside PythonAnywhere, unless you use an SSH tunnel. To use an SSH tunnel, you need your PythonAnywhere username and password. So giving other people access to the MySQL instance via an SSH tunnel would mean they would need your PythonAnywhere username and password, which would almost certainly be a really bad idea for a mobile app :-)

The normal setup for mobile apps is that instead of accessing the MySQL instance directly, they make HTTPS calls to a REST API that you write and deploy in your PythonAnywhere account. This means that you can make sure that the mobile app can only make safe, well-defined MySQL queries and people can't, for example, do "delete from users;' and trash all of your data.

Hi giles, yes, actually I plan to create restful API using flask. When user access the API, will it consume my CPU usage? How much will it consume if it does.

No, it won't affect your CPU -- that's only for stuff you run in scheduled tasks and in consoles. For your Flask website, you have one worker process in a free account, and its CPU usage isn't counted.

Hi Giles, Hijacked a bit, the performance of mysql hacker account is comparable with aws rds small instance? It is because there are many specifications in aws but not stated in PA. Can you clarify?

The specific server type you're running is subject to change as we adapt the system, but right now we're using m3.large instances. But it's shared with other people, so the performance you get will depend on the total load on the server. We make sure they're running with CPU to spare, so perhaps the best way to think of it is that for short spikes of usage, you get a full m3.large's speed, but if you start using 100% all of the time then we may have to throttle your usage.