If you're starting a large-scale project from scratch, by all means design it for NoSQL (and find some way to deal with the transactions you still need - you'll probably still end up with a few normal DBs for lock tracking, as distributed locking is hard). That's fairly useless for existing large scale apps: basically everyone but Google is using sharding over SQL DBs, and you just can't "port" between those worlds.

Eventually I expect all the big players to do from-scratch re-writes for the NoSQL world, bu

"Now we've switched to Postgres, because MySQL's future is so hazy..."

It's no more hazy than it was when Oracle took it over. The MariaDB project is largely run by ex-MySQL developers... where's the problem? If anything, it was Oracle that muddied the waters. Now things are getting BACK on track.

I like Postgres in some ways, but it has some significant deviations from standard SQL syntax, and other idiosyncracies.

For me (I'm not doing anything "enterprise" at the moment), the slight performance gain of Postgres is not worth putting up with its oddities.

As long as MariaDB is requiring copyright assignment [mariadb.com], there's every reason to believe it will be sold off again the same way MySQL was. The FSF gets away with that for GNU projects because they've never abused contributor trust before. Monty is no FSF, and there's no reason believe MariaDB will remain outside of commercial control any better than MySQL did. I can't believe people are falling for the same trick again.

PostgreSQL aims for SQL standards conformance [postgresql.org] as much as possible. It's hard sometimes due to the difficulty of participating in the standard process [lwn.net]. The idea that MySQL does a better job in that area is kind of odd though. You'll have to list some sample Postgres "oddities" to be credible with that claim.

That can only happen if they replace all the MySQL code with something completely different. MariaDB doesn't own the commercial rights to that because they sold it to a company now owned by Oracle, only the same GPL rights that everyone else has.

All they need is a compelling set of new code to sell a business based on that. Every time someone contributes to MariaDB, they're building exactly what whey need to end up with something they can sell again.

There were some contributors to MySQL AB code that were hired as employees. Other than that, community contributors got nothing from the eventual sale. MariaDB is structured the same way. The only way they share profits is if they're impressed enough to hire you. Otherwise community contributors got zero before, and so far all the evidence says they'll get zero if Monty sells out again.

I made no such quoting error--that was direct from the New BSD text on the Wikipedia page--and I can't make any sense of whatever it is you're claiming. The 3rd clause of the New BSD license is "Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission". That puts no restrictions on the code, only on the identity of the contributor. It just says that if I contribute code, the project can't use my name and write "Greg says our project is awesome" simply because I contributed--not without my written permission. That's what endorsement/promotion means here. The BSD licenses have always had "endorse or promote" restriction text of this form in them, because the University of California @ Berkeley didn't want people to think a BSD license says they approve of a program.

If you're reading any sort of profit or sale restriction out of that clause, you're very confused about what these licenses mean. I'd recommend Why you should use a BSD style license [freebsd.org] as a good piece comparing these licenses. Modified BSD License [oss-watch.ac.uk] is more terse description of the same area, with a particularly easy to follow description of New BSD->GPL moves work.

MariaDB picked New BSD as the alternate license because it's "GPL compatible". That means they can just slurp up any contributions under those terms without worrying about the copyright trail on that code at all. All they have to do is include the New BSD license in their source and binary distributions for those parts, not mention their contributors by name so they're not seen as endorsing that commercial version, and they're done. New BSD code gets assimilated trivially, GPL code comes in with copyright assignment, and therefore at all times MariaDB is uniquely able to sell derived products or the company itself with full ownership of any new code added--again.

What I don't get is this...why does anybody think MariaDB is ANY safer? I mean its still run by old Monty, right? The guy that sold MySQL out from under the community to Oracle in the first place? And don't he still require that ALL code contributed have the rights signed over to him?

If he fools you once? Shame on him. If he fools you twice? You are an idiot that deserve what you get.

I like Postgres in some ways, but it has some significant deviations from standard SQL syntax, and other idiosyncracies.

Strange you would mention that, one of the reasons I've switched to PostgreSQL (and never looked back) is because it more closesly follows the SQL standard and has many less "gotchas" and bugs than MySQL (boolean is actually an int field, reset counter on increment, etc).

When people complain about Postgres' "non-standard SQL", this usually comes from those that have only used MySQL and think it's the standard.

About the only technical advantage MySQL has over Postgres is an easier setup, and generally better performance out of the box (before any tuning).

About the only technical advantage MySQL has over Postgres is an easier setup, and generally better performance out of the box (before any tuning).

I think that clustering on Postgres is so obscure as to frighten off all but the most knowledgeable (or foolhardy idiots). You are presented with a list of do it yourself options [postgresql.org], but no concrete recommendations. Comments like "pgpool 1/2 is a reasonable solution. it's statement level replication, which has some downsides, but is good for certain things" probably only help if you know exactly what you want already!

MySQL has had replication as a built-in for a long time, and I encountered such a system at work when it was 3.x. BUT the clustering system seemed to cause more problems than it solved - stuff kept getting out of sync or the syncing completely stops. Was someone else's job to maintain it, but I had to help fix it from time to time...

Might be better now, but point is MySQL implied it was fine back in 3.x despite its crappiness.

I don't doubt what you say (I don't have the expertise to judge it) but I should have pointed out that the number of people who really need clustering (as opposed to hot or warm backup) is very small. We realised that beefier hardware with hot backup was a much easier solution. Our DB expert tells me that the number of people who need a scalable conventional SQL cluster is getting to be a really small niche, with single-node systems improving and eating into the bottom half and NOSQL systems eating into th

Yes, thank you. PDO was what I was going for. Do you realize how many acronyms are in my brain? It's not like I said "use an ACL" or something unrelated.

No, I'm not a real programmer, I'm just someone who writes code that sells stuff, which includes being savvy in so many areas that sometimes I mix up my acronyms. This is beneficial, however, since if I was a "real programmer" I wouldn't have the slightest clue how to sell the products that I sell (not without a minor in horticulture or something, at the v

The real joke of this is that Postgres has been, by any measure, a better database than MySQL for twenty years. Back in the early 1990s when we were running on i386s and Sparcs, there was some argument for using MySQL because (in those days) the fact that it didn't have proper transactions and proper reverential integrity, it was faster for simple queries from single tables. Now, even that isn't true any more. Postgres is just the best engineered RDBMS out there bar none, and it's free.

Why is this? I checked their website, it's not a 1990's throwback. I remember the Postgres vs MySQL arguments from back in the day.

Is their syntax weird? Is there some painfully annoying thing about it? Were there different licenses in the past causing a strong divide which are no longer relevant? Was something done years ago which alienated a large chunk of the community? How did MySQL get such critical mass?

Probably the main reason is that it has a "design philosophy" of "if you can't do what the user wants, better to do something and say it's all OK than to give an error", which some people mistake for ease of use.

MySQL got its critical mass by it's easy, tight integration built into PHP. Any random college student could build a website backed by a database pretty quickly. It was a total failure to anyone that wanted to do serious work with it, but serious work was never an issue. As those college students entered the workforce, they tried to keep the tools they learned. People worked around their tech's limitations until new versions added it in, instead of migrating to competitors.

So it was a perfect storm or filling a niche for a community that just kept growing.

I don't really remember that well anymore, but Linux and MySQL have always been tied together...probably because mysql was relatively fast out of the box. Even today Postgres' default's suck, and the wiki says so:

I'm not sure that "know any better" is all that relevant. Sure, at this point there are tons of enterprise level clusterfucks built on PHP. Don't get me wrong about that... though, it certainly fills a void when robustness is less of a concern.

Most of these sites started small and then gradually grew. When the choice of what DB to use was made there probablly were only one or two people involved. The idea guy and the coder (who may or may not be the same person).

By the time the project becomes big enough for the issues with mysql to become apparent the app has already been built arround that platform. So the company (which has likely grown to more than two people at this point) has to choose between either keeping piling on the hacks to keep thin

My guess is that you weren't using Windows. On most *NIX platforms, installing either was pretty trivial. On Windows, however, MySQL had a point-and-click installer years before PostgreSQL worked reliably on the platform. For web developers working on Windows, this meant that if they wanted to install the same DB on their dev machine as on their deployment system, MySQL was a clear winner.

Uh, Postgres has all the standard GRANT and REVOKE, plus some things I don't immediately recall MySQL supporting. This support goes back at least to 7.3, which is a decade old. From what I can tell from the changelogs, looks like they started adding that around 1997 in 6.0.

I'll also note that PostgreSQL places a lot of importance on following the standards - they seem to support far more things than MySQL. In fact, looking at their "list of unsupported SQL features", it seems the bulk of them are "embedded [outdated programming language]" of one sort or another, or fancy XML stuff.

i am using both a bit, although i'm using mysql more. if you are unimpressed with mysql, why do you have to troll every story about it ? surely you can discuss pg in the articles about pg... current behaviour makes pg advocates look bad (especially as most comments here are by anonymous cowards)

No, the real joke is Firebird DB is better than both MySQL and Postgres in terms of speed and disk usage.

Nobody uses it though. Firebird is to MySQL as BSD is to Linux. That is, it had some commercial/legal "complications" in the beginning of its life that have forever made it a loser despite being better.

I know. The inertia with MySQL is just pain ridiculous. I'm currently weening the company I work for off MySQL because we're starting to get amounts of data that is necessitating ridiculous sharding frameworks in MySQL with implications for applications, and everyone seems to think this is fine and a sign that everything is OK. I've heard it all - "MySQL is what I know", "Does Postgres have support for bulk loading", "We don't need what Postgres provides, we can do all that in MySQL"........

It's a variation of the BSD/MIT license, which has fewer restrictions than the viral GPL. It's functionally equivalent to the most permissive Creative Commons license, only requiring attribution. It's explicitly listed on the OSI website [opensource.org] as an approved license.

"Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the foll

My guess is that he doesn't understand how sequences work, and expects more than just a monotonic counter.

Specifically, I think he missed this line in the documentation:

To avoid blocking concurrent transactions that obtain numbers from the same sequence, a nextval operation is never rolled back; that is, once a value has been fetched it is considered used, even if the transaction that did the nextval later aborts. This means that aborted transactions might leave unused "holes" in the sequence of assigned v

What do you mean "out of sync"? You mean it generates the same number twice? Or do you mean it can generate a number that has been assigned by some other mechanism to a primary key field?

If the latter, that's true of database sequences in general, including Oracle RDBMS. Some platforms, such as SQL Server, give you both sequences and autoincrement fields. The reason to have both is that while autoincrement is simpler to use, sequences are more flexible (e.g. you can obtain the key value for a row before t

* No way to "use dbname" for switching DBs inside psql - must quit and restart with different dbname

* Issues with double quotes vs single quotes vs ticks - no opinion on which is best way to go but would be nice if a translation were available

* The commands aren't as easily memorable: \d vs show tables: another area where some compatibility would be nice. I kind of prefer the show tables, show databases, show create table style instead of \d, \l, \(can't do it in psql, use pg_dump)

Those are some things off of the top of my head.

Makes it so much more work to switch - each dumped table must be manually tweaked to load into psql.

I'm playing with it now, and growing more comfortable with psql but not sure I'm going to dump, edit, import all tables in all|any databases so I can have... 2 db servers running on my box.

I'm itching for a good reason to switch.

It's a shame that the new recently that Google is dropping MySQL didn't end with "and they're going to use Postgres" -- they have the resources to make a conversion suite / patches that would make it easy for a large scale adoption to occur.

There's no direct replacement for SHOW CREATE TABLE. There are two similar things and a tool to do it though:

-Run CREATE TABLE y AS SELECT * FROM x LIMIT 0; That will make you another table just like the one you have, but with no data in it. That only gets you an exact duplicate, it doesn't show you the DDL or allow changing it in the middle. (You can then ALTER TABLE the result though, for 'like this but with X different' cases)-pg_dump with the options to only dump the schema. You'll have to dig the

* mysqldump | psql doesn't work even with --compatibe=postgresql: ints have precision (int(11)) and comments don't work the same

If MySQL has a --compatible=postgresql option that doesn't actually produce PostgreSQL-compatible output, then that's pretty unambiguously MySQL's fault, and not something that PostgreSQL can do a great deal about.

True, and I'm certainly not putting blame on Postgres, but it would be nice if they had a pg_mysql_import_from_dump as MySQL's compatibility is b0rked.

I see various scripts out there, on Github for example, that claim to aid in the transfer. But it seems the consensus that manual fiddling is required. Perhaps I should make a name for myself by building something that eases the process. A "pg_mysql_import_from_dump" as it were.

No way to "use dbname" for switching DBs inside psql - must quit and restart with different dbname

\connect, or alternatively, use schemas instead of databases and SET SEARCH_PATH.

Ah, good idea. Schemas are an option but if transferring a, say, Drupal install over, one doesn't want to have to ensure that the schema is prepended onto all SQL. I prefer to have individual DBs. So when in psql, I shall try \connect. And... it works perfectly. Thank you.

Issues with double quotes vs single quotes vs ticks - no opinion on which is best way to go but would be nice if a translation were available

And the article confirms the large-scaler users aren't part of that elusive group, either:

Many of the largest MySQL users — Twitter included — do not currently pay Oracle for an enterprise licence. Twitter, like Facebook, prefers to build their own extensions and customisations off the community version.

At the moment we do. We have a moderately sized Oracle environment but the company owners have been annoyed with the Oracle support costs and started moving to MySQL several years ago. Considering our environment, we paid for MySQL enterprise licenses. When Oracle bought MySQL, the company started moving to Postgres. Same when Oracle killed Sun (the Oracle DB license fees kept us from upgrading our older Sun equipment so we moved to Linux on Dell and then virtual machines). Now we're using Redhat and Postgr

Hell, it's not even cost effective to switch to another SQL database like PostgreSQL.

Can you imagine the downtime required to export Facebook from MySQL and to re-import it to another database? The users would go ballistic!

I don't expect any "earth shattering" movement by any of the big users in the near future.

I'm involved in a project that involves moving databases.
We write each transaction to both the old and new structure using our data access layer, then export historic data and eventually, once we've verified the new system is working as expected, remove the old structure from the data access layer.
This is the main reason data access layers are used.

Facebook uses a NoSQL database (HBase) for their messaging system, and some related tech for data analysis (Hadoop). They also have custom photo serving software (haystack) for their photo storage. The main data (status updates, friends, likes, etc.) is in MySQL with memcache in front of it. There is also a cache layer (varnish) in front of the web servers. They said NoSQL isn't ready and point to the smaller messaging system needing more staff.

Enterprise gives you basically better administration tools (monitoring, backup, HA, etc), and support. If you really need them, you will still need them if you switch to MariaDB, or will be a reason to not to swich (there are more players in the support area and extra tools, anyway). But most of hose players have good internal knowledge on MySQL, and have contributed code and patches to it, probably are not the target for the enterprise version.

I switched to MariaDB but my database is the size of a microbe so the few quirks were of no difficulty; but there were quirks. MariaDB was not a plug in replacement. I love it and wouldn't go back but it did take a tiny bit of work. So if I had one zillion servers with crazy databases I would be taking my time on that one. I suspect that what you will see is new development experiments depending on MariaDB and slowly increasing the pressure until they just make the switch.

The other question is how many obscure features of MySQL features are they using? (Including custom code)

I personally think that the real problem with Postgresql happened 10 years ago. At that time it was not possible to run Postgresql on Windows(it was only possible via cygwin). That helped mysql get critical mass and Postgresql stayed behind. Then the snowball effect came into play and mysql was getting much more users compared to Postgresql.

and if they ever did pay for Oracle for support. I mean, why the fuck, if you can employ your own mysql experts. would oracles guys seriously be of much help? wasn't the reason they went with it originally that they didn't have to pay...

I've wondered this as well. Facebook is one of those companies that can pretty much attract whatever talent they want. Hell, they could probably just outright poach a MySQL engineer or 10 for cheaper than official support.

Well, if you change enough about it, you will also have to get a type safety permit for it (at least on this side of the Pond). This includes submitting another item for the crash test. So apart from legal issues with the manufacturer, you may have issues with your government.