Neki – Sharded Postgres
279 points
• 4 days ago
• Article
Link
Neki 是 PlanetScale 推出的全新分片式 Postgres 产品,旨在帮助团队突破单机扩展数据库的限制。凭借多年管理大规模 MySQL 集群的实战经验,PlanetScale 开发了 Neki,让用户能够将 Postgres 数据分布到多台机器,同时保持与标准 Postgres 驱动、 ORM 和连接字符串的兼容性。 Neki 在每个分片上都运行真实的 Postgres(而非自研存储引擎),因此能够完整保留现有扩展和 SQL 功能。
Neki 的核心架构由四部分组成。 Neki routers 负责接收和路由流量,充当解析查询、生成分布式执行计划并汇总结果的网关;每个 shard 由一个主库和分布在不同可用区的多个副本构成,以保证高可用性;通过 sidecars 实现的智能连接池可实时监测各个 Postgres 实例的实际承载能力,从而更高效地调度流量;最后由 control plane 负责全局健康管理,协调故障转移、模式变更和数据重分片等操作。
用户通过 data topology 管理数据分布,这是一份用 shard keys 定义的 JSON 配置,用来把逻辑表映射到物理分片上。这样的灵活性让团队可以先采用标准的非分片 Postgres 部署,只有在性能成为瓶颈时再迁移到分片模型。平台将这些扩展操作作为在线内置工作流来处理,因此诸如 schema 更新或版本升级等通常需要大量停机的操作,用户可以在不中断应用的情况下完成。
除了分片能力外,Neki 还集成了 PlanetScale 的成熟功能,例如 database Insights 、自动架构建议和分支工作流,旨在为那些已超出单机限制但又不想放弃标准 Postgres 体验或自行管理复杂应用级分片的组织提供平滑的迁移路径。
Neki 目前处于平台预览阶段。公司鼓励用户了解其架构和功能,但建议在此阶段不要在关键生产负载上运行,因为可能会有破坏性变更。感兴趣的用户可以登录 PlanetScale 账号选择加入预览,并查阅文档获取有关集群设置与配置的详细技术说明。
Neki is a new sharded Postgres offering from PlanetScale, designed to help teams overcome the limitations of scaling databases on single machines. Drawing on years of experience managing massive MySQL clusters, PlanetScale developed Neki to allow users to distribute their Postgres data across multiple machines while maintaining compatibility with standard Postgres drivers, ORMs, and connection strings. Because it uses real Postgres on every shard rather than a custom storage engine, it preserves full support for existing extensions and SQL functionality.
The core architecture of Neki relies on four distinct components. Neki routers manage incoming traffic, acting as a gateway that parses queries, builds distributed plans, and aggregates results. Each shard consists of a primary database with multiple replicas across different availability zones to ensure high availability. To handle traffic efficiently, Neki utilizes intelligent connection pooling via sidecars that monitor the actual capacity of each Postgres instance. Finally, a control plane manages the health of the entire system, coordinating tasks like failovers, schema changes, and data resharding.
Users manage the distribution of their data through a data topology, which is a JSON configuration that maps logical tables to physical shards using defined shard keys. This flexibility allows teams to start with a standard, non-sharded Postgres deployment and transition to a sharded model only when performance needs demand it. Because the platform treats these scaling operations as online, built-in workflows, users can perform tasks that would otherwise require significant downtime, such as schema updates or version upgrades, without taking their application offline.
In addition to its sharding capabilities, Neki provides users with access to established PlanetScale features like database Insights, automated schema recommendations, and branching workflows. This integrated approach is intended to provide a seamless transition for organizations that are outgrowing the constraints of a single machine but do not want to sacrifice the standard Postgres experience or manage the complexity of manual application-level sharding.
Neki is currently available in a platform preview, and while the company encourages users to explore its architecture and capabilities, they advise against running critical production workloads on it during this phase due to the likelihood of breaking changes. Prospective users are invited to sign into their PlanetScale accounts to opt into the preview and consult the documentation for further technical details on how to set up and configure their clusters.
153 comments • Comments Link
• Launch posts 应当立即阐明产品的核心价值和用途,以避免用户产生沮丧并提升可及性。
• 将 Neki 保持为私有软件的决定被视为一种战略必要,目的是防止 AWS 等云服务商将该技术商品化;这与 Google 因规模庞大而能够将 Vitess 开源形成鲜明对比。
• 公司领导层强硬的立场与对抗性的公开言论会疏远潜在用户,即便其底层技术被认为具有高质量或创新性。
• 对于评估像 Neki 这样的分布式系统的工程师来说,关于一致性保证、跨分片事务以及数据库约束处理的详尽技术文档至关重要。
• 将开源作为长期保障的需求,与小公司维护商业可行性的愿望之间存在明显张力。
• Neki 定位为从零开始实现的 Postgres,凭借团队在 Vitess 上的经验,提供竞争对手尚未具备或实现的在线分片重构等功能。
• 像交通广告这样的营销手段难以与技术内容的接受度直接比较,但清晰的信息传达仍是提升参与度的关键。
• 私有方案与开源方案的比较常常演变为围绕"防御性"私有许可的伦理问题与社区驱动基础设施优势的争论。
• 技术用户将关于架构权衡(尤其是 CAP theorem 限制)的透明文档视为采用新数据库技术的前提条件。
• 一些用户认为创业公司创始人对竞争对手采取激进行为会成为重要的威慑因素,无论产品本身有何优点。
围绕 Neki 发布的讨论折射出两者之间的巨大裂痕:一方面是对开放、可互操作基础设施的渴望,另一方面是初创公司为防止大型云厂商侵蚀其知识产权而不得不采取的商业保护需求。团队的技术背景虽然广受认可,但领导层对抗性的沟通风格常常掩盖产品本身,加剧了外界对公司动机和长期路线的怀疑。归根结底,潜在采用者仍然关注分片系统的技术权衡,并希望在目前被视为欠缺的初步文档中,看到关于一致性模型和架构保证的清晰说明。 • Launch posts should immediately clarify the core value proposition and purpose of the product to avoid user frustration and improve accessibility.
• The decision to keep Neki proprietary is framed as a strategic necessity to prevent cloud providers like AWS from commoditizing the technology, contrasting it with Google's ability to open-source Vitess due to its massive scale.
• Strong opinions and confrontational public discourse from company leadership can alienate potential users, even when the underlying technology is perceived as high-quality or innovative.
• Detailed technical documentation regarding consistency guarantees, cross-shard transactions, and handling of database constraints is essential for engineers evaluating distributed systems like Neki.
• There is a clear tension between the demand for open-source software as a safety measure for long-term planning and the desire of smaller companies to protect their commercial viability.
• Neki is positioned as a ground-up Postgres implementation, leveraging the team's historical experience with Vitess to provide features like online resharding that competitors currently lack or have not yet implemented.
• The effectiveness of marketing efforts, such as transit advertising, can be difficult to gauge against the reception of technical content, but clear messaging remains the most critical factor for engagement.
• Comparisons between proprietary and open-source alternatives often devolve into debates over the ethics of "defensive" proprietary licensing versus the benefits of community-driven infrastructure.
• Technical users prioritize transparent documentation of architectural trade-offs, particularly regarding CAP theorem constraints, as a prerequisite for adopting new database technologies.
• Some users view the aggressive posturing of startup founders toward competitors as a significant deterrent, regardless of the merits of the product being launched.
The conversation surrounding the launch of Neki reflects a significant divide between the desire for open, interoperable infrastructure and the business imperatives of startups trying to defend their intellectual property from larger cloud incumbents. While the technical pedigree of the team is widely respected, the confrontational communication style of the leadership often eclipses the product launch itself, fueling skepticism about the company's motives and long-term roadmap. Ultimately, potential adopters remain focused on the technical trade-offs of sharded systems, seeking clarity on consistency models and architectural guarantees that are currently perceived as lacking in the initial documentation.