Skip to Content
在 Kubernetes 上管理云原生数据
book

在 Kubernetes 上管理云原生数据

by Jeff Carpenter, Patrick McFadin
May 2025
Beginner to intermediate
332 pages
4h 22m
Chinese
O'Reilly Media, Inc.
Content preview from 在 Kubernetes 上管理云原生数据

第 7 章 Kubernetes 原生数据库 Kubernetes 原生数据库

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

软件行业充斥着各种术语,这些术语用一个单词或短语就能定义主要趋势。你可以从本书的标题中看到其中一个:Cloud native。另一个例子是微服务(microservice),这是一种主要的架构范式,涉及到我们在此讨论的许多技术。最近,又出现了Kubernetes 原生无服务器等术语。

虽然简洁明了、朗朗上口,但将一个复杂的话题或趋势提炼成一句话,就会留下含糊不清的空间,或者至少会留下诸如 "这究竟是什么意思?"之类的合理问题。为了进一步混淆视听,这些术语经常被用于营销产品中,作为一种获得优势或区别于其他竞争产品的方式。不管你所消费的内容是明示还是潜台词,你可能都想知道,某项技术是否一定比其他产品更适合在 Kubernetes 上运行,因为它被贴上了Kubernetes 原生的标签。

当然,要想让这些术语对我们评估和挑选合适的应用技术有用,真正的任务是解读它们的真正含义,就像我们在第 1 章中解读云原生数据这个术语一样。在本章中,我们将探讨数据技术原生于 Kubernetes 的含义,并看看我们能否得出一个大家都能认同的定义。为此,我们将考察几个宣称使用这些术语的项目,并得出共同的原则:TiDB 和 Astra DB。准备好了吗?让我们开始吧!

为什么需要采用 Kubernetes 原生方法

首先,让我们来讨论一下为什么首先会产生 Kubernetes 原生数据库的想法。在本书中,到目前为止,我们一直专注于在 Kubernetes 上部署现有数据库,包括 MySQL 和 Cassandra。这些都是成熟的数据库,在 Kubernetes 出现之前就已经存在,并经过了时间的考验。它们拥有庞大的安装基础和用户社区,正因为有了这些投资,你就能明白为什么在 Kubernetes环境中运行这些数据库会有很大的动力,以及为什么人们对创建操作员来自动运行这些数据库如此感兴趣。

与此同时,你可能也注意到了将这些数据库适配到 Kubernetes 上运行的一些尴尬之处。虽然只需更改挂载路径就能将数据库指向基于 Kubernetes 的存储,但要与 Kubernetes 紧密集成以管理由多个节点组成的数据库,可能会涉及更多问题。这可能包括在 Pod 中部署传统管理 UI 并公开 HTTP 端口访问权限等相对简单的任务,也可能包括我们在第 6 章中看到的为管理和指标收集提供 API 的更复杂的侧车部署。

由于认识到了这种复杂性,一些创新者开发了新的数据库,旨在从第一天起就成为 Kubernetes 的原生数据库。在数据库行业,一个众所周知的公理是,一个新的数据库引擎需要 5-10 年才能达到成熟的程度。正因为如此,这些 Kubernetes 原生数据库往往不是全新的实现,而是将现有数据库重构为可以独立扩展的微服务,同时与开发人员习惯的现有 API 保持兼容。因此,分解单体的趋势已经出现在数据层。新兴一代的数据库将基于新的架构,以真正发挥 Kubernetes 的优势。

为了帮助我们评估哪些因素可以使这些新数据库成为 Kubernetes 原生数据库,让我们以"云原生数据基础架构原则 "中介绍的云原生数据原则为指导,提出一些问题来询问数据库如何与 Kubernetes 交互:

原则 1:将计算、网络和存储作为商品应用程序接口加以利用
数据库如何使用 Kubernetes 计算资源(Pod、Deployments、StatefulSets)、网络资源(Services ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

《使用 Kubernetes 实现云原生 DevOps(第二版)》

《使用 Kubernetes 实现云原生 DevOps(第二版)》

Justin Domingus, John Arundel
生产 Kubernetes

生产 Kubernetes

Josh Rosso, Rich Lander, Alex Brand, John Harris

Publisher Resources

ISBN: 9798341659667