Neon -- AWS Aurora Postgres 的无服务器开源替代品
简介
Neon 是 AWS Aurora Postgres 的无服务器开源替代品。它将存储和计算分开,并通过跨节点集群重新分布数据来替代 PostgreSQL 存储层。 尝试使用 Neon免费套餐创建无服务器 Postgres 实例。然后使用您首选的 Postgres 客户端(psql、dbeaver 等)连接到它或使用在线 SQL 编辑器。有关连接说明,请参阅从任何应用程序连接。或者,在本地编译并运行该项目。
架构概述
Neon 由计算节点和 Neon 存储引擎组成。计算节点是由 Neon 存储引擎支持的无状态 PostgreSQL 节点。
Neon 存储引擎由两个主要组件组成: Pageserver - 计算节点的可扩展存储后端。 Safekeepers - Safekeepers 形成一个冗余的 WAL 服务,从计算节点接收 WAL,并将其持久存储,直到它被 Pageserver 处理并上传到云存储。

- https://github.com/neondatabase/neon
Rusqlite 使用 Rust 的 SQLite 包装器
Rusqlite 是一个使用 Rust 的 SQLite 的符合人体工程学的包装器。从历史上看,该 API 是基于 rust-postgres. 然而,两者在很多方面存在分歧,并且两者之间不存在兼容性。
使用
在您的 Cargo.toml 中:
[dependencies] # `bundled` causes us to automatically compile and link in an up to date # version of SQLite for you. This avoids many common build issues, and # avoids depending on the version of SQLite on the users system (or your # system), which may be old or missing. It's the right choice for most # programs that control their own SQLite databases. # # That said, it's not ideal for all scenarios and in particular, generic # libraries built around `rusqlite` should probably not enable it, which # is why it is not a default feature -- it could become hard to disable. rusqlite = { version = "0.29.0", features = ["bundled"] }
简单示例用法:
use rusqlite::{Connection, Result}; #[derive(Debug)] struct Person { id: i32, name: String, data: Option<Vec<u8>>, } fn main() -> Result<()> { let conn = Connection::open_in_memory()?; conn.execute( "CREATE TABLE person ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, data BLOB )", (), // empty list of parameters. )?; let me = Person { id: 0, name: "Steven".to_string(), data: None, }; conn.execute( "INSERT INTO person (name, data) VALUES (?1, ?2)", (&me.name, &me.data), )?; let mut stmt = conn.prepare("SELECT id, name, data FROM person")?; let person_iter = stmt.query_map([], |row| { Ok(Person { id: row.get(0)?, name: row.get(1)?, data: row.get(2)?, }) })?; for person in person_iter { println!("Found person {:?}", person.unwrap()); } Ok(()) }
支持的 SQLite 版本
基础 rusqlite 包支持 SQLite 版本 3.14.0 或更高版本。如果您需要旧版本的支持,请提出问题。一些货物功能需要更新的 SQLite 版本;请参阅下面的详细信息。
-
服务器
+关注
关注
13文章
10094浏览量
90879 -
编辑器
+关注
关注
1文章
826浏览量
32648 -
AWS
+关注
关注
0文章
443浏览量
26302 -
Rust
+关注
关注
1文章
240浏览量
7477
原文标题:【Rust日报】2023-08-16 Neon 基于 rust 的 AWS Aurora Postgres 的无服务器开源替代品
文章出处:【微信号:Rust语言中文社区,微信公众号:Rust语言中文社区】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
MMBFJ176替代品??
如何使用ISP1763作为替代品?
Commodore 6540 ROM的替代品
MC908JL3ECDWE的替代品是什么?
看好无服务器计算市场 AWS云应用库启用
“无服务器”计算兴起_AWS开启云应用库
AWS发布新一代Amazon Aurora Serverless
AWS上的无服务器多层架构
Rust编写的首个Postgres基础Elasticsearch开源替代品问世

Neon--AWS Aurora Postgres的无服务器开源替代品
评论