I've been considering using Redis in a project that uses a lot of writes.
So, after setting it up on my server, I created a simple PHP script using Predis with a simple loop to add records. I also created a second script that does a similar thing, only on a MySQL table (InnoDB) using PHP's MySQLi.
I ran a 10k loop, a 100k loop and a 500k loop and MySQL beat Redis every single time. In fact, the more records I added, the faster MySQL was compared to Redis.
There's so much buzz (hype?) around Redis, that I want to believe I'm missing something here.
Please educate me :)
Thanks!
Here's my Predis code:
for ($i=0; $i<100000; $i++) {
$predis->set('key'.$i, $i);
}
Here's my MySQLi code:
for ($i=0; $i<100000; $i++) {
mysqli_query($db, "INSERT INTO test (`key`, `value`) VALUES ('key$i', $i)");
}