Live data from Hacker News

Redis: the AK-47 of databases

flazz.me

1–10 of 82 posts

Re: Redis: the AK-47 of databases

#2
Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time.

Also this part of the config:

  save 900 1
  save 300 10
  save 60 10000
is not at all obvious. Maybe it's better documented in the sample config.

Re: Redis: the AK-47 of databases

#3

Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time. Also this part of the config: save 900 1 save 300 10 save 60 1…

According to the first comment, the part about locking the whole data set for MULTI is not accurate. Only the connection calling that is stalled, which makes perfect sense.

Re: Redis: the AK-47 of databases

#4

Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time. Also this part of the config: save 900 1 save 300 10 save 60 1…

MyISAM doesn't support transactions.

Re: Redis: the AK-47 of databases

#5

Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time. Also this part of the config: save 900 1 save 300 10 save 60 1…

It's called optimistic for a reason. You assume there is low contention and configure your client to have random back off.

Re: Redis: the AK-47 of databases

#6

Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time. Also this part of the config: save 900 1 save 300 10 save 60 1…

Maybe not, but I found the docs in about 10 seconds.

http://redis.io/topics/persistence

Re: Redis: the AK-47 of databases

#7

Eek. Locking the entire data set to perform transactions? Isn't that so... MyISAM? Does rolling the transaction back work? The optimistic lock is not a great solution either: instead of deadlocking while waiting for a lock to be released, you are now stuck in a while (!saved) loop. Imagine two web pages trying to update the same resource at the same time. Also this part of the config: save 900 1 save 300 10 save 60 1…

[deleted]

Re: Redis: the AK-47 of databases

#8
Being the AK-47 of databases is not a bad way to be known.

That said I hope the author will revisit the topic when he has more knowledge of the subject matter, such as when using it in production for a while on a fair sized project with a lot of users. That's where the rubber meets the road, first impressions tend to gloss over the areas where the meat is.

Re: Redis: the AK-47 of databases

#9
The information about transactions in this article is wrong. Read the redis docs he actually points to for an accurate description.

This article should not get upvoted.

Re: Redis: the AK-47 of databases

#10
The title randomly reminded me of the AK-47 quote from Lord of War (an actually decent Cage film, and definitely a good bit of monologue):

Of all the weapons in the vast soviet arsenal, nothing was more profitable than Avtomat Kalashnikova model of 1947. More commonly known as the AK-47, or Kalashnikov. It's the world's most popular assault rifle. A weapon all fighters love. An elegantly simple 9 pound amalgamation of forged steel and plywood. It doesn't break, jam, or overheat. It'll shoot whether it's covered in mud or filled with sand. It's so easy, even a child can use it; and they do. The Soviets put the gun on a coin. Mozambique put it on their flag. Since the end of the Cold War, the Kalashnikov has become the Russian people's greatest export. After that comes vodka, caviar, and suicidal novelists. One thing is for sure, no one was lining up to buy their cars.

Only tangentially related :) but I thought worth sharing. Anyone care to write a redis version?

Post reply on HN