Planet PostgreSQL

Planet PostgreSQL -

Adam Hendel: Building a Managed Postgres Service in Rust: Part 1

Tembo was founded in December 2022 with a mission to make the best Postgres service to deploy extensions. That mission has evolved since then to provide optimized Postgres instances for your workload, but let’s go back to the start. At the very minimum, we wanted our users to be able to come to Tembo Cloud, create a new Postgres instance, install Postgres extensions into that instance, and connect to that Postgres instance over the public internet. With this early vision in place, we started to sketch out an architecture for our product. Drawing inspiration from other cloud platforms, we quickly decided that we would architect the platform with two high-level components—a control-plane and a data-plane. Two early assumptions were that 1) there could be many data-planes per control-plane, and 2) the control-plane may not always be able to reach the data plane (for example if the data-plane’s network is private, dedicated for one customer). So, these two components must stay highly decoupled. Making the decision to decouple the infrastructure enabled us to move quickly in the control-plane without risk of impacting the managed infrastructure in the data-plane. The Control Plane The initial version of the control-plane consisted of just a web UI and a HTTP server. The HTTP server serves the purpose of handling Create, Read, Update, and Delete (CRUD) requests for Tembo instances. The server’s GET endpoints do things like list all the instances that belong to an organization or list all the attributes and configurations for a specific instance. PATCH routes handle updating instances with operations like restarting, installing an extension, or changing a configuration. All state is persisted in a Postgres instance dedicated to the control-plane. This includes all metadata related to instances in the platform such as their infrastructure requirements (cpu / mem / storage), Postgres extensions installed, and any custom configurations applied to the instance. Tembo’s clients, the web UI (hosted[...]

Tembo成立于2022年12月,旨在为工作负载提供优化的Postgres实例。平台由控制平面和数据平面组成,高度解耦。控制平面包括Web UI和处理CRUD请求的HTTP服务器。有限状态机用于管理Postgres实例的生命周期。平台的大部分代码使用Rust编写,包括状态机。平台使用队列在控制平面和数据平面之间缓冲任务。控制平面将CRUD事件发送到PGMQ,由数据平面的Conductor处理。控制平面接收来自数据平面的状态事件,并将其持久化到其Postgres数据库。该平台是开源的,并持续进行迭代。

Postgres Tembo rust service 控制平面 数据平面 有限状态机

相关推荐 去reddit讨论

热榜 Top10

eolink
eolink
Dify.AI
Dify.AI
LigaAI
LigaAI
观测云
观测云

推荐或自荐