database 谷歌使用什么数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/362956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 07:07:08  来源:igfitidea点击:

What database does Google use?

databasegoogle-searchgoogle-cloud-datastorebigtable

提问by solrevdev

Is it Oracle or MySQL or something they have built themselves?

是 Oracle 或 MySQL 还是他们自己构建的东西?

回答by splattne

Bigtable

大表

A Distributed Storage System for Structured Data

结构化数据的分布式存储系统

Bigtable is a distributed storage system (built by Google) for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers.

Many projects at Google store data in Bigtable, including web indexing, Google Earth, and Google Finance. These applications place very different demands on Bigtable, both in terms of data size (from URLs to web pages to satellite imagery) and latency requirements (from backend bulk processing to real-time data serving).

Despite these varied demands, Bigtable has successfully provided a flexible, high-performance solution for all of these Google products.

Bigtable 是一个分布式存储系统(由 Google 构建),用于管理结构化数据,旨在扩展到非常大的规模:跨越数千台商品服务器的 PB 级数据。

Google 的许多项目都将数据存储在 Bigtable 中,包括网络索引、Google 地球和 Google 财经。这些应用程序对 Bigtable 提出了截然不同的要求,包括数据大小(从 URL 到网页再到卫星图像)和延迟要求(从后端批量处理到实时数据服务)。

尽管有这些不同的需求,Bigtable 已经成功地为所有这些 Google 产品提供了灵活、高性能的解决方案。

Some features

一些特点

  • fast and extremely large-scale DBMS
  • a sparse, distributed multi-dimensional sorted map, sharing characteristics of both row-oriented and column-oriented databases.
  • designed to scale into the petabyte range
  • it works across hundreds or thousands of machines
  • it is easy to add more machines to the system and automatically start taking advantage of those resources without any reconfiguration
  • each table has multiple dimensions (one of which is a field for time, allowing versioning)
  • tables are optimized for GFS (Google File System) by being split into multiple tablets - segments of the table as split along a row chosen such that the tablet will be ~200 megabytes in size.
  • 快速且超大规模的 DBMS
  • 一个稀疏的、分布式的多维排序映射,共享面向行和面向列的数据库的特性。
  • 旨在扩展到 PB 范围
  • 它适用于数百或数千台机器
  • 很容易向系统添加更多机器,并自动开始利用这些资源,无需任何重新配置
  • 每个表都有多个维度(其中一个是时间字段,允许版本控制)
  • 表针对 GFS(Google 文件系统)进行了优化,将其拆分为多个平板电脑 - 表格的各个部分沿着所选的行拆分,以便平板电脑的大小约为 200 兆字节。

Architecture

建筑学

BigTable is not a relational database. It does not support joins nor does it support rich SQL-like queries. Each table is a multidimensional sparse map. Tables consist of rows and columns, and each cell has a time stamp. There can be multiple versions of a cell with different time stamps. The time stamp allows for operations such as "select 'n' versions of this Web page" or "delete cells that are older than a specific date/time."

BigTable 不是关系数据库。它不支持连接,也不支持丰富的类似 SQL 的查询。每个表都是一个多维稀疏映射。表格由行和列组成,每个单元格都有一个时间戳。一个单元格可以有多个版本,带有不同的时间戳。时间戳允许诸如“选择此网页的‘n’个版本”或“删除早于特定日期/时间的单元格”之类的操作。

In order to manage the huge tables, Bigtable splits tables at row boundaries and saves them as tablets. A tablet is around 200 MB, and each machine saves about 100 tablets. This setup allows tablets from a single table to be spread among many servers. It also allows for fine-grained load balancing. If one table is receiving many queries, it can shed other tablets or move the busy table to another machine that is not so busy. Also, if a machine goes down, a tablet may be spread across many other servers so that the performance impact on any given machine is minimal.

为了管理庞大的表,Bigtable 在行边界处拆分表并将它们保存为平板电脑。一个平板电脑大约200MB,每台机器保存大约100个平板电脑。此设置允许将单个表中的平板电脑分布在多个服务器中。它还允许细粒度的负载平衡。如果一个表正在接收许多查询,它可以卸载其他表或将繁忙的表移到另一台不太繁忙的机器上。此外,如果机器出现故障,平板电脑可能会分布在许多其他服务器上,因此对任何给定机器的性能影响最小。

Tables are stored as immutable SSTables and a tail of logs (one log per machine). When a machine runs out of system memory, it compresses some tablets using Google proprietary compression techniques (BMDiff and Zippy). Minor compactions involve only a few tablets, while major compactions involve the whole table system and recover hard-disk space.

表存储为不可变的 SSTables 和日志尾部(每台机器一个日志)。当机器用完系统内存时,它会使用 Google 专有的压缩技术(BMDiff 和 Zippy)压缩一些平板电脑。小压缩只涉及几个片,大压缩涉及整个表系统并回收硬盘空间。

The locations of Bigtable tablets are stored in cells. The lookup of any particular tablet is handled by a three-tiered system. The clients get a point to a META0 table, of which there is only one. The META0 table keeps track of many META1 tablets that contain the locations of the tablets being looked up. Both META0 and META1 make heavy use of pre-fetching and caching to minimize bottlenecks in the system.

Bigtable 平板电脑的位置存储在单元格中。任何特定平板电脑的查找都由三层系统处理。客户端得到一个指向 META0 表的点,其中只有一个。META0 表跟踪许多 META1 平板电脑,其中包含正在查找的平板电脑的位置。META0 和 META1 都大量使用预取和缓存来最小化系统中的瓶颈。

Implementation

执行

BigTable is built on Google File System(GFS), which is used as a backing store for log and data files. GFS provides reliable storage for SSTables, a Google-proprietary file format used to persist table data.

BigTable 建立在Google 文件系统(GFS)之上,用作日志和数据文件的后备存储。GFS 为 SSTables 提供可靠的存储,SSTables 是一种用于持久化表数据的 Google 专有文件格式。

Another service that BigTable makes heavy use of is Chubby, a highly-available, reliable distributed lock service. Chubby allows clients to take a lock, possibly associating it with some metadata, which it can renew by sending keep alive messages back to Chubby. The locks are stored in a filesystem-like hierarchical naming structure.

BigTable 大量使用的另一项服务是Chubby,这是一种高可用、可靠的分布式锁服务。Chubby 允许客户端获取锁,可能会将它与一些元数据相关联,它可以通过将保持活动消息发送回 Chubby 来更新这些元数据。锁存储在类似文件系统的分层命名结构中。

There are three primary server typesof interest in the Bigtable system:

Bigtable 系统中有三种主要的服务器类型

  1. Master servers: assign tablets to tablet servers, keeps track of where tablets are located and redistributes tasks as needed.
  2. Tablet servers: handle read/write requests for tablets and split tablets when they exceed size limits (usually 100MB - 200MB). If a tablet server fails, then a 100 tablet servers each pickup 1 new tablet and the system recovers.
  3. Lock servers: instances of the Chubby distributed lock service. Lots of actions within BigTable require acquisition of locks including opening tablets for writing, ensuring that there is no more than one active Master at a time, and access control checking.
  1. 主服务器:将平板电脑分配给平板电脑服务器,跟踪平板电脑的位置并根据需要重新分配任务。
  2. 平板服务器:处理平板和拆分平板的读/写请求,当它们超过大小限制(通常为 100MB - 200MB)时。如果平板服务器出现故障,则 100 个平板服务器每台拾取 1 个新平板,系统就会恢复。
  3. 锁服务器:Chubby 分布式锁服务的实例。BigTable 中的许多操作都需要获取锁,包括打开平板电脑进行写入、确保一次不超过一个活动的 Master,以及访问控制检查。

Example from Google's research paper:

谷歌研究论文中的例子:

alt text

替代文字

A slice of an example table that stores Web pages. The row name is a reversed URL. The contents column family contains the page contents, and the anchor column family contains the text of any anchorsthat reference the page. CNN's home page is referenced by both the Sports Illustrated and the MY-look home pages, so the row contains columns named anchor:cnnsi.comand anchor:my.look.ca. Each anchor cell has one version; the contents column has three versions, at timestamps t3, t5, and t6.

存储网页的示例表的一部分。行名称是 反向 URL。内容列族包含页面内容,锚列族包含引用页面的任何锚文本。CNN 的主页被 Sports Illustrated 和 MY-look 主页引用,因此该行包含名为anchor:cnnsi.com和 的 列 anchor:my.look.ca。每个锚单元有一个版本;内容栏有三个版本,在时间戳 t3t5t6

API

应用程序接口

Typical operations to BigTable are creation and deletion of tables and column families, writing data and deleting columns from a row. BigTable provides this functions to application developers in an API. Transactions are supported at the row level, but not across several row keys.

BigTable 的典型操作是创建和删除表和列族、写入数据和从行中删除列。BigTable 通过 API 向应用程序开发人员提供此功能。行级别支持事务,但不支持跨多个行键。



Here is the link to the PDF of the research paper.

这是研究论文 PDF链接

And here you can find a video showing Google's Jeff Dean in a lecture at the University of Washington, discussing the Bigtable content storage system used in Google's backend.

在这里,您可以找到一段视频,视频展示了 Google 的 Jeff Dean 在华盛顿大学的一次演讲中,讨论了 Google 后端使用的 Bigtable 内容存储系统。

回答by Mark Ingram

It's something they've built themselves - it's called Bigtable.

这是他们自己构建的东西——它被称为 Bigtable。

http://en.wikipedia.org/wiki/BigTable

http://en.wikipedia.org/wiki/BigTable

There is a paper by Google on the database:

谷歌有一篇关于数据库的论文:

http://research.google.com/archive/bigtable.html

http://research.google.com/archive/bigtable.html

回答by user

Spanneris Google's globally distributed relational database management system (RDBMS), the successor to BigTable. Google claims it is not a pure relational system because each table must have a primary key.

Spanner是 Google 的全球分布式关系数据库管理系统 (RDBMS),BigTable的继承者。谷歌声称它不是一个纯粹的关系系统,因为每个表都必须有一个主键。

Hereis the link of the paper.

是论文的链接。

Spanner is Google's scalable, multi-version, globally-distributed, and synchronously-replicated database. It is the first system to distribute data at global scale and support externally-consistent distributed transactions. This paper describes how Spanner is structured, its feature set, the rationale underlying various design decisions, and a novel time API that exposes clock uncertainty. This API and its implementation are critical to supporting external consistency and a variety of powerful features: non-blocking reads in the past, lock-free read-only transactions, and atomic schema changes, across all of Spanner.

Spanner 是 Google 的可扩展、多版本、全球分布和同步复制的数据库。它是第一个在全球范围内分发数据并支持外部一致性分布式事务的系统。本文介绍了 Spanner 的结构、其功能集、各种设计决策的基本原理,以及一种暴露时钟不确定性的新颖时间 API。这个 API 及其实现对于支持外部一致性和各种强大的功能至关重要:过去的非阻塞读取、无锁只读事务和原子模式更改,跨越所有 Spanner。

Another database invented by Google is Megastore. Here is the abstract:

谷歌发明的另一个数据库是Megastore。这是摘要:

Megastore is a storage system developed to meet the requirements of today's interactive online services. Megastore blends the scalability of a NoSQL datastore with the convenience of a traditional RDBMS in a novel way, and provides both strong consistency guarantees and high availability. We provide fully serializable ACID semantics within fine-grained partitions of data. This partitioning allows us to synchronously replicate each write across a wide area network with reasonable latency and support seamless failover between datacenters. This paper describes Megastore's semantics and replication algorithm. It also describes our experience supporting a wide range of Google production services built with Megastore.

Megastore 是为满足当今交互式在线服务的要求而开发的存储系统。Megastore 以一种新颖的方式将 NoSQL 数据存储的可扩展性与传统 RDBMS 的便利性相结合,并提供强一致性保证和高可用性。我们在细粒度的数据分区中提供完全可序列化的 ACID 语义。这种分区允许我们以合理的延迟跨广域网同步复制每个写入,并支持数据中心之间的无缝故障转移。本文介绍了 Megastore 的语义和复制算法。它还描述了我们支持使用 Megastore 构建的各种 Google 生产服务的经验。

回答by EvilRyry

As others have mentioned, Google uses a homegrown solution called BigTable and they've released a few papers describing it out into the real world.

正如其他人所提到的,Google 使用了一种名为 BigTable 的本土解决方案,并且他们已经发布了几篇论文,将其描述到现实世界中。

The Apache folks have an implementation of the ideas presented in these papers called HBase. HBase is part of the larger Hadoop project which according to their site "is a software platform that lets one easily write and run applications that process vast amounts of data."Some of the benchmarks are quite impressive. Their site is at http://hadoop.apache.org.

Apache 人员实现了这些论文中提出的想法,称为HBase。HBase 是更大的 Hadoop 项目的一部分,根据他们的网站,该项目“是一个软件平台,可以让人们轻松编写和运行处理大量数据的应用程序。” 一些基准测试非常令人印象深刻。他们的网站位于http://hadoop.apache.org

回答by Mauricio Scheffer

Although Google uses BigTable for all their main applications, they also use MySQLfor other (perhaps minor) apps.

尽管 Google 的所有主要应用程序都使用 BigTable,但他们也将 MySQL用于其他(可能是次要的)应用程序。

回答by Koen Bok

And it's maybe also handy to know that BigTable is not a relational database (like MySQL) but a huge (distributed) hash tablewhich has very different characteristics. You can play around with (a limited version) of BigTable yourself on the Google AppEngineplatform.

知道 BigTable 不是关系数据库(如 MySQL)而是一个巨大的(分布式)哈希表,它具有非常不同的特征,这可能也很方便。您可以自己在Google AppEngine平台上使用(有限版本)BigTable 。

Next to Hadoop mentioned above there are many other implementations that try to solve the same problems as BigTable (scalability, availability). I saw a nice blog post yesterday listing most of them here.

除了上面提到的 Hadoop 之外,还有许多其他实现试图解决与 BigTable 相同的问题(可扩展性、可用性)。我昨天看到一篇不错的博客文章,在这里列出了其中的大部分内容。

回答by Suresh Kumar Amrani

Google primarily uses Bigtable.

Google 主要使用 Bigtable。

Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size.

Bigtable 是一个分布式存储系统,用于管理结构化数据,旨在扩展到非常大的大小。

For more information, download the document from here.

有关更多信息,请从此处下载文档。

Google also uses Oracle and MySQL databases for some of their applications.

Google 还在其某些应用程序中使用 Oracle 和 MySQL 数据库。

Any more information you can add is highly appreciated.

非常感谢您可以添加的任何更多信息。

回答by underdog

Google services have a polyglot persistence architecture. BigTable is leveraged by most of its services like YouTube, Google Search, Google Analytics etc. The search service initially used MapReduce for its indexing infrastructure but later transitioned to BigTable during the Caffeine release.

Google 服务具有多语言持久性架构。BigTable 被 YouTube、谷歌搜索、谷歌分析等大多数服务所利用。搜索服务最初使用 MapReduce 作为其索引基础设施,但后来在 Caffeine 版本期间过渡到 BigTable。

Google Cloud datastore has over 100 applications in production at Google both facing internal and external users. Applications like Gmail, Picasa, Google Calendar, Android Market & AppEngine use Cloud Datastore & Megastore.

谷歌云数据存储在谷歌有 100 多个面向内部和外部用户的生产应用程序。Gmail、Picasa、Google 日历、Android Market 和 AppEngine 等应用程序使用 Cloud Datastore 和 Megastore。

Google Trends use MillWheel for stream processing. Google Ads initially used MySQL later migrated to F1 DB - a custom written distributed relational database. Youtube uses MySQL with Vitess. Google stores exabytes of data across the commodity servers with the help of the Google File System.

Google 趋势使用 MillWheel 进行流处理。Google Ads 最初使用 MySQL,后来迁移到 F1 DB——一个自定义编写的分布式关系数据库。Youtube 使用 MySQL 和 Vitess。谷歌在谷歌文件系统的帮助下跨商品服务器存储艾字节的数据。

Source: Google Databases: How Do Google Services Store Petabyte-Exabyte Scale Data?

来源:Google 数据库:Google 服务如何存储 PB-Exabyte 规模的数据?

YouTube Database – How Does It Store So Many Videos Without Running Out Of Storage Space?

YouTube 数据库 – 如何在不耗尽存储空间的情况下存储这么多视频?

enter image description here

在此处输入图片说明