为什么PostgreSQL比mongodb快速入门还快

为什么PostgreSQL比MongoDB还快_百度知道mongodb,redis,hbase
三者都是nosql数据库,他们的最大区别和不同定位是什么?
mongodb,redis,hbase
三者都是nosql数据库,他们的最大区别和不同定位是什么?
只在生产环境用过hbase,最大感受是很适合超高量级写入的场景,如果是ssd存储,可以做到极低的延迟。但是在同一个集群上,高写入同时有大量查询,会因为hbase的region经常做split产生抖动,使得查询的耗时不是很稳定。其实hbase的大杀器是可以无缝集成hadoop的map reduce job。比如你每日有好几个tb的新增数据,可以用map reduce实现当日海量数据的高效聚合运算(简单的像:distinct count,sum,avg等等),并且把运算结果写回到hbase供查询使用。
Nosql = Not only SQLmongodb:我觉得定位是取代关系型数据库,想当一个主流数据库。因为他有非结构化、方便扩充字段、写性能优于mysql。万事万物有利有弊,mongodb的内存型缓存内容,让其速度飞快,带来内存率多,掉电数据问题等,加上自身代码还有很多bug带来不如老牌关系型数据库稳定,特别是在主从等分布式环境,其设计也带来诸多问题。redis:是一个小而美的数据库,主要用在key-value 的内存缓存,读写性能极佳,list,set,hash等几种简单结构使得使用也很简单。缓存与简单是其定位,分布式redis架构的出现,让redis更加广泛的使用,稳坐缓存第一把交椅。hbase:定位非结构化大数据,可伸缩性好,并不是完全高可用,底层依靠hadoop提供的HDFS,使用时有一整套zookeeper,pig,hive的生态系统。Cassandra可以算一个竞争对手,但Cassandra去中心化的自适应结构又跟Hbase中心化的生态系统完全不同。
当SQL满足不了你的需求或者SQL 已经不是必须的或者最佳的选择时,就是你考虑这类NoSQL 的时候了。当你的内存大于你的数据时,schema也不是太确定时,mongodb在这里静静地等待My SQL转业户为了尝鲜过来看热闹的,不改变设计模式,爽在前面痛在后面;当你唯一追求的就是速度,又对memcached的过于简单心存芥蒂,刚好内存也比数据多时,redis俏生生站在那里;大,好大,太大了,我说的是数据,我们128GB内存双路CPU25TB存储只够一星期的时候,估计就没有选择综合症了,HBase成了唯一或者唯二选择了。-----------------------------------------所以呢,不严谨地讲,Redis定位在"快",HBase定位于"大",mongodb定位在"灵活"。NoSQL的优点正好就是SQL的软肋,而其弱点正好也就是SQL的杀手锏-----------------------------------------最大区别在于,在一般使用情况下,mongodb可以当作简单场景下的但是性能高数倍的MySQL, Redis基本只会用来做缓存,HBase用来做离线计算
MongoDB是文档型数据库,使用bson结构,可以更加灵活的处理嵌套结构的数据。是这三个里最接近关系型数据库的。Redis是k-v型数据库,目标是做高效的分布式缓存。数据一般不实时落地。也不适合做存储和分析。HBase是列式数据库,BigTable的一种实现,目标是高效存储大量数据,支持列压缩,行事务。适合Schema-less的数据。
我的理解就是,mongodb主要是做社交这一类的应用。redis是个in memory cache,主要作为软件里一个部件来提升整体性能的。hbase不太清楚。数据库主要根据读写量,并发量决定应用场景吧~
已有帐号?
无法登录?
社交帐号登录966,690 七月 独立访问用户
语言 & 开发
架构 & 设计
文化 & 方法
您目前处于:
PostgreSQL的NoSQL特性表现抢眼,多个方面优于MongoDB
PostgreSQL的NoSQL特性表现抢眼,多个方面优于MongoDB
注意: 挥一挥衣袖,带走满满干货,关注,时不时发福利呦!
Author Contacted
相关厂商内容
相关赞助商
QCon上海~22日,上海·宝华万豪酒店,!
告诉我们您的想法
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
网上经常用单机的数据库和支持集群的数据比较。。
ireland Ken
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
允许的HTML标签: a,b,br,blockquote,i,li,pre,u,ul,p
当有人回复此评论时请E-mail通知我
赞助商链接
架构 & 设计
文化 & 方法
<及所有内容,版权所有 &#169;
C4Media Inc.
服务器由 提供, 我们最信赖的ISP伙伴。
北京创新网媒广告有限公司
京ICP备号-7
注意:如果要修改您的邮箱,我们将会发送确认邮件到您原来的邮箱。
使用现有的公司名称
修改公司名称为:
公司性质:
使用现有的公司性质
修改公司性质为:
使用现有的公司规模
修改公司规模为:
使用现在的国家
使用现在的省份
Subscribe to our newsletter?
Subscribe to our industry email notices?博客访问: 403354
博文数量: 457
注册时间:
认证徽章:
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Linux
I recently concluded a migration away from MongoDB to PostgreSQL for one of my apps - digiDoc. I’d like to tell you why I did so.
To be honest, the decision to use MongoDb was an ill-thought out one. Lesson learned - thoroughly research any new technology you introduce into your stack, know well the strengths and weaknesses thereof and evaluate honestly whether it fits your needs or not - no matter how much hype there is surrounding said technology. What follows is also not a litany of the usual compaints against MongoDB such as data corruption, global write lock, shard configuration and so on. For our use case, mongodb failed at a much more basic level.
digiDoc is all about converting paper documents like receipts and business cards into searchable database, and so a document database seemed like a logical fit(!). Alas, not being aware of the mathematics behind relational algebra, I could not see clearly the trap I was falling into - document databases are remarkably hard to run aggregations on and aggregating the data and presenting meaningrful statistics on your receipts is one of the core features of digiDoc. Without the powerful aggregation features that we take for granted in RDBMSs, I would constantly be fighting with unweildy map-reduce constructs when all I want is SUM(amount) FROM receipts WHERE
GROUP BY . I even contributed some patches to mongoid-map-reduce but the whole experience of aggregating data with mongodb was so ugh that I couldn’t bring myself to work on the app beyond a point. That is of course, a bad place to be in.
Secondly, with a document database, you lose the independence of your data access paths. People keep complaining that JOINs make your data hard to scale. Well, the converse is also true - Not havingJOINs makes your data an intractable lump of mud. Consider a simple thing like an audit trail. In a document database, normally, this would be a set of embedded documents in the item being audited. Now, lets say you want to see a list of all the actions performed by a particular user. Boing! Trapped. You have to load every document in the database and extract the udit trail from it, then filter it in your app for the user you’re looking for. Just the thought of what that would do to my hardware was enough to turn me off the whole idea. JOINs are cool! And guess which problem you are more likely to have - needing joins, or scaling beyond facebook?Thirdly, mongodb is quite feature poor. Perhaps this has changed in the last few months, but when I last looked something as simple as case-insensitive search did not exist. The recommended solutionwas to have a field in the model with all your search data in it in lower case. Now my model, which I have carefully constructed so as to adhere to the Single Responsibility Principal needs to have callback hooks to save this search string everytime it is updated. And if I add a new field to the model? Time to regenerate all the search strings. I can only come to the conclusion that mongodb is a well-funded and elaborate troll.Fourthly, and this one completely blew my mind - somewhere along the stack of mongodb, mongoid and mongoid-map-reduce, somewhere there, type information was being lost. I thought we were scaling hard when one of our customers suddenly had 1111 documents overnight. Imagine my disappointment when I realised it was actually four 1s, added together. They’d become strings along the way. Now in this case, perhaos the fault was mine but somehow, I can’t see this happening with Postgres. And when you add up all the hours it takes to deal with these niggling problems and the surprising lack of features, it all leads to some pretty obvious conclusions.
阅读(697) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。为什么PostgreSQL比MongoDB还快_百度知道}

我要回帖

更多关于 mongodb为什么快 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信