Why Did So Many Startups Choose NoSQL?

link 非常好的一篇文章,分析了为什么MongoDB会这么快在startup中广泛使用,而实际上MongoDB本身问题非常非常多,而且事后证明许多startup最终也放弃mongodb迁移会RDBMS.

虽然我现在的startup也使用MongoDB,但是的确遇到了许多问题,包括比较严重的数据不一致。MongoDB在3.0之前的mmap引擎,在我看来简直是不能用的东西,根本没有办法维护。


10gen也就是MongoDB creator, 在宣传上强调mongodb符合 现代软件开发 , 并且不断地宣传很多startup从RDBMS不断地迁移到mongodb上。之后越来越多的公司宣传mongodb,关于mongodb的职位需求也越来越旺盛。

migrating-to-mongodb-slide-cropped.png

10gen的员工甚至还编造出了一个词MEAN(Mongodb, Express, Angular, Nginx),来代替LAMP(Linux Apache MySQL, Php)这种相对比较古老的webserver架构。可想而知这个冲击对刚入行的程序员有多大,整个世界都在谈论mongodb, 而且给人的感觉就是,不会mongodb那么就out.

mean-presentation.png

于此同时,10gen还在不断地宣传mongodb的高效率,比如和couchdb相比,mongodb写入速度远超过它,并且这份报告还会出现在Google搜索结果的第一个。然后这份报告许多数据是有问题的,比如这个benchmark并没有等待mongodb写入确认,当然写入延迟就很低了(只写入内存没有落地磁盘,想想这个延迟差别有多大)

youtube 上还出现了一个视频强调mongodb webscale, 也就是可扩展性。虽然这个视频有点滑稽,但是却获得上万的浏览次数。可想当时mongodb对于这个业界的影响有多大。


2012年我还在YC的时候,mongodb在startup里面非常流行,但是我却发现mongodb对于很多增长的startup带来了很多问题。

MongoDB经常被用于代替关系数据库,甚至在需要事务的金融领域也开始使用。尽管NoSQL只是关系数据库的补充,但是10gen坚持地认为MongoDB可以代替关系数据库。尽管MongoDB上手很快,但是想要运行稳定却非常困难。 (for a number of other technical critiques see some gotchas and a summary of critiques; see also Kyle Kingsbury's work with with Jepsen and MongoDB)

甚至一家独角兽公司开始使用MongoDB,但是最后面因为在MongoDB上面遇到许多问题,不得不迁移到关系数据库上,并且在和其他VC-backed starups私下交谈到只会去用那些"boring"的技术. 而一家前景不错的VC私底下抱怨说在MongoDB上遇到了太多问题所以雇佣了一个专门的团队把从数据库从MongoDB上面迁移出去。

A well known “unicorn” chose MongoDB. It then found itself chastened after a disastrous MongoDB migration, vowing only to use "boring" tech from then on in private sessions with other VC-backed startups. One prominent VC would privately grouse that he needed to hire a full time team to migrate his portfolio companies off of MongoDB, given the issues they were facing.


NoSQL的崛起很大程度上源于Google, Amazon这类web scale的公司,一旦这类公司开始推广NoSQL之后,整个行业都认为NoSQL是未来趋势,更加符合Web开发。尽管很多开发者明白这里面有点问题,但是往NoSQL上靠更容易进入会议和得到更多的点击。另外NoSQL也非常关注新入行的开发者,可以说对新入行的开发者相比SQL会更加友好。

All this hype came just as many new developers were entering the field, lured by the exceptional growth of the smartphone era. Computer science enrollment was growing dramatically, new coding bootcamps were being founded, and online tech learning was taking off. Node was expanding, allowing front-end engineers to quickly build full stack products — and increasing the number of database decision makers.

Conference/meetup organizers, blog writers, training organizations, and technology consultants realized this latent demand and created the content to cater to it — making it even more pervasive. Smart developer tool marketers also knew this, with 10gen's VP of Corporate Strategy heralding the "post-transactional database future".

这种疯狂的宣传使得更多公司和股东收益,同时也吸引了媒体,资本,用户,和开源贡献者。而对于开发者来说,这是一件非常焦虑的事情,是否要跟进这项技术呢?

Hype benefits companies and their stakeholders because it makes it easier to sell a product. It gets you free earned media, capital, users, and open source contributors.

On the other side, engineers constantly seek to learn in an industry where staying up to date is important. When there's something to sell, it’s therefore effective to play into an engineer’s fear of being left behind — or their desire to get a job. This would incentivize some to argue that "you need to stay relevant" — and "get ahead" by learning NoSQL technologies. At its worst, this leads to blindly chasing new technology — rather than solving problems.

每隔几年,web/mobile开发者都会需要对一些新出现的技术进行选择,你可以认为这项技术是misplaced hype(也就是胡里花哨的),那么就没有必要理睬它。当然也可以认为这项技术是structural shift(结构性变化),这项技术可能会在后面几年或者是十几年经受住考研并且广泛使用。不过开发者通常都会有一个潜在假设,就是如果误判misplaced hype,那么损失是比较大的,因为某个技术的确能够提升开发效率,帮助startup成功。

问题就在于,我们如何正确处理这类hype?


很不幸没有简单的经验办法来鉴别这类hype, 但是可以使用PAT来帮助