azure db 设置时区_关于Azure Cosmos DB(以前称为DocumentDB)的8件事

Azure Cosmos DB是一款全球分布、低延迟、高吞吐量的多模型数据库,提供5种一致性选项以应对CAP定理。它支持多种API,自动建立索引并具有独立扩展存储和吞吐量的能力。此外,它还提供免费的仿真器供测试使用。
摘要由CSDN通过智能技术生成

azure db 设置时区

介绍 (Introduction)

Azure Cosmos DB is a low-latency, high throughput, globally distributed, a multi-model database which can scale within minutes and offers 5 consistency options to let you decide how to deal with the CAP theorem.

Azure Cosmos DB是一个低延迟,高吞吐量,全局分布的多模型数据库,可以在数分钟内进行扩展,并提供5种一致性选项,让您决定如何处理CAP定理。

Azure Cosmos DB used to be known as Document DB, but since additional features were added it has now morphed into Azure Cosmos DB. The name was chosen to spark the innovation and imagination of developers around the globe.

Azure Cosmos DB过去被称为Document DB,但是由于添加了其他功能,现在它已演变为Azure Cosmos DB。 选择该名称是为了激发全球开发人员的创新和想象力。

1. Azure Cosmos DB已在全球范围内分发 (1. Azure Cosmos DB is globally Distributed)

Azure Cosmos DB is classified as a foundational service, which means that it is available in every Azure region. This allows you to have your data replicated to as many data centres in as many regions as you wish.

Azure Cosmos DB被归类为基础服务,这意味着它在每个Azure区域中都可用。 这样,您就可以将数据复制到任意数量的区域中的任意数量的数据中心。

An acdditional region can be added by selecting the Replicate data globally option, and then simply clicking on the regions you want to replicate to on the map.

可以通过选择“全局复制数据”选项,然后在地图上单击要复制到的区域来添加附加区域。

It also allows you to specify priorities for your data regions, so you can decide to where it should failover in case of a disaster. You can specify either manual or automatic failover.

它还允许您为数据区域指定优先级,因此您可以决定在发生灾难时应该在哪里进行故障转移。 您可以指定手动或自动故障转移。

Because your application connects to logical endpoints, nothing has to be changed when there is a regional failover.

因为您的应用程序连接到逻辑端点,所以在进行区域故障转移时无需更改任何内容。

2. Azure Cosmos DB有5种一致性可供选择 (2. Azure Cosmos DB has 5 consistencies to choose from)

If you are familiar with the CAP theorem, you will know that there is no such thing as perfect consistency. There are always trade-offs. Azure Cosmos DB offers 5 consistency models at the moment so that you can decide for yourself what you deem more important and what you are willing to sacrifice. Consistency is a topic on its own so I will only touch on it briefly here.

如果您熟悉CAP定理,您将知道不存在完美一致性。 总是要权衡取舍。 目前,Azure Cosmos DB提供了5种一致性模型,因此您可以自己决定您认为更重要的内容和愿意牺牲的内容。 一致性本身就是一个主题,因此在这里我仅简要介绍一下。

The current available consistencies are:

当前可用的一致性为:


  • With strong consistency, you are guaranteed to always read the latest version of an item similar to read committed isolation in SQL Server. You can only ever see data which is durably committed. Strong consistency is scoped to a single region.
    凭借强大的一致性,可以确保您始终读取与SQL Server中读取已提交隔离类似的项目的最新版本。 您只能看到持久提交的数据。 强一致性仅限于单个区域。

  • In bounded-staleness consistency read will lag behind writes, and guarantees global order and not scoped to a single region.
    在有局限性的一致性中,读取将滞后于写入,并保证全局顺序,并且不限于单个区域。
    When configuring bounded-staleness consistency you need to specify the maximum lag by:
    配置有界陈旧性一致性时,您需要通过以下方式指定最大滞后时间:

    • For a single region the maximum operations lag must be between 10 and 1 000 000, and for the multi region, it will be between 100 000 and 1 000 000.
      对于单个区域,最大操作滞后必须在10到1000000之间,而对于多个区域,最大操作滞后将在10万到1000000之间。

    • The maximum lag must be between 5 seconds and 1 day for either single or multi-regions.
      对于单个或多个区域,最大延迟必须在5秒到1天之间。

  • This is the most popular consistency level, since it provides consistency guarantees but also has better throughput.
    这是最流行的一致性级别,因为它提供了一致性保证,但也具有更好的吞吐量。

  • A global order is preserved, and prefix order is guaranteed. A user will never see writes in a different order than that is which it was written.
    保留全局顺序,并保证前缀顺序。 用户将永远不会看到与写入顺序不同的写入。

  • Basically, this is like asynchronous synchronization. It guarantees that all changes will be replicated eventually, and as such, it also has the lowest latency because it does not need to wait on any commits.
    基本上,这就像异步同步。 它保证所有更改最终都将被复制,因此,它也具有最低的延迟,因为它不需要等待任何提交。

When you create your Azure Cosmos DB, you can choose which consistency level to use as the default, but a different consistency level can be specified every time you read from the database.

创建Azure Cosmos DB时,可以选择将哪个一致性级别用作默认值,但是每次从数据库读取时都可以指定不同的一致性级别。

The default of the default is Session consistency because it is the most widely used. If you want to change the default you can simply go to the Settings section on your Cosmos DB blade and click on Default consistency, which will then allow you to choose a different default.

默认值是会话一致性,因为它使用最广泛。 如果要更改默认值,则只需转到Cosmos DB刀片上的“设置”部分,然后单击“默认一致性”,这将允许您选择其他默认值。

3. Azure Cosmos DB是一个多模型数据库 (3. Azure Cosmos DB is a multi-model database)

Azure Cosmos DB uses an atom-record-sequence (ARS) system. Basically, the Cosmos DB translates all data models into atom-record-sequence based models.

Azure Cosmos DB使用原子记录序列(ARS)系统。 基本上,Cosmos DB将所有数据模型转换为基于原子记录序列的模型。

So, everything becomes either an atom, a record or a sequence.

因此,一切都变成原子,记录或序列。

  • An atom is a primitive type.

    原子是原始类型。
  • A record is a struct

    记录是一个结构
  • A sequence is an array of either atoms, records or structs.

    序列是原子,记录或结构的数组。

At the moment Azure Cosmos DB supports

目前,Azure Cosmos DB支持

  • Key-value pairs

    键值对
  • Column family

    列族
  • Document and

    文件和
  • Graph

    图形

4. Azure Cosmos DB支持多个API (4. Azure Cosmos DB support multiple APIs)

Azure Cosmos DB supports multiple APIs which can interact with all the data regardless of what data model is being used, so developers are able to develop in their preferred technology. It currently supports 4 APIs.

Azure Cosmos DB支持多个API,无论使用哪种数据模型,这些API都可以与所有数据进行交互,因此开发人员可以使用其首选技术进行开发。 当前支持4个API。

  • SQL

    SQL
  • Mongo DB API

    Mongo DB API
  • Tables API

    表格API
  • Gremlin

    格林姆林

5. Azure Cosmos DB自动建立索引 (5. Azure Cosmos DB indexes automatically)

Azure Cosmos DB handles indexing automatically and does not need any schema or any secondary indexes. It uses Bw-trees instead of B-trees. Bw-trees makes use of multi-core technology, it does not use latches, and it never updates a memory page in place as to avoid cache invalidations. It also takes advantage of flash storage.

Azure Cosmos DB自动处理索引,不需要任何架构或任何辅助索引。 它使用Bw树而不是B树。 Bw树使用多核技术,不使用锁存器,并且从不更新适当的内存页以避免缓存失效。 它还利用闪存存储。

Even though Cosmos DB takes care of indexing automatically. It still allows developers to perform fine grained tuning by allowing a developer to implement a custom indexing policy.

即使Cosmos DB会自动处理索引。 通过允许开发人员实施自定义索引策略,它仍然允许开发人员执行细粒度的调整。

You can change it in the Azure Portal by going to your Cosmos DB blade. Click on Settings and then on the indexing policy option.

您可以通过转到Cosmos DB刀片在Azure门户中对其进行更改。 单击设置,然后单击索引策略选项。

6. Azure Cosmos DB具有非常低的延迟 (6. Azure Cosmos DB has very low latency)

Azure Cosmos DB guarantees less than 10 ms for reads and less than 15 ms latency for writes.

Azure Cosmos DB保证读取少于10毫秒,写入少于15毫秒。

During the 15 milliseconds, the data is actually written, committed, replicated and indexed in less than 15 milliseconds.

在15毫秒内,实际上会在不到15毫秒的时间内写入,提交,复制和索引数据。

Basically, all reads and writes are served from a local region and then replicated according to the selected consistency model.

基本上,所有读取和写入都是从本地区域进行的,然后根据所选的一致性模型进行复制。

7. Azure Cosmos DB可以独立扩展存储和吞吐量 (7. Azure Cosmos DB can scale storage and throughput independently)

If you need more storage you can add additional storage without having to pay for additional throughput. These two things can scale independently of each other.

如果您需要更多存储空间,则可以添加其他存储空间而不必支付额外的吞吐量。 这两件事可以相互独立扩展。

To scale throughput the first thing you should do is to estimate how much throughput and storage you will actually need. You can use the handy Capacity Planner site to perform the calculation. It will give you an estimate of how many RUs (Request Units) you need as well as the amount of Data Storage.

要扩展吞吐量,您应该做的第一件事就是估算实际需要的吞吐量和存储量。 您可以使用方便的Capacity Planner网站进行计算。 它将为您估算所需的RU(请求单位)数量以及数据存储量。

Once that is done, the number of RUs and storage can be increased using the Scale option on the Cosmos DB server blade in Azure.

完成此操作后,可以使用Azure中Cosmos DB服务器刀片上的“缩放”选项来增加RU和存储的数量。

8. Azure Cosmos DB具有免费的仿真器用于测试 (8. Azure Cosmos DB has a free emulator for testing)

When you develop an application to use Azure Cosmos DB, you don’t need to spend your money until you are ready to launch your application. You can use the Azure Cosmos DB Emulator, which will allow you to develop and test your applications before having to use your Azure Cosmos DB account.

在开发应用程序以使用Azure Cosmos DB时,无需花钱就可以准备启动应用程序。 您可以使用Azure Cosmos DB仿真器 ,使用它可以在必须使用Azure Cosmos DB帐户之前开发和测试应用程序。

翻译自: https://www.sqlshack.com/8-things-know-azure-cosmos-db-formerly-documentdb/

azure db 设置时区

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值