Paul Buchheit: The secret to making things easy: avoid hard problems
paulbuchheit.blogspot.com
paulbuchheit.blogspot.com
Paul - here's an interesting take on your recommended solution: Use solid state ram and forget about step two. You get fast a read/write, without the risk of data loss if the machine restarts.
Here's a pretty cool board that will take DDR SDRAM, and supply it with a constant source of power (imitating solid-state memory): http://techreport.com/reviews/2006q1/gigabyte-iram/index.x?pg=1
Those who insist on a database, could even store the database on this board. Best of both worlds.
Here's an insane graph showing the database transaction rate for the board vs. a conventional hard drive: http://techreport.com/reviews/2006q1/gigabyte-iram/index.x?pg=7
So please spec out a couple servers for us. How would you get a bunch of memory (32GB, 64GB even) into one of them and still have it be a good web/app server?
Expensive, yeah. 5 grand of that is RAM. You could get away with 4GB of RAM and still have a fucking fast web/app server as long as your active dataset fits on the flash.
Brings the memory cost down to around $3440.
Regardless, the DDR-ram solid state solutions have faster transfer rates than a 4 drive raid0. The only drawback is that they cost about $100 per GB.
Oh, and the onboard battery will only let you unplug your machine for 8hrs. After that, the state is lost.
I am not sure what out-of-the-box solution can you use to read/write packs of flash memory in parallel, but I'm pretty sure there exists something (you could do it on the application level as well).
Edit: USB RAID-0 array benchmarks here:
On the other hand I don't have hard numbers, just some bonnie tests on random flash sticks I had lying around. Check out the newer USB sticks that are "Readyboost Ready", such as Corsair. They might be quick enough.
Edit: wow, totally did not see Sam_odio's original post, linking to exactly the same product. Oops. And yCombinator doesn't allow us to delete comments...
This is a nonexistent problem: "The problem? Most databases are still storing my name using the same techniques that they did 15 or more years ago -- they seek the disk head to some specific location and then read or write my name to that location. These databases rely on the one operation that DID NOT dramatically improve in the past 15 years! They still perform like it's 1991."
I don't think PostgreSQL is the only database that uses write-ahead logging.
And yet somehow that gets translated into "get rid of that database."
On the up side, you are going to learn a lot about essay writing, and about how concepts do/don't get through to people. These are very valuable skills.
It's true that PostgreSQL uses a write-ahead log, but it's still going to do that seek when it checkpoints, correct? I don't think that it will be able to sustain high transaction rates (100,000 tps for small transactions should be very doable). If you find that this isn't true and that someone has demonstrated these rates, let me know -- it would certainly be good news.
As for being wrong, that's one of the privileges you lose with celebrity. Everything you write in your blog is going to be preceded by "The guy who wrote gmail says..." When you say something that looks like it might become a popular misconception, guys like me will jump up and down, scream, and tear at our hair. Or maybe we'll just post terse, cold, unfriendly corrections. We still like you, though.
My main issue with your post is the way it comes across as saying databases are overengineering for 99% of web sites, but mainly deals with a performance issue that won't matter for 99% of web sites. I would have no problem if you framed it as high tps vs low tps for certain classes of application, not as simplicity vs overengineering. Using a relational database is a fine default choice for web apps today, just as you expect to have an OS on your server by default.
5000 per second with --innodb_flush_log_at_trx_commit=0, which only writes the log to disk once per second.
The MySQL documentation claims that this configuration does crash-recovery correctly, though you may lose the last second's worth of transactions.
Robert, did you test MySQL with a parallel load? To give it the best chance at maximizing tps, it will need to be able to combine multiple pending transactions in a single write. Also, can you tell if it's updating it's b-trees? (if not, it may not be able to sustain these rates)
"The thing is, a lot of those difficult problems are irrelevant for 99% of products. For example, "real" databases can handle transactions that are too large to fit in memory. That was probably a really important feature in 1980. Today, you can buy a computer with 32GB of memory for around $5000. How many GB transactions do you suppose Twitter performs? My guess is zero -- I suspect that their average transaction size is closer to 0.0000002 GB (messages are limited to 140 characters)."