首页 > 数据库 >亚马逊Dynamo数据库解读(英文版)

亚马逊Dynamo数据库解读(英文版)

时间:2023-10-19 22:47:07浏览次数:42  
标签:node consistency virtual 亚马逊 英文版 Dynamo nodes data

最近看了亚麻的Dynamo,个人认为其中always writeable的业务目标,对于DHT,vector clock,merkel tree的应用,包括对于一致性和高可用的权衡(基于CAP猜想,实现默认保证分区容错,因此二选一)等都很有意思。建议参考原论文食用。

What is the problem that this paper tries to solve? How would summarise its main idea in a few sentences? How does it work in more detail?

What is good about the paper? What is not good about the paper?

To what extent is the design of Dynamo inspired by Distributed Hash Tables (DHTs)? What are the advantages and disadvantages of such a design?
(part 3.3)
can be described as a zero-hop DHT
P2P:global
dynamo:locality

How does the design of Dynamo compare to that of BigTable?
Dynamo:for ACID(transaction)
BigTable: for structured data


key point:

target: always writeable
consistency & available(dynamo) : always conflict
dynamo: weak consistency: eventual consistency
vector clocks

Dynamo

Requirements

  • simple query model: r/w op for unique key to value, no mutli-data & relational schema

  • consistency & available : sometimes conflict

    Experience at Amazon has shown that data stores that provide ACID guarantees tend to have poor availability.

  • efficiency: commodity hardware infrastructure(通用硬件), achieve SLA

  • other: internal service without security related requirements such as authentication and authorization.

Target: meet SLA

Figure 1: Typically, the aggregator services are stateless, although they use extensive caching.

common standard: average, median and expected variance
while amazon: measured at the 99.9th percentile of the distribution


design

it is well known that when dealing with the possibility of network failures, strong consistency and high data availability cannot be achieved simultaneously

conflict resolution: eventually consistent data store

An important design consideration is to decide when to perform the process of resolving update conflicts
eg. whether conflicts should be resolved during reads(tradition) or writes(dynamo, for "always writeable")

who performs the process of conflict resolution

  • data store: simple, eg. "last write win"
  • application: flexible & suitable

Other key principles:Incremental scalability, Symmetry, Decentralization, Heterogeneity


P2P system


Architecture

partitioning, replication, versioning, membership, failure handling and scaling.

interface

get() put()

partitioning

basic consistent hashing algorithm(hash ring):

  • non-uniform data and load distribution
  • oblivious to the heterogeneity

improvement:

virtual node: A virtual node looks like a single node in the system, but each node can be responsible for more than one virtual node.
when a new node is added to the system, it is assigned multiple positions (henceforth, “tokens”) in the ring.

Replication

In addition to locally storing each key within its range, the coordinator replicates these keys at the N-1 clockwise successor nodes in the ring.
eg. in figure2: B itself, & C,D replicated

for virtual nodes, avoid dual node -> preference list stepping position(num > N for possible node failure) -> distinct physical nodes

Data versioning(important for consistency)

Dynamo provides eventual consistency, which allows for updates to be propagated to all replicas asynchronously.
(temporary inconsistencies)

thus, possible multi-versions(even the same data)

vector clocks: capture causality between different versions of the same object

format: a list of (node, counter) pairs

data conflict: return all the data to the client/logic to deal with

size restriction(possible for node failure)

Execution of operation: get() & put()

how to get node?

  1. load balancer route choose
  2. partition-aware client library

configurable values: R and W.
R is the minimum number of nodes that must participate in a successful read operation.
W is the minimum number of nodes that must participate in a successful write operation.
Setting R and W such that R + W > N yields a quorum-like system.
In this model, the latency of a get (or put) operation is dictated by the slowest of the R (or W) replicas.
For this reason, R and W are usually configured to be less than N, to provide better latency.

Handling Failures(temporary node failure): Hinted Handoff

sloppy quorum

handling the failure of an entire data center: each object is replicated across multiple data centers

Handling Failures(permanent node failure): Replica synchronization

Merkle tree: To detect the inconsistencies between replicas faster and to minimize the amount of transferred data

hash the childnode, construct tree from bottom to uphill, anti-entropy

Ring Membership

how virtual node mapped to physical node?

When a node starts for the first time, it chooses its set of tokens (virtual nodes in the consistent hash space) and maps nodes to their respective token sets.

Adding/Removing Storage Nodes

add front keys to new nodes, then remove related repetitive keys from back nodes


Implementation: all Java

  • request coordination
  • membership and failure detection
  • local persistence engine

EXPERIENCES & LESSONS

Class discussion

internal service so dont care about the security problem

virtual node idea -> load balance(flexibility): random -> logical ring depend on token sets

large-scale distributed system:

block chain: for security & anonymous
web3

consistent hash works: the ring partition

DHT(distributed hash table) ring: each node contains previous range

how the data stored: checking alongside the ring efficiently

gossip-based protocol: propagates membership changes and maintains an eventually consistent view of membership

use binary research to find the destination

distinct physical nodes: the preference list skipping particular position in the ring
N: virtual nodes, while it is possible that the multi virtual nodes on the same physical nodes, thus skipping the same physical nodes.

Brewer's conjecture: CAP Theorem

consistency, availability, and partition-tolerance: pick 2 out of 3!
native design: confirm partition, thus sacrifice strong consistency to earn high availability

标签:node,consistency,virtual,亚马逊,英文版,Dynamo,nodes,data
From: https://www.cnblogs.com/kazusarua/p/17775876.html

相关文章

  • google三驾马车之一:Bigtable解读(英文版)
    本文重点关注了系统设计相关的内容,paper后半部分的具体应用此处没有过多涉及。从个人笔记修改而来,因此为英文版本。Bigtable:ADistributedStorageSystemforStructuredDataDatamodel:notarelationaldatamodelABigtableisasparse,distributed,persistentmul......
  • 堪比Copilot平替?亚马逊云科技Amazon CodeWhisperer在开发效率提升上究竟如何
    说明 GitHubcopilot虽然很强,但是每个月的使用金额并不低,而亚马逊云科技AmazonCodeWhisperer免费支持多种编程语言的AI编程,甚至被网友称为GitHubcopilot平替?!  工具安装 如果你已经有vscode请忽略本章节,以python为例,安装python环境,把这个链接复制到浏览器下载python,注意操作系......
  • 基于 MySQL 和 DynamoDB 的强一致性分布式事务实践
    在单体应用向微服务架构转型的过程中,本地事务已不再满足系统一致性需求,为了解决这一问题,前人在对性能和数据一致性反复权衡的过程中总结了许多典型的协议和算法,各有优劣。本文我们将深入探讨Freewheel如何实现无单点故障的可扩展分布式事务实现模型。1、为什么需要分布式事务?当应......
  • 基于亚马逊云科技高可靠性的EC2云服务器,搭建功能无限制的私人网盘
    网盘是一种在线存储服务,提供文件存储,访问,备份,贡献等功能,是我们日常中不可或缺的一种服务。很多互联网公司都为个人和企业提供免费的网盘服务。但这些免费服务都有一些限制,比如限制下载速度,限制文件大小,不能多人同时管理,不能实现一些定制化功能。如果想取消这些限制,就要付费。现在为......
  • 开发神器 - 亚马逊 CodeWhisperer 代码开发 AI 工具
    最近在开发中,搜到一个神器,体验了一下非常不错,它是一款基于AI机器学习的代码开发神器,可以帮助我们自动生成想要的代码,可以实时提供代码建议,根据注释生成代码函数方法。不但减轻了开发人员的工作量,而且还能大幅度的提高我们的开发效率。亚马逊云科技开发者社区为开发者们提供全......
  • 地垫/毛绒地毯出口美国GCC清关认证亚马逊gcc认证
    出口美国地垫GCC清关认证美国联邦法律规定,地毯和垫子要符合易燃性标准和其它要求,包括2008年《美国消费品安全改进法》的要求。在地毯和垫子经过检测或合理检测项目后,作为一般用途的地毯和垫子的生产商和进口商必须在一般合规证书(GCC)中认证,地毯和垫子符合适用标准,确保合规和/或按......
  • 基于亚马逊云科技Amazon EC2云服务器,以高弹性和安全性自建堡垒机
    背景 在很多企业的实际应用场景中,特别是金融类的客户,大部分的应用都是部署在私有子网中,如何能够让客户的开发人员和运维人员从本地的数据中心中安全的访问云上资源,堡垒机是一个很好的选择。传统堡垒机的核心实现原理是基于SSH协议的安全连接,通常运用SSH(SecureShell)协议实现数据的......
  • 解读亚马逊云服务器 EC2 预留实例与按需实例的区别,及其在成本节约的优势
    随着云计算不断改变企业的运营方式,优化成本已成为首要任务。利用AmazonEC2预留实例是实现云端成本节约最有效的方法之一。以下将探讨什么是AmazonEC2预留实例,它与按需实例的区别,以及它在成本节约和灵活性方面提供的好处。在深入了解AmazonEC2预留实例的细节之前,需......
  • 武汉星起航:注重实践与理论相结合的亚马逊卖家孵化专家
    在跨境电商的激烈竞争中,拥有扎实的实践经验和深入的理论知识是成功的关键。武汉星起航电子商务有限公司就是一个以自营起家的企业,我们开设的亚马逊店铺不仅为自身带来了商业成功,更为星起航的卖家孵化业务做出了有力的支撑和铺垫。自营起家,实践经验为基石:我们深知亚马逊平台的运营规......
  • 武汉星起航凭借亚马逊自营经验优势,致力为跨境卖家提供全面服务
    在如今瞬息万变的跨境电商市场,纷繁复杂的服务商提供了各式各样的解决方案,但在这个竞争激烈的时代,卖家更加需要一个高效、综合、可信赖的伙伴来助力他们实现成功。正是基于这个需求,武汉星起航电子商务有限公司自成立之初就以“一站式解决”为己任,将自身的亚马逊自营经验和资源整合优......