首页 > 其他分享 >google三驾马车之一:Bigtable解读(英文版)

google三驾马车之一:Bigtable解读(英文版)

时间:2023-10-16 20:00:43浏览次数:32  
标签:memtable google tablet distributed SSTable master 英文版 Bigtable

本文重点关注了系统设计相关的内容,paper后半部分的具体应用此处没有过多涉及。从个人笔记修改而来,因此为英文版本。

Bigtable: A Distributed Storage System for Structured Data

Data model: not a relational data model

A Bigtable is a sparse, distributed, persistent multidimensional sorted map. —— part2

How the map indexed?

(row:string, column:string, time:int64) → string

just like json format, eg:

table{  
  // ...  
  "aaaaa" : { //row
    "A:foo" : { //col
        15 : "y", //timestamp 
        4 : "m"  
      },  
    "A:bar" : { //col
        15 : "d",  
      },  
    "B:" : { //col
        6 : "w"  
        3 : "o"  
        1 : "w"  
      }  
  },  
  // ...  
}

a particular table: webtable

  • row(also called tablet): reversed URL

    concurrent: single row key is atomic
    lexicographic order

  • col: column families, contents

    family:qualifier
    Access control and both disk and memory accounting

  • timestamp

    avoid collisions: unique timestamp, decreasing order
    garbage-collection mechanism(eg.)


API

C++ read/write

MapReduce + Bigtable


Building Block

Google File System: store log and data files

distributed Google File System

Google SSTable file format: store Bigtable data

K-V map: iterate key/value pairs in a specified key range

  • a sequence of blocks
  • a block index
disk seek or memory seek?

Optionally, SSTable can be completely mapped into memory, which allows us to perform lookups and scans without touching disk.

Chubby: distributed lock service

5 active replicas: 1 master, 4 slave

Paxos algorithm: to keep its replicas consistent in the face of failure

namespace: including directory and small file, op r/w is atomic

session: when expires, lose locks and open handles


Implementation

consist:

  1. library(?) linked to every client
  2. 1 master server(schedule, garbage-collect......)
  3. many tablet server(10-1000 tablets)

As with many single-master distributed storage systems, client data does not move through the master: clients communicate directly with tablet servers for reads and writes.

hierarchy (B+-tree)

Chubby file -> Root tablet -> other METADATA tablets -> UserTables

METADATA: many other things stored in it

Master: schedule & manage

Each tablet is assigned to one tablet server at a time. Bigtable uses Chubby to keep track of tablet servers. When a tablet server starts, it creates, and acquires an exclusive lock on, a uniquely-named file in a specific Chubby directory. The master monitors this directory (the servers directory) to discover tablet servers.

The essential point for distributed database: lock

The Bigtable is only a series of ops, real data is stored in GFS.(SSTable)

Tablet Representation

memtable: the recently committed updates are stored in memory in a sorted buffer

reconstruct: redo points in commit logs

Compactions

As write operations execute, the size of the memtable increases. When the memtable size reaches a threshold, the memtable is frozen, a new memtable is created, and the frozen memtable is converted to an SSTable and written to GFS.

minor(memtable) -> major(SSTable) compaction


Refinement

locality group

Clients can group multiple column families together into a locality group. A separate SSTable is generated for each locality group in each tablet.

This section describes portions of the implementation in more detail in order to highlight these refinements.

in-memory locality groups are loaded lazily

storage: compression

read performance: caching

Bloom filters

commit-log

Speeding up tablet recovery

Exploiting immutability


Performance Evaluation


Lesson

  1. large distributed systems are vulnerable to many types of failures
  2. it is important to delay adding new features until it is clear how the new features will be used
  3. the importance of proper system-level monitoring
  4. the value of simple designs

标签:memtable,google,tablet,distributed,SSTable,master,英文版,Bigtable
From: https://www.cnblogs.com/kazusarua/p/17768224.html

相关文章

  • google gtest框架入门使用案例
    通过本文可以收获:googlegtest急速入门、googlegtest资源网站。googlegtest是什么googlegtest是谷歌开源的c++单元测试框架,非常的好用。起码个人感觉和springboot自带的测试框架功能差不太多。安装略过,请参考:GitHub-google/googletest:GoogleTest-GoogleTesting......
  • 为什么Google在JSON响应中添加了`while(1);`?
    内容来自DOChttps://q.houxu6.top/?s=为什么Google在JSON响应中添加了while(1);?为什么Google在(私有)JSON响应前加上while(1);?例如,这是在Google日历中打开和关闭日历时的响应:while(1);[['u',[['smsSentFlag','false'],['hideInvitations','false......
  • Google – Cloud Translation API
    前言通常网站内容翻译,我们都不推荐使用GoogleTranslate。但网站中一些不那么重要的内容确实可以用GoogleTranslate。比如CustomerReviews。这篇是续 GoogleMapsEmbedAPI&JavaScriptAPIGoogle–ReviewsYouTubeDataAPI又一篇关于GoogleCloudAPI的教程。......
  • 使用GoogleTest框架进行cpp代码的基本单元测试
    title:aliases:tags:-cpp/单元测试-cmake-工程技术category:-方法stars:url:creation-time:2023-10-1119:02modification-time:这里主要介绍从0开始实现基本的单元测试功能。构建首先从googletest代码仓下载源码。网上很多指导包括官方的指......
  • 如何使用 Google Analytics 白嫖做应用埋点
    GoogleAnalytics很多时候用于做网站的数据分析,直接在网站中嵌入代码就可以。如果是Chrome插件或者其它应用,可以使用MeasurementProtocolAPI来上报埋点。API官方文档:MeasurementProtocol(GoogleAnalytics(分析)4) | 适用于GoogleAnalytics(分析)4的MeasurementProt......
  • Google Guava 库用法整理
    参考:(2,3,4)http://blog.publicobject.com更多用法参考http://ajoo.iteye.com/category/119082以前这么用:Java代码Map<String,Map<Long,List<String>>>map=newHashMap<String,Map<Long,List<String>>>();现在这么用(JDK7将实现该功能......
  • Unity 通信方案 - 使用 Google Protobuf 序列化数据
    1.下载和编译1.1下载ProtoBuf源文件从github下载最新的protoBuf库,如下图所示 Releases·protocolbuffers/protobuf(github.com)1.2编译dll和导入解压后打开/scharp/src中的sln工程文件 选择Release,Google.Protobuf,之后在生成中生成文件在......
  • 工具 | 极其方便的谷歌翻译软件 Myna for Google Translate for Mac | Mac
    工具|极其方便的谷歌翻译软件MynaforGoogleTranslateforMac|Mac前言Mac哪款翻译软件好用呢?市面有太多的翻译工具了,如:百度、谷歌、有道等等。但是不得不说作为对外交流学习或学术阅览,谷歌翻译算得上是比较专业和让人信赖的。而MynaforGoogleTranslateforMac是......
  • VMWare 安装英文版 Windows XP 后遇到中文乱码问题的解决方法
    我在windows11s上通过VMWareWorkstationPlayer安装了英文版的WindowsXP后,安装中文软件时遇到乱码问题,如下图所示:这是因为英文版的windowsXP缺乏了中文语言包造成的。解决方案打开WindowsXP的控制面板,选择Languages面板:在Supplementallanguagesupport......
  • Win12不会取代Win11!真正目标是Google
    Windows11之后自然应该是Windows12,但这一次不太一样。据多个消息源确认,Windows的下一个重大版本将不会是Windows11的直接升级版,而是更专注于云和Web,同时大力接入AI,目标直指GoogleChromeOS。这个所谓的Windows12,将打造一个更加现代化、模块化、轻量化的系统,尤其适合低端教育......