Forums

MySQL vs PostgreSQL

Hello, I have a question regarding the databases offered on PAW. What is the difference between both of them (advantages & disadvantages) and what makes PostgreSQL a paid database?

Thanks! EndenDragon

The MySQL db is in a multi-tenanted environment, so there are some stuff you don't have permissions to do (eg: db triggers), and it is theoretically easier for another db user to affect your db performance.

You get your own Postgres db so you have a wider set of admin privileges etc. And postgres of course also has wider support for geolocation / more complicated stuff.

That's very interesting. Is it really its own running Postgres process for each user? How does that impact reliability?

It's actually a Postgres DB running inside a Docker container. I guess in theory it's more reliable that way; if there's a bug in the database server itself that means that one user doing something can cause the process to crash, then with our Postgres setup, if the bug was triggered, then it would only affect the specific user who tripped over it, while in the MySQL case it would impact all users on the server.

That said, DBMSs like Postgres and MySQL are extremely reliable, so that's more of a problem in theory than in practice. We have actually encountered bugs of this kind on MySQL and not in Postgres, but that may just be a matter of scale -- we have two orders of magnitude more MySQL users than Postgres. And even on MySQL the outages caused by the bugs have caused outages of a minute or so for the affected users (at least so far).

I am finding myself at a point where I think deploying my django site live version with postgres is the most future-proof way forward, although I still want to stage and test various levels with sqlite and mysql. The thing is there appears to be a limit of 50gb on postgreSQL database size in the accounts page. While I do not imagine hitting this limit any time soon, I was wondering if there is any plan to increase this limit or is it a kind of design feature of PythonAnywhere? In some senses this limit makes sense - mostly because if I have a serious databases that is huge and important it kind of makes sense to use Amazon RDS or something with all it's security and scalability and encryption and such, I just kind of want to keep this particular project within PA . Just curious really as I am at the point of deciding whether to include postgres in my account. Thanks.

The 50GiB thing is a soft limit -- we can certainly increase it if needed, we just need to have a human in the loop to make sure that disk space is sufficient on the backend systems.

Ah. Brilliant! :)

:-)