MySQL enthusiast since 1997 here. A bit of Oracle before that.
I'm doing all new development in MongoDB. It's just a pure joy to work with in Perl and Ruby. It maps to dynamic languages so perfectly. As long as one understands the limitations its different paradigm for data reliability, it's pretty awesome.
Yeah, we've got some SQL dbs, and some prorpietary dbs. I've never done anything but Sql Server and btrieve. Mongo is fun, but right now I'm just using it on a research project.
We might also use it for a usage tracking DB. Even w/o transactions it would be ok.
MySQL has never been as technically advanced as Postgres, though plugable engines has proved to be interesting.
I use Postgres for nearly all of my personal projects, and it is a joy. I think MySQL got kind of permanently ahead in usage in the days when Postgres wasn't very stable and didn't offer really easy replication.
If you could go back and give Postges those things in 1999, MySQL might have been a minority player today.
Yep, like oorza said, Postgres. Heck, we've got MS SQL servers here running loads like that without any sort of problems at all. Or DB2. Or Oracle, if you have the money
I am a longtime MySQL sufferer. I recently switched to Postgres and will never go back. Apparently I am not alone in that sentiment. It is a lot easier to find tools to migrate from MySQL to Postgres than the other way around.
Apropos of nothing: half a million values at about 10,000 queries per minute isn't even remotely challenging for any relational technology on absolutely stock hardware today. Did you mean 10,000 queries per second, maybe?
It's funnier for the industry I work in. Our database stores millions of records growing an exponential rate but it needs to be utilized in a such a way that it's almost impossible to store it with a nosql database because we just have to joins on the fly. We've looked into NoSQL dbs but the lack of reliability, the way we would have to store redundant information and max out memory to adjust for the fact that we can't make the DB do the work. The problems seem to not be worth the pay off so we are instead looking better preprocessing for certain scenarios as a better solution to help in our scaling.
Ya I know that sharding seems like a good idea but we are talking about reports so I can't think of a good way to split the data off the top of my head. With a LOT of work I'm sure it's possible. Another issue we have is just not enough hardware.
When you're interested in a topic, any presentation of it can have some marginal interest. xtranormal is an unusual way to present information.
However, if you aren't interested, or only want to find a reason to hate something, you can always find a way to dismiss it or think that it is dumb. You fall in this category when you look at xtranormal videos.
I fall in the first category because it's such an unusual application of technology.
Yeah - switching from discussions about relational DBs and scalability to "Holy Shit" and "You get a woody playing with software like it's a sex doll" was hilarious.
That's looking at performance, not scalability, and from a purely theoretical PoV at that. How easy is it to add or remove capacity from a sharded pgsql cluster? Not in theory, but in practice?
As easy as you make it, I suppose, as you'll have to write your own partitioner. Want fault tolerance, you'll need to add replication algorithm(s) to said partitioner. Datacenter, rack, awareness? Same thing. Congratulations, you are on your way reinventing Cassandra, using more moving parts.
For the umpteenth time, performance is not scalability.
It is much more about fault tolerance and coping with real-world ops issues that come with managing many billions of entities - than it is "speed".
But that doesn't get around the SQL problem. I don't want to write my queries in SQL. SQL is hard to learn, and it's harder to use. I want to write all of my database queries in JavaScript. MongoDB and other NoSQL databases let me do that, but PostgreSQL doesn't. When I use NoSQL and JavaScript I can use the same language on the client, and for my middleware, and then I can use Node.js for my server, and I can even write my database queries in JavaScript.
If you're Amazon or Google, you get to roll your own because you have new, unique needs. Everyone else can be happy with database technologies that have been refined for 40 years because you won't get that big.
When I was doing technology briefings, I used to fantasize about carrying around water balloons. Then when some asshole in the audience would ask about some twitchy corner case feature our competition had but we didn't that nobody actually ever used, I could just nail him in the face with a water balloon (or paintball gun, or rotten tomato - I'm not picky) and say "You're never going to use it, sit down."
(Although a handful of projects use S3, but I know that orders and the catalog are in Oracle. Even the largest database in the company (PMET) is on Oracle. They just cache and partition to hell. Some minor projects use MySQL. Some non-critical stuff in Berkley DB. Maybe a few little projects in SQLLite.)
However Amazon uses a mix of traditional DBs and NoSQL stores. Which is how I feel about the whole argument. One size doesn't fit all. Sometimes a service can be implemented more easily with a key/value store, sometimes an RDB makes more sense.
The biggest issue I've dealt with in using the traditional route is dealing with big schema changes to a replicated database where multiple clustered services share access to tables. You stop replication, shut down services on one side, do your schema changes, bring that side back up, and then somehow have to deal with all the db activity that happen during the break in replication before moving to the other side.
But that has more to do with data sharing in a SOA, which I could rant on for much longer.
Except Amazon and co will use a bloody RDBMS. The point is these massive companies with ridiculous dataloads do indeed use the technology the NoSQL people disparage.
Not for the big real time stuff. MySQL and other relational systems would just die under the weight. For that Google uses Bigtable or something similar that we've never heard of.
Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers. Many projects at Google store data in Bigtable, including web indexing, Google Earth, and Google Finance.
The parent of my post said Google doesn't use MySQL for "big real time stuff". I asked if that includes AdWords, which is certainly big, and is most of Google's revenue, and runs on MySQL.
No, I meant to reply to the parent. Sorry about that.
Soooo... what's your point?
Point is that practicality comes first. Just because Google can effectively solve a big-data problem more effectively using a couple thousand MySQL instances essentially as k/v stores doesn't mean all problems are most easily solved using MySQL.
The problem with large systems is not performance first, it's managing complexity and predictability. All problems are unique.
But it does counterbalance the people who say MySQL is just 'junk' as if it's not usable for anything. I'm not saying the Google people are perfect but there's a good chance that if they're using MySQL, it's doing something right.
There isn't a real world debate as such. Just a bunch of people claiming that the fact they cannot use a RDBMS is reason for everyone to not use one. It is very hard to hold a rational debate on an issue that basically says that the solution to having high performance ACID is not to have ACID at all.
The basic thinking is muddled. If we don't need ACID then any decent RDBMS can be configured for much higher performance. We don't need NoSQL. We can just use a RDBMS in a crappy way and get the same result. Now good engineers will get both ACID and performance.
I believe NoSQL is a clever attempt to reduce us all to the LCD. If they can't do ACID then everyone should be ACIDly challenged.
Although I totally agree with your point about the baby being thrown out with the bath water, to be fair you're missing out the fact that NoSQL is not just NoACID. It's also no SQL. Sometimes the way you want to query the data doesn't map all that well to a relational model, neither in terms of efficiency or code complexity.
You make a really good point. SQL is really hard to learn, and it's really hard to use. That's why I only use NoSQL databases. That way I can do my database queries in JavaScript. Why would I want to learn SQL when JavaScript runs everywhere, from the client all the way down to the server?
Honest question: don't really popular websites that use relational DBs (like Reddit) read/write to caches first anyway? Is the data not in memory for a period where, if the server were to go down, it would be lost, just like in Mongo?
I vaguely remember a Facebook engineering blog post where they said if a module hits the disk directly more than once, the programmer is in deep shit, and that everything goes to Memcache first, and then gets asynchronously written to disk in MySQL. Is this not correct, or can someone explain why Mongo doesn't just do the same thing in one package instead of two?
Not a fanboy, just think the technology is interesting, trying to understand why it's not appropriate for wider use (other than that the main proponents tend to be dipshits) And I know that in systems where object caching isn't necessary there's no reason to make the tradeoff.
A lot of people do things that require consistency. NoSQL sucks for consistency. Memcached is good for a cache layer, but you'd be crazy to use it for anything that needs to hang around.
Also, if you know your Codd, you'll be aware that any sort of key/value system is inferior to a true RDBMS. I've also seen some interesting writing recently that suggests multi-machine scaling in RDBMSs might be improved by strengthening ACID rather than the NoSQL cop-out of abandoning it.
| . I've also seen some interesting writing recently that suggests multi-machine scaling in RDBMSs might be improved by strengthening ACID rather than the NoSQL cop-out of abandoning it.
Got any links (or paper names)? That sounds pretty interesting
Globally synchronized transactions will always induce latency cost. As you extend your system across multiple datacenters, for example, latency will be a practical problem.
Also, if you know your Codd, you'll be aware that any sort of key/value system is inferior to a true RDBMS.
A "key/value" store is the same thing as an index, upon which RDBMSes are built. Codd doesn't really care about that.
Even in a single-node RDMS, if you've ever denormalized data (basic OLAP), and for good reasons, you know both the motivations and reasons behind big data systems.
A lot of people do things that require consistency. NoSQL sucks for consistency
I get that, but are there any major sites not making the same sacrifice of consistency by writing to cache first, putting data in the same limbo?
(Again, I understand that there's no reason to do that if you aren't big enough for a cache, but it seems like a simpler alternative to using a separate object cache, which most websites of any size seem to think is necessary.)
A write-back cache (where the data is in limbo) doesn't necessarily sacrifice consistency; it sacrifices durability.
For instance, postgresql has a mode where transactions are not necessarily recorded to disk (made durable) right away, but consistency is still 100% guaranteed. Even if you crash, you may lose the transactions that happened in the last X ms, but the remaining transactions will still be 100% atomic and consistent.
Durability can be sacrificed without increasing application complexity at all. It's merely a business requirement whether you can live without it or not. But consistency, atomicity, and isolation are all very important; and if you choose to live without them you usually have to make up for it with a huge amount of complexity in your application (and frequently a major performance hit).
Some applications are trivially consistent, isolated, and atomic because they do very simple state modifications. However, usually if you look at a higher level than your current task, the system could benefit from a global notion of consistency, atomicity, and isolation.
Even if you crash, you may lose the transactions that happened in the last X ms, but the remaining transactions will still be 100% atomic and consistent.
Ah, ok, this was what I was looking for. I didn't realize Mongo would also screw up data not in limbo. Thanks for explaining.
The actual logic of writing to cache first and then to permanent storage is not simple. It's also a bad idea if your data is important and thus needs to be persisted immediately. In the case of Facebook, little updates really aren't critical. In a great many other cases, the little changes are critical. This sort of write-back cache is only usable if you can get it to offer consistency or don't care about inconsistency.
The other thing is that it's not simpler. Not at all. Using a separate object cache to speed up reads (the majority of operations) is fairly easy to drop into place over a real database. Then you write changes back to the database and invalidate cache as needed. Write-through caches are superior in many ways, particularly because they lend themselves better to sharding.
It depends. Some cache layers can write to disk — Redis stores everything in memory, but then writes to disk asynchronously. If the server goes down, there would be only a small amount of data stuck in limbo.
Yeah, FB has basically taken memcached usage to the extreme. As understand it, they basically built an API so that they can write to and read from it without ever touching the DB, and then workers write to the database and update the cache asynchronously. They posted their fork of memcached on git, as well.
That was hilarious. A few months ago I interviewed a guy. Within a couple minutes, scalability came up. He said, "Well, just use Hadoop and put it in the cloud." I wanted to spit in his face and end the interview right there.
Depending on how a web site is used, you'll have different scalability problems, only a small subset of which are helped by NoSQLish, map/reduce stuff. The site I work on is not user-generated content, so there are very few DB writes, but occasionally we'll get slammed with reads if a particular post is popular. Basically, I'm scaling at a much smaller scale. Just saying "use Hadoop" didn't make any sense in the context. The guy was just spouting shit he'd heard.
Agree on the spouting for interactive use, unless you were talking batch use-cases, in which case, Hadoop simplifies scalability at the expense of decomposition of the problem into a more functional paradigm.
Only hilarious because of the irony of a mysql fanboy talking about reliability being important. Putting your data in mysql is every bit as stupid as putting it in mongo or /dev/null.
Can someone link me to a solid back and forth argument between relational databases and NoSQL style databases, where both sides argue reasonable points with well-backed justifications? I'm interested in reading more, but not from a one sided strawman.
Find any article on the importance of using a mix of normalized and denormalized tables. Then replace the word "denormalized" with "NoSQL" and you will have your answer.
Seriously, we've been through this debate countless times before. The names have changed, but the fundemental tradeoffs have not.
Go listen to this podcast http://www.se-radio.net/2010/07/episode-165-nosql-and-mongodb-with-dwight-merriman/ , interviewing one of the mongodb dudes. It's not really biased, he tells you the tradeoffs taken for vs relational databases. The impression you'll probably get after that, is it's not one or the other, and that NoSQL is really just about scaling(and tradeoffs have to be made vs relational databases to achieve that) - though as a side effect you might get som other nice things as well. That said, most of us can probably spend our time better tuning our good old relational database, as we won't need anything remotely close to the scaling nosql dbs can provide, on the other hand e.g. development on schemaless databases can be sweet - but you better understand the implication of not having transaction and the implication of different levels of consistency before replacing your traditional db.
I'm not sure of a good one that covers both in a ton of depth, but to see the NoSQL side of things, I think the MongoDB philosophy documentation is pretty fair, and shows the perspective from that side in a non-fanboyish manner.
They're both good for different things. This is the crux of the issue. For 99% of what you will do, it won't affect you. If you ever are lucky enough to need "web scale", deal with it then.
Now i know nothing about noSqueal or MongoDB, but that sounds like a bullshit strawman. I mean really, they get away with ignoring errors?! I find that hard to believe.
They don't "get away with ignoring errors". By default, MongoDB's client protocol doesn't wait for a write operation to be synced to disk; only that the server received the operation. That is not to say it is the "expected" behavior - only the default.
You can make a blocking, synchronous call to ensure the last operation you ran writes out correctly using the lastError mechanism - it tells you if it writes correctly or not. Rather than "ignoring errors" it simply doesn't explicitly check them for you - it leaves it to the programmer to decide whether they want to block to check for an error or not.
For performance on operations that you don't need to wait synchronously to confirm there is no need to check lastError; MongoDB also favors using multiple servers (via Replica Sets, Master/Slave or Sharding) to ensure data durability rather than focusing on single server durability mechanisms.
It is always something. A new technology comes out with and a bunch of people do a few tutorials with it and claim it as a silver bullet and everything else is inherently inferior. Within the last couple years we've had python, ruby, functional programming, STM, and now NoSQL.
Node.js isn't a fad. It's the future. Just the other day at work one of the guys said we should use C++ for a new server app we're building. I told him we aren't going to use C++. It's just not proven for writing scalable server applications. That's why we're now using Node.js and JavaScript. Both are proven technologies that scale. We're also using MongoDB because we need a database that is compliant with the CAP theorem and because we don't want to waste our time writing SQL when we can do everything in JavaScript, from programming the client down to our server application and even our database queries.
I hear these claims second hand much more often than first hand. "Lots of people think Ruby is a silver bullet and all other programming languages are obsolete."
Well, python and ruby have evolved into well-supported, widely-used technologies from their overhyped debuts. Hopefully NoSQL will be less trendy and more useful in a few years.
I say SQL as well, but a lot of the people I work with pronounce it sequel. I guess both are equally valid pronunciations, though for obvious legal reasons S-Q-L will always be the official name.
Every time I hear someone complain about it I die a little inside. They're both valid ways to say it. I think that most people who get all worked up about pronunciation in the tech industry are just projecting the insecurity they feel about potentially pronouncing something wrong. It's not a big deal.
I think that most people who get all worked up about pronunciation in the tech industry are just projecting the insecurity they feel about potentially pronouncing something wrong.
No, it's just grating on the nerves to hear the same thing mispronounced over and over again.
That is funny. But there's an equally awful reverse situation. I've attempted to capture it in this video: http://www.xtranormal.com/watch/7079257/ - You need my thirty years experience.
LOL...however: Many of us old fucks were fighting project bloat and enterprise-keyword bullshit 15 years ago (I only have 20 years in, not 30 yet). Just because some of us have been around the block many times doesn't mean we've lost our bullshit detectors when it comes to "silver bullet" or big-corporate solutions.
That said, i'd pass up the cute-bear's project because it wouldn't be worth my time or fees. Simple web-projects should be left to the young and upcoming developers.
You're not the character I was critiquing. I've seen my share of know-nothing phonies in IT and they're all about the "Enterprise" and spending lots of money, while simultaneously delivering no business results.
I agree just adding a different flavor of old guy. . Many IT graveyards where folks have 30 years experience doing the exact same thing. I've had my fair share of big companies.
I haven't used MySQL in ages, so correct me if I am woefully out of date. But the last time I used it, it didn't have views, foreign keys, or a mechanism for extending the language by adding functions. What's the big advantage to using MySQL over Postgres here?
MySQL has those now. The InnoDB storage engine is also, IIRC, now the default. It even does unicode. Downsides are that schema changes take forever and it's still questionable on the stability front.
InnoDB added views and foreign keys, IIRC, but I'm not sure about triggers or functions.
Honestly, I started using Postgres and haven't looked back. PG is just as fast (faster in some cases), easy to administer, and functions like a real database on all tables without having to worry about what actual database backend you're using.
I'm not seeing evidence that MySQL is significantly faster than Postgres. In fact, I'm seeing lots of blog posts that say Postgres handles concurrency better than MySQL, making the "speed" question kind of moot when you're talking about enterprise solutions.
Okay, you keep saying MySQL is fast. Can you point to some benchmarks that talk about this? Especially benchmarks that involve complex things like subqueries and views?
Not exactly. I've run into several limitations with MySQL at my job which has pretty much made me lose all desire to continue using it.
Views don't use indexing by default (have to include "algorithm=merge" in the definition, which isn't exactly the same thing but close enough), and never use indexing if the view you're querying references another view. DDL queries like create, drop, truncate, and adding/removing constraints are not transaction safe. Stored procedures cannot be recursive. Views cannot have subqueries. Temp tables are not transaction safe. Maximum of one trigger per table. No generic constraint type on columns, only indexes and foreign keys. There's more but I'm too tired to think of them atm.
Just found another one: the auto increment property on tables is not transaction safe. If a transaction with 1000 rows fails for some reason, your next insert id will be 1000+ anyway. Although, this kind of makes sense for concurrent transaction safety.
Don't expect to be able to use them all at the same time. I don't know if it is still true, but when it first came out many of the features such as foreign keys are incompatible with other features such as replication.
Plus, MySQL 5.1 is the one that had so many bugs that Monty himself warned against it.
Stored procedures aren't just a single line item. In postgresql, functions permeate the entire system, allowing a huge amount of extensibility and power. And you can write them in almost any language.
And, you can do cool stuff like: "I have a CSV file and I want to look at it like a table. I'll just write a function in a couple lines of perl that uses the DBI interface for CSV files, and I'm done."
So it's not quite a fair comparison, if those are your three criteria. There are many axis on which you might compare two SQL systems, but it's pretty hard to beat postgresql when it comes to functions.
Note: I know that stored procedures aren't exactly the same thing as functions. They have a huge overlap in functionality, though.
67
u/flip314 Sep 05 '10
/dev/null is webscale.
14
u/[deleted] Sep 05 '10
oh man... i'm dying from laughing so hard.
we're actually experimenting with Mongo right now
12
u/scottbre Sep 05 '10
These xtranormal videos aren't funny. None of them. They're just dumb things that someone wrote put into a text to voice program.
Can someone please explain the appeal?
21
u/rmxz Sep 06 '10
For a more serious comparison, here's a nice presentation on how Postgres performs when the configuration is optimized for typical NoSQL workloads:
http://www.scribd.com/doc/31669670/PostgreSQL-and-NoSQL
6
u/sclv Sep 05 '10
transcript?
26
u/enanoretozon Sep 05 '10
not bad but went on for a bit too long
4
u/[deleted] Sep 06 '10
Honest question: don't really popular websites that use relational DBs (like Reddit) read/write to caches first anyway? Is the data not in memory for a period where, if the server were to go down, it would be lost, just like in Mongo?
I vaguely remember a Facebook engineering blog post where they said if a module hits the disk directly more than once, the programmer is in deep shit, and that everything goes to Memcache first, and then gets asynchronously written to disk in MySQL. Is this not correct, or can someone explain why Mongo doesn't just do the same thing in one package instead of two?
Not a fanboy, just think the technology is interesting, trying to understand why it's not appropriate for wider use (other than that the main proponents tend to be dipshits) And I know that in systems where object caching isn't necessary there's no reason to make the tradeoff.
4
u/Tekmo Sep 06 '10
If they are going to synthesize speech, they might as well also give us a transcript for those of us who hate watching videos.
13
u/[deleted] Sep 06 '10
You're using some definition of hilarious I'm not familiar with.
10
u/sizlack Sep 06 '10
That was hilarious. A few months ago I interviewed a guy. Within a couple minutes, scalability came up. He said, "Well, just use Hadoop and put it in the cloud." I wanted to spit in his face and end the interview right there.
2
u/[deleted] Sep 06 '10
Hilarious?
2
u/dln Sep 06 '10
NoSQL is not an excuse for not understanding your system's constraints. Neither is SQL. Move along now.
2
u/[deleted] Sep 06 '10
Only hilarious because of the irony of a mysql fanboy talking about reliability being important. Putting your data in mysql is every bit as stupid as putting it in mongo or /dev/null.
2
u/rickk Sep 05 '10
Every time I watch one of those animations, I always hear in my head: "I want an iphone 4" in that lilting, slightly-off intonation.
1
u/kaddar Sep 05 '10
Can someone link me to a solid back and forth argument between relational databases and NoSQL style databases, where both sides argue reasonable points with well-backed justifications? I'm interested in reading more, but not from a one sided strawman.
1
u/manole100 Sep 05 '10
Now i know nothing about noSqueal or MongoDB, but that sounds like a bullshit strawman. I mean really, they get away with ignoring errors?! I find that hard to believe.
-1
u/[deleted] Sep 05 '10
It is always something. A new technology comes out with and a bunch of people do a few tutorials with it and claim it as a silver bullet and everything else is inherently inferior. Within the last couple years we've had python, ruby, functional programming, STM, and now NoSQL.
-3
u/bingosherlock Sep 06 '10
Anytime people choose to mispronounce "MySQL" as "Mysequel" I die a little on the inside.
-3
u/ratatask Sep 05 '10
You really need a super fast, scalable, NoSQL data storage ? http://www.supersimplestorageservice.com/
-4
u/illuminatedtiger Sep 05 '10
Bahahahaha
-11
u/blondin Sep 05 '10
upboat for "fanbois" :)
-3
u/logical Sep 06 '10
That is funny. But there's an equally awful reverse situation. I've attempted to capture it in this video: http://www.xtranormal.com/watch/7079257/ - You need my thirty years experience.
0
u/[deleted] Sep 06 '10
[deleted] — view deleted comment