- 浏览: 98414 次
- 性别:
- 来自: 深圳
文章分类
最新评论
35+ Use Cases for Choosing Your Next NoSQL Database
Monday, June 20, 2011 at 8:50AM
We've asked What The Heck Are You Actually Using NoSQL For? . We've asked 101 Questions To Ask When Considering A NoSQL Database . We've even had a webinar What Should I Do? Choosing SQL, NoSQL or Both for Scalable Web Applications .
Now we get to the point of considering use cases and which systems might be appropriate for those use cases.
What are your options?
First, let's cover what are the various data models. These have been adapted from Emil Eifrem and NoSQL databases .
Document Databases
- Lineage: Inspired by Lotus Notes.
- Data model: Collections of documents, which contain key-value collections.
- Example: CouchDB, MongoDB
- Good at: Natural data modeling. Programmer friendly. Rapid development. Web friendly, CRUD.
Graph Databases
- Lineage: Euler and graph theory.
- Data model: Nodes & relationships, both which can hold key-value pairs
- Example: AllegroGraph, InfoGrid, Neo4j
- Good at: Rock complicated graph problems. Fast.
Relational Databases
- Lineage: E. F. Codd in A Relational Model of Data for Large Shared Data Banks
- Data Model: a set of relations
- Example: VoltDB, Clustrix, MySQL
- Good at: High performing, scalable OLTP. SQL access. Materialized views. Transactions matter. Programmer friendly transactions.
Object Oriented Databases
- Lineage: Graph Database Research
- Data Model: Objects
- Example: Objectivity, Gemstone
Key-Value Stores
- Lineage: Amazon's Dynamo paper and Distributed HashTables .
- Data model: A global collection of KV pairs.
- Example: Membase, Riak
- Good at: Handles size well. Processing a constant stream of small reads and writes. Fast. Programmer friendly.
BigTable Clones
- Lineage: Google's BigTable paper .
- Data model: Column family, i.e. a tabular model where each row at least in theory can have an individual configuration of columns.
- Example: HBase, Hypertable, Cassandra
- Goog at: Handles size well. Stream massive write loads. High availability. Multiple-data centers. MapReduce.
Data Structure Servers
- Lineage: ?
- Example: Redis
- Data model: Operations over dictionaries, lists, sets and string values.
- Good at: Quirky stuff you never thought of using a database for before.
Grid Databases
- Lineage: Data Grid and Tuple Space research.
- Data Model: Space Based Architecture
- Example: GigaSpaces, Coherence
- Good at: High performance and scalable transaction processing.
What should your application use?
- Key point is to rethink how your application could work differently in terms of the different data models and the different products. Right data model for the right problem. Right product for the right problem.
- To see what models might help your application take a look at What The Heck Are You Actually Using NoSQL For? In this article I tried to pull together a lot of unconventional use cases of the different qualities and features developers have used in building systems.
- Match what you need to do with these use cases. From there you can backtrack to the products you may want to include in your architecture. NoSQL, SQL, it doesn't matter.
- Look at Data Model + Product Features + Your Situation. Products have such different feature sets it's almost impossible to recommend by pure data model alone.
- Which option is best is determined by your priorities.
If your application needs...
-
complex transactions
because you can't afford to
lose data or if you would like a simple transaction programming model
then look at a Relational or Grid database.(复杂事务,请用关系数据库或网格数据库,因为你不能承受丢失数据的风险或者你需要简单的事务程序模型)
- Example: an inventory system that might want full ACID. I was very unhappy when I bought a product and they said later they were out of stock. I did not want a compensated transaction. I wanted my item!
- to scale then NoSQL or SQL can work. Look for systems that support scale-out, partitioning, live addition and removal of machines, load balancing, automatic sharding and rebalancing, and fault tolerance.(伸缩性,NoSQL或SQL皆可,寻找支持水平伸缩,分区,在线增加或减少机器,负载均衡,自动分片和错误容忍等特性的系统)
-
to always
be able to write
to a database because you need high availability then look at Bigtable Clones which feature eventual consistency. (追求高可用性,可用Bigtable等支持最终一致性的数据库)
- to handle lots of small continuous reads and writes , that may be volatile, then look at Document or Key-value or databases offering fast in-memory access. Also consider SSD. (需要处理海量的、持续的、可能急剧变动的小数据读写,可选用键值型数据库,同样可以考虑采用SSD)
- to implement social network operations then you first may want a Graph database or second, a database like Riak that supports relationships. An in- memory relational database with simple SQL joins might suffice for small data sets. Redis' set and list operations could work too.(用于社交网络,首先可考虑图形数据库,其次支持关系的数据库如Riak。Redis可存储set和list的特性,使它同样适用大量小数据集的场合)
If your application needs...
- to operate over a wide variety of access patterns and data types then look at a Document database, they generally are flexible and perform well. (如存在大量的访问模式和数据类型,可关注文档型数据库,他们足够灵活,运行良好)
- powerful offline reporting with large datasets then look at Hadoop first and second, products that support MapReduce. Supporting MapReduce isn't the same as being good at it. (如需要强大的基于海量数据的离线报表,可首先考虑采用Hadhoop, 此外,也可考虑支持MapReduce的产品。当然,支持MapReduce不代表能跟MapReduce很好地配合 )
- to span multiple data-centers then look at Bigtable Clones and other products that offer a distributed option that can handle the long latencies and are partition tolerant. (如需跨越多个数据中心,可选用基于Bigtable模型的产品,或其它提供分布式,可以处理长延迟,提供分区容忍性的产品)
- to build CRUD apps then look at a Document database, they make it easy to access complex data without joins. (增删查改型的应用,可考虑文档型数据库,可以很方便的访问复杂数据结构而无需表关联)
- built-in search then look at Riak. (内置全文搜索,可用Riak)
- to operate on data structures like lists, sets, queues, publish- subscribe then look at Redis. Useful for distributed locking, capped logs, and a lot more. (需要存储lists, sets, queues, publish-subscribe等数据结构,考虑Redis)
- programmer friendliness in the form of programmer friendly data types like JSON, HTTP, REST, Javascript then first look at Document databases and then Key-value Databases. (编程友好的,考虑文档型数据库及键值型数据库)
If your application needs...
-
transactions
combined with materialized views
for real-time
data feeds then look at VoltDB. Great for data-rollups and time windowing. (需要实时的事务处理,物化视图,可考虑VoltDB。比较好的NOSQL替代方案)
-
enterprise level support
and SLAs
then look for a product that makes a point of catering to that market. Membase is an example. (需要企业级支持及SLA,考虑Membase等提供商业支持的产品)
- to log continuous streams
of data that may have no
consistency guarantees necessary at all then look at Bigtable Clones
because they generally work on distributed file systems that can handle a
lot of writes. (如需记录连接的、根本不需要一致性保证流数据,可选用BigTable类产品,因为他们能在分布式文件系统下,处理大量的写操作)
- to be as simple as possible
to operate then look for a hosted or PaaS solution because they will do all the work for you. (需要尽可能的简单,可采用PAAS的解决方案)
- to be sold to enterprise customers then consider a Relational Database because they are used to relational technology. (卖给企业客户的产品,考虑关系数据库,因为企业于习惯使用该技术)
- to dynamically build r elationships between objects that have dynamic properties then consider a Graph Database because often they will not require a schema and models can be built incrementally through programming. (动态地在具有动态属性的对象之间构建多维关系,考虑图形数据库,因为他们不需要模式,且模型可在程序中逐步增加)
- to support large media then look storage services like S3. NoSQL systems tend not to handle large BLOBS, though MongoDB has a file service. (需要支持大媒体对象,可考虑AMAZON S3之类的存储服务,NOSQL没有设计用于处理大BLOGS, 虽然MonoDB提供了文件服务 )
If your application needs...
- to bulk upload
lots of data quickly and efficiently
then look for a product supports that scenario. Most will not because
they don't support bulk operations. (需要批量上传大量数据,可以去寻找支持此场景的产品,大多产品不支持此功能)
- an easier upgrade path
then use a fluid schema
system like a Document Database or a Key-value Database because it
supports optional fields, adding fields, and field deletions without the
need to build an entire schema migration framework. (更容易的升级路径,可用支持动态schema的文档数据库或键值数据库)
- to implement integrity constraints
then pick a database that support SQL DDL, implement them in stored procedures, or implement them in application code. (要实现数据完整性的约束,选用支持SQL DDL的产品,可在存储过程或应用程序代码中实现)
- a very deep join depth the use a Graph Database because they support blisteringly fast navigation between entities. (要实现深层次的连接,可选用图形数据库)
- to move behavior close to the data so the data doesn't have to be moved over the network then look at stored procedures of one kind or another. These can be found in Relational, Grid, Document, and even Key-value databases.
If your application needs...
- to cache or store BLOB data
then look at a
Key-value store. Caching can for bits of web pages, or to save complex
objects that were expensive to join in a relational database, to reduce
latency, and so on. (需缓存或保存BLOG数据,可选键值型存储产品)
- a proven track record
like not corrupting data and
just generally working then pick an established product and when you hit
scaling (or other issues) use on of the common workarounds (scale-up,
tuning, memcached, sharding, denormalization, etc). (选择已验证的可靠产品,在需要扩展时选择通用的解决方案,如向上扩展,调优,memcached, 分片, 反范式等等)
-
fluid data types
because your data isn't tabular in
nature, or requires a flexible number of columns, or has a complex
structure, or varies by user (or whatever), then look at Document,
Key-value, and Bigtable Clone databases. Each has a lot of flexibility
in their data types. (多变的数据类型,不固定的列,或复杂的数据结构图, 选择文档型,键值型或列式数据库)
- other business units to run quick relational queries
so you don't have to reimplement everything then use a database that supports SQL. (需要快速的关系查询,但不想在应用中实现一切,可选用支持SQL的数据库)
- to operate in the cloud and automatically take full advantage of cloud features then we may not be there yet. (运行于云端,自动利用云的一切特性与优点,暂时没这方面的产品)
If your application needs...
- support for secondary indexes
so you can look up data by different keys then look at relational databases and Cassandra's new secondary index support. (需要支持二级索引,可考虑关系数据库或Cassandra等产品)
- creates an ever-growing set of data (really BigData) that rarely gets accessed then look at Bigtable Clone which will spread the data over a distributed file system. (需要不停地写入数据,但数据很少被访问,可选列式数据库)
- to integrate with other services then check if the database provides some sort of write- behind syncing feature so you can capture database changes and feed them into other systems to ensure consistency. (需要和其它服务集成,可寻找提供后台同步功能特性的产品,让你捕捉数据变化以同步至其它数据库)
- fault tolerance check how durable writes are in the face power failures, partitions, and other failure scenarios. (需要考虑错误容忍性。检查停电、分区、或其它错误场景下的写操作的可靠性)
- to push the technological envelope in a direction nobody seems to be going then build it yourself because that's what it takes to be great sometimes.
- to work on a mobile platform then look at CouchDB/Mobile couchbase . (移动平台,可用CouchDB/Mobule couchbase)
Which is Better?
- Moving for a 25% improvement is probably not a reason to go NoSQL.如果只是为了25%的性能提升,没必要用NoSQL
- Benchmark relevancy depends on the use case. Does it match your situation(s)? 不同的应用场景会有不同的benchmark,在用之前最好自己测试一下
- Are you a startup that needs to release a product as soon as possible and you are playing around with ideas? Both SQL and NoSQL can make an argument.
- Performance may be equal on one box, but what happens when you need N?当你的数据比较少时,各个产品的性能可能都差不多,在你数据量增大时,哪个产品更好呢?
- Everything has problems, if you look at Amazon forums it's EBS is slow, or my instances won't reply, etc. For GAE it's the datastore is slow or X. Every product which people are using will have problems. Are you OK with the problems of the system you've selected?请记住,每个产品都可能有问题,有bug,宕机等等,你是否已经对你选择 的产品会出现的问题有充分的了解呢。是否已做好准备应对这些突发的问题呢?
原文地址:http://highscalability.com/blog/2011/6/20/35-use-cases-for-choosing-your-next-nosql-database.html
发表评论
-
消息中间件选型分析:从Kafka与RabbitMQ的对比看全局
2018-05-11 09:31 3552一、前言 消息队列中间件(简称消息中间件)是指利用高效可 ... -
服务发现:Zookeeper vs etcd vs Consul
2016-11-29 17:00 800【编者的话】本文对比了Zookeeper、etcd和Cons ... -
开源日志系统比较
2013-02-28 10:02 7811. 背景介绍 许多公司的平台 ... -
Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase comparison
2011-06-10 10:17 1942While SQL databases are insanel ... -
squid,nginx,lighttpd反向代理的区别
2011-05-27 17:54 1500squid,nginx,lighttpd反向代理的区别 ... -
(转)Apache Avro 与 Thrift 比较
2011-05-20 17:13 3377Avro 和Thrift都是跨语言,基于二进制的高性能的通讯 ...
相关推荐
开发者可以根据实际业务需求选择适合的NoSQL数据库类型,如键值存储、文档存储、列存储或图形数据库,以达到最佳的性能和可扩展性。在未来,NoSQL将继续与RDBMS并存,共同构建更加多样化和适应性强的数据存储体系。
本项目是一个电子商务平台的后端数据管理模拟系统,结合了SQL数据库(使用SQLite)和NoSQL数据库(使用MongoDB)来处理和存储不同类型的数据。SQL数据库用于存储结构化数据,如用户信息和订单记录;而NoSQL数据库则...
MongoDB 4.0 是一个功能强大、性能高效的 NoSQL 数据库,能够满足不同业务场景的需求。本文对 MongoDB 4.0 的特点、优势和应用场景进行了详细介绍,旨在帮助读者更好地理解和应用 MongoDB 4.0。
本文将从 NoSQL 数据库的特点和应用场景两个方面进行介绍。 NoSQL 数据库的特点: 1.易扩展性:NoSQL 数据库可以水平扩展,以满足大数据时代的需求。 2.高性能:NoSQL 数据库具有高性能,能够满足高速的数据处理...
8. **选择NoSQL的决策因素**:选择NoSQL还是RDBMS取决于具体的应用场景。考虑因素包括数据规模、性能需求、数据结构的复杂性、一致性要求以及团队的技术背景。 通过阅读《NoSQL精粹》中文版和英文版,读者可以深入...
理解关系型数据库和NOSQL数据库的特点、优劣和应用场景,可以帮助读者更好地选择合适的数据库系统。 关系型数据库的特点和优劣 ------------------------- 关系型数据库是一种基于关系模型的数据库,以行和列的...
选择NoSQL数据库还是SQL数据库并不是一个简单的二选一问题,而是需要根据具体的应用场景和技术要求做出综合判断。无论是NoSQL还是SQL数据库都有其独特的优势和局限性,企业在选择时应该充分考虑自身的需求和发展趋势...
其次,明确所需存储类型,根据业务需求选择最适合的NoSQL数据库类型。最后,结合业务场景进行深度定制和优化,如利用NoSQL数据库的复制协议进行数据同步、故障恢复等,充分发挥NoSQL数据库的优势,为应用提供强有力...
* MongoDB 和 HBase 的选择:根据实际应用场景和性能要求选择合适的数据库 知识点9: 数据库安全 * 数据库安全的考虑因素:身份验证、访问控制、数据加密等 * 数据库安全的措施:使用强密码、限制访问权限、使用...
根据提供的信息,我们可以推断出该...然而,选择NoSQL数据库时也需要综合考虑各种因素,确保能够满足具体业务场景的需求。通过对NoSQL数据库的深入理解和实践,开发者可以更好地利用这些工具来构建高效可靠的应用程序。
在选择适用于企业的NoSQL解决方案时,首先需要理解NoSQL的分类和架构特点。NoSQL数据库大致可以分为四类:键值存储(Key-Value)、列式存储(Column-Family)、文档存储(Document-Oriented)以及图数据库(Graph-...
6. **脚本编辑器**:对于需要运行JavaScript脚本的场景,NoSQLBooster提供了一个集成的脚本编辑器,支持直接在界面上编写和执行MongoDB的shell命令和脚本。 7. **SSL连接**:为了确保数据传输的安全,NoSQLBooster...
例如,如果你的项目预计会有大量并发用户或需要处理PB级别的数据,那么一个具有良好可扩展性的NoSQL数据库将是理想选择。 再者,数据模型的灵活性是NoSQL的一大优点。在关系型数据库中,数据必须遵循固定的模式,而...
在选择NoSQL时,需结合具体业务场景,考虑数据模型、数据一致性要求、读写性能等因素,合理权衡利弊。 总结来说,NoSQL数据库提供了应对大数据时代的新思路,对于需要处理大规模、高并发、动态数据的企业和开发者而...
该脑图是介绍NoSQL数据库的使用模型及使用场景,请贡献给大家下载!
数据库是现代信息技术的基石,它们帮助我们存储、检索和管理大量数据。随着大数据时代的到来,数据库...希望读者能够通过本文,对SQL和NoSQL数据库有一个清晰的认识,并在实际开发中根据项目需求做出合理的数据库选择。
内容大纲 定义 产生 共同特征 分类 适用场景 发展现状 7 挑战 NoSQL数据库PPT全文共20页,当前为第2页。 一.什么是NoSQL数据库? NoSQL: 即Not Only SQL 与关系型数据库相对应的,也可理解为 no relational ,即非...
NoSQL技术介绍与核心...然而,NoSQL并非万能药,每种数据库类型都有其适用场景,选择合适的数据库类型对于构建高效稳定的数据管理系统至关重要。在实际应用中,开发者应根据具体需求综合考虑各种因素,做出最佳选择。
NoSQL数据库的应用场景广泛,但选择哪种类型的NoSQL取决于具体业务需求。例如,社交网络应用可能更适合使用图数据库,而电子商务网站则可能受益于键值或文档数据库。随着互联网规模的不断扩展和数据量的增长,NoSQL...