Google Groups
Subscribe to Software Outsourcing [ Hire Dedicated Group ]
Email:
Visit this group

Thursday, August 23, 2007

Mysql Vs Postgresql

My sql is good to use it provides also good features. But Postgresql is the best. MySQL does not support subqueries, stored procedures, subqueries, cursors or views, all of which PostgreSQL does.

The main Deferances are listed below:

  • Support. Support can mean many things. MySQL is much more widely used, so many more applications support MySQL, and there is a larger community ready to assist you with problems, as well as more books and resources on MySQL. MySQL AB, the commercial company guiding MySQL, and who employ most of the developers, offer various levels of support contracts. Of course, PostgreSQL has active mailing lists, and there are commercial companies offering support as well, so you are not likely to go too far wrong with either.
  • Ease-of-use. Another highly contentious issue. Debate usually goes along the lines of "A: MySQL/PostgreSQL is much easier to use because... B:You idiot. PostgreSQL/MySQL is just as easy because...". Often it is simply whichever one the person uses is the one that is easiest to use, which is not that helpful. An astronaut may find flying the space shuttle easier than writing a document on a PC, but that tells us more about them, not about how easier we would find either. If you are migrating to one of the databases, it depends where you come from. And, it depends on what you are doing. If you regularly use sub-selects or triggers, rewriting them in MySQL or a scripting language will seem unecessarily complex. PostgreSQL's extra functionality can translate into complexity if you do not require any of it. It also depends on what tools you are using - phpMyAdmin for MySQL is a well-developed tool, while phpPgAdmin is not as fully-featured. So if you are looking for a web interface in PHP, and for none of the features MySQL lacks, MySQL would be your choice here. But perhaps you do not need the extra features of phpMyAdmin? They both do everything you want!
  • Stability. MySQL claims in its press releases to be extremely stable, but the 'word on the street' is that this isn't true. It is easy to blindly repeat mantras, but again, it depends on your needs. Running a website with 10 users a day? Even MS-Access would be stable! I have used MySQL on high-volume websites, both its non-transactional MyISAM tables, and the transaction-capable InnoDB table types. And yes, I have experienced table corruption numerous times, but this could always (I think!) be blamed on faulty hardware, and I have never had a problem recovering (with the simple REPAIR TABLE command turning me into a master DBA). MySQL is used in extremely high volume environments without problems. PostgreSQL's advanced features are more likely to be stable than the newer MySQL equivalents, having been implemented for longer. However, replication is much newer in PostgreSQL than MySQL, so the reverse applies. But here again, the supposed commoditization of databases means that database stability is taken relatively for granted, and the software tends to be a lot more stable than the hardware it relies on.
  • Speed. MySQL aimed first to be a fast database, while PostgreSQL aimed to be a fully-featured database, and both are converging in the other's direction. Used appropriately, MySQL's MyISAM tables are indeed extremely lightweight.

  • Licensing. MySQL AB is often used as a model for Open Source companies attempting to make money. MySQL is released under the GNU GPL (General Public License), which requires derivative works to be similarly licensed, but also offers commercial licenses for those who do not want to be restricted in this way. PostgreSQL is distributed under the BSD license, which basically allows any use of the code as long as the credits are maintained. BSD vs GPL is another topic for a flame war!