#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    95
    Rep Power
    13

    Postgresql more reliable than Mysql?


    Hello

    I started my project using mysql + java and now that I'm using multiple threads of my app, Mysql crashes about once every 2 weeks and I get a lot of communication failures with mysql.

    Will switching to Postgresql solve the crashing and communication failures problems?

    Best Regards!
  2. #2
  3. So help me Codd
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Location
    Brazil
    Posts
    362
    Rep Power
    29
    MySQL isn't famous for reliability, but we have no idea why your database crashes. But, we have thousands of customers (financials) using our Java application with PostgreSQL, it just never crashes. We started in 2004 with version 7.4, we never saw any crash because of the database. There were a few hardware problems, but that's something else.

    PostgreSQL saved us a lot of money and never gave us any problems at all. Hibernate does the communication and connection pooling, works great. JDBC could do the same, but without the ORM-overhead.

    Comments on this post

    • shammat agrees
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,803
    Rep Power
    353
    I agree with pgFrank.

    My experiences are similar although we didn't start with 7.x but with 8.1. We never had our server crash even under heavy load
    But then - then there are probably a lot of people who can say the same thing about MySQL.

    As we don't know why your MySQL installation is crashing nobody can definitely promise you that PostgreSQL will do better (although I'm pretty sure it will )

    Your problems could be a MySQL problem, but also could be something outside of MySQL (harddrive, RAM, network, CPU, temperature, ...)

    You should really invest some time and analyse why and under which conditions MySQL is crashing (maybe try a newer version as well)
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    95
    Rep Power
    13
    Thanks for the replies.

    The crashing is not the biggest issue for me. I keep getting the following error from time to time (every 4 hours)

    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    I googled it and it seems like a lot of people have the same problem.

    I will install Postgre on my vps to test it, I'm looking forward to seeing it be more reliable
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,803
    Rep Power
    353
    Originally Posted by arya6000
    Thanks for the replies.

    The crashing is not the biggest issue for me. I keep getting the following error from time to time (every 4 hours)

    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    That sounds like a network problem. If that is the case, Postgres won't do any better.

    This could be related to e.g. a firewall closing idle TCP connections and your connection pool doesn't handle that correctly.

    Try to reduce the idle time of your connection pool (so it physically releases connections before they are closed by the firewall) or check the settings of your firewall.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    95
    Rep Power
    13
    I made the switch a few days a go and I'm loving Postgresql so far , no more disconnects or any crashes.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    17
    Rep Power
    0
    Originally Posted by arya6000
    Hello

    I started my project using mysql + java and now that I'm using multiple threads of my app, Mysql crashes about once every 2 weeks and I get a lot of communication failures with mysql.

    Will switching to Postgresql solve the crashing and communication failures problems?

    Best Regards!
    I've had years of experience using MySQL since the package had to be manually installed back in the days of 3.2.23. I found MySQL to be quite adequate and stable until I started moving onto jobs that required higher loads and found even the most modern versions of mysql (5.1+) to be very unreliable with transactions and data integrity. It is even widely documented that they are well aware of the issues but are unlikely to ever issue a patch as it would affect to many installations.

    This led me to look for other database solutions, I tried Oracle and found it to be much more feature rich, but gawked when I saw the price tag.

    Like Goldylocks' porridge - MySQL was to cold, Oracle was to hot - I found PostgreSQL to be just the right temperature. Not only being extremely stable and provide a much better array of functionality, but ultimately a better pedigree.

    I realise this is a long and perhaps unnecessary way of getting around to an answer to your question but I agree wholeheartedly with the other posts. PostgreSQL woops MySQL's butt - to put it directly.

    As some side trivia Yahoo! has the largest Postgres database with 2 petabytes, and that was a couple of years ago [1]. More recently Skype is using Postgres to scale to support over 1 billion users [2].

    [1] http://glinden.blogspot.com/2008/05/yahoo-builds-two-petabyte-postgresql.html
    [2] http://highscalability.com/skype-plans-postgresql-scale-1-billion-users

IMN logo majestic logo threadwatch logo seochat tools logo