News for hackers. Stuff that matters.
Re:Twilio incident and Redis by PommeDeTerre on Wednesday July 24, 2013 @07:02PM (#6099729)
Is there actually a legitimate performance or scalability need to incorporate a NoSQL database in this case?

Ever since NoSQL databases started receiving a lot of hype a few years back, I've witnessed a number of teams use them without any real justification. They'll build unnecessarily complex systems using one or more NoSQL database systems, all while a relational database would be more than sufficient for their needs.

In several of these cases, some of the developers have been quite adamant that these NoSQL databases are essential. Then we rip them out, usually because they've been causing problems like described in this case. It quickly becomes obvious that they were never needed in the first place, and won't be needed even in the face of significantly increased load.

Re:Twilio incident and Redis by KirinDave on Wednesday July 24, 2013 @08:41PM (#6100175)
> Is there actually a legitimate performance or scalability need to incorporate a NoSQL database in this case?

Usually the most compelling reason not to use a traditional SQL database is that they're expensive to field in distributed environments and require specialist engineers to support when you get out into the weeds.

But I submit it's a category error to call Redis a "NoSQL database." It was also a category error to put data that needs to be redundant and durable into a storage system that is really specialized for high volume but low-reliability cache work.

I mean, seriously. Minimum viable PostgresSQL deploy in EC2 is pretty damn expensive, but you may not have enough cash on hand to buy your own hardware and pay to put it in a "real datacenter." If you can find something cheaper and you're not even seed funded yet because no one funds your social product until you have 100k users, you're probably more likely to actually make it to where you can afford a different database by just using Redis. It's called "technical debt" and we accrue it both bitterly and often willingly.

Re:Twilio incident and Redis by AYBABTME on Wednesday July 24, 2013 @07:24PM (#6099862)
Some problems are better solved with key-value stores than with relational databases. It depends on the data model you need to map.

Lot of people use relational databases as a big key value store, when really they should use a key value store. It's not necessarily about scalability or performance. =)

Re:Twilio incident and Redis by aidos on Wednesday July 24, 2013 @07:35PM (#6099918)
Yes. And Redis provides an interesting model with very specific performance characteristics depending on how you choose to store your data in each case. If you haven't worked with Redis it might be hard to appreciate how it's a bit more than just a key-value store and how it's a different tool from a relational db.
Re:Twilio incident and Redis by encoderer on Wednesday July 24, 2013 @09:58PM (#6100487)
I think you're making a number of mistakes in judgement here. Most importantly, you're conflating NoSQL with "not as reliable." As if there's no difference between Cassandra, HBase, Redis, etc. They're just "nosql" and "not needed" to you. That just seems highly ignorant of the relative merits of each database.

And similarly, the attitude that a RDBMS is the right and proper data store, that all data should rightly prefer to live in an RDBMS aside from the loftiest heights of scalability.

Finally, the assertion that using a key-value or column-based datastore is going to lead to an "unnecessarily complex" design.

I'd not be surprised to find you disagree, but if we were working together on the same team, these are some things I'd try to work with you on.

Re:Twilio incident and Redis by fusiongyro on Thursday July 25, 2013 @01:25AM (#6101067)
I can't speak for the person you're replying to, but I would like to point out that RDBMSes are built on theory designed explicitly to handle general data problems. Situations for which the relational model is not a good fit are almost by definition special cases.

Similarly, while it is wise not to lump all of the non-SQL/non-relational databases together, to say that the bulk of them share a common obsession with scalability is not much of a reach. After all, we're not talking about Neo4J, FramerD, MetaKit, etc. We're talking about young systems that were born out of frustration with scalability issues. It's true that they all have different tradeoffs, strengths and weaknesses, but one significant advantage of Postgres is that it does so well in such a variety of situations. Maybe it isn't perfect for every scenario, but it's pretty good for most scenarios. This is partly an inherent advantage of age, and partly the benefit of a sound theoretical foundation. A big thing I dislike about the current crop of NoSQL databases is that you are expected to learn a great deal about their inner workings to make an informed decision about whether or not to use them. MongoDB really epitomizes this. But this is a pretty lazy complaint compared to random data loss and insane defaults (early days of Mongo), and I have to give you that.

Your position sounds quite reasonable compared to the one I've been primed by, but it's going to be a few more years before these databases mature to the point I'd consider one a reasonable first choice for a generic database. I don't draw the line quite as far as the GP—sometimes you have a special case and you need special tools—but I can certainly empathize with questioning the wisdom of making a distributed non-relational database the primary store for a low-load, classic RDBMS problem. But Twilio has come forward and agreed with that position and denying that they do that, so the spark for this flamewar is conjecture. While people have come forward to defend such a configuration, few seem to be endorsing it by using it themselves. This says something about the reasonableness of the idea.

Re:Twilio incident and Redis by hhuuggoo on Thursday July 25, 2013 @10:03AM (#6102457)
I use nosql stores for the same reason that I use a dynamically typed language (python) I like the flexibility and agility. I don't use nosql stores for performance
Re:Twilio incident and Redis by threeseed on Wednesday July 24, 2013 @07:42PM (#6099950)
No offence but attitudes like this are the worst. If we all took your advice we would all be still using punch cards or writing everything in assembler. Sometimes you don't need a clear justification to use newer technologies. Perhaps developers just want to experience the significant developer productivity that comes with using many of the NoSQL databases.

Also might be worth dropping the whole "SQL is better" insinuation. We have seen some pretty major data loss bugs in PostgreSQL and MySQL recently.

Re:Twilio incident and Redis by fusiongyro on Thursday July 25, 2013 @12:55AM (#6100990)
What major data loss bugs have you heard about "recently" in Postgres and MySQL? There was a significant security problem in Postgres that was recently fixed, but I haven't heard of any recent data loss bug. Even MySQL has been doing well on this point lately.
Re:Twilio incident and Redis by EugeneOZ on Thursday July 25, 2013 @01:50PM (#6103781)
In this case data was corrupted ONLY by humans mistake, it's not Redis fault (even author of article wrote it).
Re:Twilio incident and Redis by fusiongyro on Thursday July 25, 2013 @02:51PM (#6104223)
I'm not accusing Redis of losing data, I'm correcting a factual error about the reliability of MySQL and Postgres.
Re:Twilio incident and Redis by PommeDeTerre on Wednesday July 24, 2013 @08:42PM (#6100182)
Billing systems are not to be taken lightly, namely because money is inherently involved.

When developing such systems, it is irresponsible to use new, unproven technologies without justification.

When developing such systems, it is irresponsible to trade off the reliability and safety of the system for some "developer productivity".

Such irresponsibility is just not acceptable. Failures due to such irresponsibility should not be tolerated, either.

Re:Twilio incident and Redis by jessaustin on Wednesday July 24, 2013 @10:21PM (#6100555)
Failures due to such irresponsibility should not be tolerated, either.

I appreciate that you are very committed to reliability. I also have worked on (telecom) billing systems. However, what are you suggesting here? Should all Twilio's customers find another provider? (Do you have a suggestion?) Should they just not use a service like Twilio's? Should Twilio quadruple their prices so they can throw up enough hardware to do all this in postgres? Should we all fly over to Sicily to protest outside antirez's house?

Incidentally, in the late '90s I sat in on a few sales efforts in which Lucent pushed their "Datablitz" in-memory database for mediation and billing of call records. So, it's not as though nothing similar to this has ever been done.

Re:Twilio incident and Redis by taf2 on Wednesday July 24, 2013 @09:40PM (#6100418)
money can be refunded... we're not talking about a life - or a human life we're just talking about software. Reading how Twilio was using redis it sounds very reasonable (fsync). I've seen MySQL servers melt under extreme load running on very high end servers so if you're saying that somehow having had SQL in this case would have saved them... well... maybe you're right... but I wasn't there were you?

I believe the engineers at Twilio are building and have built a platform to handle a scale that is going to continue to reach further than many traditional models will scale. It makes sense to me that they would need to look for in memory systems to push the limits - They are fsync'ing immediately - so while it's in memory for a read it's disk for writes so that sounds pretty safe to me... Also, a lot of people use Redis now, so I definitely wouldn't say it's unproven, that is as others have said like saying we should still be using typewriters to put ink on paper because it's "proven"... I'd answer that with... "good luck with that".

And at the end of the day - "the shit will hit the fan" and it did...

the team did great and we're all thankful.

Re:Twilio incident and Redis by PommeDeTerre on Wednesday July 24, 2013 @10:33PM (#6100592)
Just because human lives aren't necessarily at stake it doesn't mean that poor (in my opinion) software system designs should be tolerated.

And when we talk about "relational databases", we basically never mean MySQL. I'm not even sure why you'd bother to bring it up, given its poor reputation, its lack of proper functionality in some cases, and the many other (and far better) alternatives.

As for scalability, some other commenter here posted a link to a twitter comment describing the scale in this case: https://twitter.com/dN0t/status/360119871318659074

It clearly states "tens of thousands" of transactions per second. That is well within the capabilities of the lower-end database systems on modern, low-end server hardware. Twilio will require a huge amount of growth just to reach the point where higher end database systems and hardware become appropriate, never mind "a scale that is going to continue to reach further than many traditional models will scale".

Running into significant billing issues due to a likely unnecessary use (in my opinion) of a NoSQL database while still at a relatively small scale is not something that a team should be commended for, and nobody should be "thankful" that the incident did happen.

Re:Twilio incident and Redis by defen on Thursday July 25, 2013 @01:53AM (#6101125)
The equivalent failure with PostgreSQL would be to update kernel.shmmax with a call to sysctl, and then forget to update /etc/sysctl.conf. Then if the machine reboots PostgreSQL will fail to start because it can't allocate enough memory. It mostly wasn't a redis problem as far as I can tell. That said, Twilio is probably at a big enough scale where they can afford to hire a couple full-time admins to deal with PostgreSQL.
Re:Twilio incident and Redis by pbreit on Wednesday July 24, 2013 @09:13PM (#6100315)
Understood. But maybe billing isn't the best place to experiment?
Re:Twilio incident and Redis by badclient on Wednesday July 24, 2013 @08:39PM (#6100165)
How are NoSql databases more productive than SQL?