{"id":1498,"date":"2018-01-19T19:22:54","date_gmt":"2018-01-19T19:22:54","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/mysql-and-postgresql-compared-page-3\/"},"modified":"2018-01-19T19:24:50","modified_gmt":"2018-01-19T19:24:50","slug":"mysql-and-postgresql-compared-page-3","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/mysql-and-postgresql-compared-page-3\/","title":{"rendered":"MySQL and PostgreSQL Compared Page 3"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Tim Perdue<\/div>\n<div class=\"\">on July 30, 2000<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<h2>MySQL<\/h2>\n<div class=\"articlePara\">\nThe numbers for MySQL ring true with what most people already know: it&#8217;s a<br \/>\nfast, although lightweight database that will probably serve well for the vast<br \/>\nmajority of web sites. However, if you plan on having a high-traffic site (say,<br \/>\ngreater than 500,000 pages per day), then forget MySQL as it can tend to fold<br \/>\nup and die under load. Anyone who has ever visited slashdot can attest to the<br \/>\nfragility of its setup (mod_perl and MySQL).<\/div>\n<div class=\"articlePara\">\nBut again, the vast, vast majority of web sites fall well under the 15-pages<br \/>\nper second demonstrated by MySQL here. If you ever surpass a sustained 15<br \/>\npages per second,<br \/>\nyou&#8217;ll be delighted to fork over the cash for a bigger server or an Oracle<br \/>\nlicense.<\/div>\n<h2>Wins<\/h2>\n<div class=\"articlePara\">\nObviously, the advantage MySQL has over Postgres is performance. It also has<br \/>\nsome more powerful admin tools included in the distribution (mysqladmin allows<br \/>\nyou to watch processes and queries in-progress), like hot backup, a file<br \/>\ncorruption recovery tool and a couple others.<\/div>\n<div class=\"articlePara\">\nI&#8217;m also a fan of MySQL&#8217;s command-line tools. You can see database and table<br \/>\nstructures using describe and show commands. Postgres&#8217; commands are less<br \/>\nobvious ( d to show a list of tables for instance).<\/div>\n<h2>Limitations<\/h2>\n<div class=\"articlePara\">\nThe first thing you hear from hard-core database gurus is that MySQL lacks<br \/>\ntransactions, rollbacks, and subselects. You&#8217;ll really miss transactions if<br \/>\nyou&#8217;re trying to write a banking application, accounting application, or trying<br \/>\nto maintain some sort of counter that needs to increment linearly over time.<br \/>\nForget attempting any of those with released versions of MySQL (it should be<br \/>\nnoted that the unstable 3.23.x series of MySQL now includes transaction<br \/>\nsupport).<\/div>\n<div class=\"articlePara\">\nFor many, if not most, web sites out there, MySQL&#8217;s limitations can be overcome<br \/>\nwith a little elbow grease on the part of the developer. The primary feature<br \/>\nyou&#8217;ll miss in MySQL is powerful subselect syntax that is present in almost<br \/>\nevery other production database. If I had a nickle for every time I could&#8217;ve<br \/>\nused subselects in MySQL, I&#8217;d be able to buy a case or two of beer. In other<br \/>\nwords, this missing feature can be a pain in the neck, but it can be overcome.<\/div>\n<h2>Stability<\/h2>\n<div class=\"articlePara\">\nMySQL loses points in the long-term stability department. Simply put, MySQL<br \/>\ngives up the ghost randomly and for no obvious reason after running for<br \/>\nsemi-long periods of time (say 30-60 days). Many developers will compile MySQL<br \/>\n&#8220;statically&#8221; for just that reason, and doing so has helped some people.<\/div>\n<div class=\"articlePara\">\nThat problem again can be overcome with a good pager or a simple crontab entry<br \/>\nthat kills and restarts MySQL monthly. Not that I find that at all acceptable,<br \/>\nbut it is a solution.<\/div>\n<div class=\"articlePara\">\nWhere MySQL loses points in the daemon robustness department, it makes up for<br \/>\nit by apparently never corrupting its data files. The last thing you want is<br \/>\nyour precious data files fouled randomly, and MySQL does well here. In over a<br \/>\nyear of running MySQL, I haven&#8217;t ever seen a single case of database<br \/>\nor index corruption. In the same timeframe, I have done 2 or 3 recoveries of a<br \/>\ncouple different Postgres databases. (Regardless, backups are always your<br \/>\nbest friend, as shown by the database fiasco here on PHPBuilder.)<\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"tim200007054658.html?page=2\">\u00ab Previous Page<\/a><\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20000705.html\">1<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim200007054658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">3<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20000705fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"tim20000705af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"tim20000705fdb0.html?page=4\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>By Tim Perdue on July 30, 2000 MySQL The numbers for MySQL ring true with what most people already know: it&#8217;s a fast, although lightweight database that will probably serve well for the vast majority of web sites. However, if you plan on having a high-traffic site (say, greater than&#8230; <a href=\"https:\/\/phpbuilder.com\/mysql-and-postgresql-compared-page-3\/\" class=\"readmore\"><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1498","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"predecessor-version":[{"id":3342,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1498\/revisions\/3342"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}