Azure 表与 Azure 上的 MongoDB [英] Azure Table Vs MongoDB on Azure

查看:33
本文介绍了Azure 表与 Azure 上的 MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Windows Azure 上使用 NoSQL 数据库,数据量会非常大.使用 Worker 角色运行的 Azure 表存储或 MongoDB 数据库是否可以提供更好的性能和可扩展性?有没有人使用 Worker 角色在 Azure 上使用过 MongoDB?请分享您对通过 Azure 表存储在 Azure 上使用 MongoDB 的想法.

I want to use a NoSQL database on Windows Azure and the data volume will be very large. Whether a Azure Table storage or a MongoDB database running using a Worker role can offer better performance and scalability? Has anyone used MongoDB on Azure using a Worker role? Please share your thoughts on using MongoDB on Azure over the Azure table storage.

推荐答案

Table Storage 是一项核心的 Windows Azure 存储功能,设计为可扩展(100TB 200TB 500TB/帐户)、持久(在数据中心进行三次复制,可选择地理复制到另一个数据中心)和无模式(每行可能包含您想要的任何属性).一行通过分区键+行键定位,提供非常快速的查找.所有表存储访问均通过定义明确的 REST API 进行,可通过任何语言使用(使用 SDK,构建在 REST API 之上,已适用于 .NET、PHP、Java、Python 和 Ruby).

Table Storage is a core Windows Azure storage feature, designed to be scalable (100TB 200TB 500TB per account), durable (triple-replicated in the data center, optionally georeplicated to another data center), and schemaless (each row may contain any properties you want). A row is located by partition key + row key, providing very fast lookup. All Table Storage access is via a well-defined REST API usable through any language (with SDKs, built on top of the REST APIs, already in place for .NET, PHP, Java, Python & Ruby).

MongoDB 是一个面向文档的数据库.要在 Azure 中运行它,您需要将 MongoDB 安装到 web/worker 角色或虚拟机上,将其指向云驱动器(从而提供驱动器号)或附加磁盘(对于 Windows/Linux 虚拟机),可选择打开日记功能(我推荐),并可选择定义一个外部端点供您使用(或通过虚拟网络访问它).顺便说一下,云驱动器/附加磁盘实际上存储在 Azure Blob 中,为您提供与 Azure 表相同的持久性和地理复制.

MongoDB is a document-oriented database. To run it in Azure, you need to install MongoDB onto a web/worker roles or Virtual Machine, point it to a cloud drive (thereby providing a drive letter) or attached disk (for Windows/Linux Virtual Machines), optionally turn on journaling (which I'd recommend), and optionally define an external endpoint for your use (or access it via virtual network). The Cloud Drive / attached disk, by the way, is actually stored in an Azure Blob, giving you the same durability and georeplication as Azure Tables.

比较两者时,请记住表存储是存储即服务:您只需访问一个众所周知的 REST 端点.使用 MongoDB,您负责维护数据库(例如,每当 MongoDB Inc(前身为 10gen)推出新版本的 MongoDB 时,您都需要相应地更新您的服务器).

When comparing the two, remember that Table Storage is Storage-as-a-Service: you simply access a well-known REST endpoint. With MongoDB, you're responsible for maintaining the database (e.g. whenever MongoDB Inc (formerly 10gen) pushes out a new version of MongoDB, you'll need to update your server accordingly).

关于 jtoberon 指出的 MongoDB Inc 的 alpha 版本:如果你仔细观察它,你会看到一些关键的东西:

Regarding MongoDB Inc's alpha version pointed to by jtoberon: If you take a close look at it, you'll see a few key things:

  • 该设置适用于独立的 mongodb 实例,没有副本集或分片.关于副本集,由于 Blob 存储的工作方式,您仍然可以使用独立版本获得一些好处.
  • 为了提供高可用性,您可以运行多个实例.在这种情况下,只有一个实例为数据库提供服务,一个是热备份",一旦另一个实例出现故障(用于维护重启、硬件故障等),它就会启动 mongod 进程.

虽然 10gen 的 Windows Azure 包装器仍被视为alpha",但 mongod.exe 不是.您可以像启动任何其他 Windows exe 一样启动 mongod exe.这只是围绕启动的管理代码,这就是 alpa 实现所展示的内容.

While 10gen's Windows Azure wrapper is still considered 'alpha,' mongod.exe is not. You can launch the mongod exe just like you'd launch any other Windows exe. It's just the management code around the launching, and that's what the alpa implementation is demonstrating.

EDIT 2011-12-8:这不再处于 alpha 状态.您可以在此处下载最新的 MongoDB+Windows Azure 项目,该项目提供副本集支持.强>

EDIT 2011-12-8: This is no longer in an alpha state. You can download the latest MongoDB+Windows Azure project here, which provides replica-set support.

对于性能,我认为您需要进行一些基准测试.话虽如此,请考虑以下事项:

For performance, I think you'll need to do some benchmarking. Having said that, consider the following:

  • 当您从 Web 角色访问 Table Storage 或 MongoDB 时,您仍然会接触到 Windows Azure 存储系统.
  • MongoDB 使用大量内存作为自己的缓存.出于这个原因,许多大规模的 MongoDB 系统被部署到更大的实例大小.对于 Table Storage 访问,您不会有相同的内存大小考虑.

编辑 2015 年 4 月 7 日如果你想使用基于文档的数据库即服务,Azure 现在提供 DocumentDB.

EDIT April 7, 2015 If you want to use a document-based database as-a-service, Azure now offers DocumentDB.

这篇关于Azure 表与 Azure 上的 MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆