Postgres的pgpool

编程入门 行业动态 更新时间:2024-10-23 02:53:01
Postgres的pgpool-II - 这是我需要的吗?(pgpool-II for Postgres - Is it what I need?)

我在寻找群集我的Postgres数据库时偶然发现了pgpool-II(只是准备在几个月内部署一个Web应用程序)。 我仍然兴奋地摇晃着,但我很紧张,因为每当我找到这样优秀的东西时,我很快就会失望。 你有没有pgpool-II的经验,它会帮助我在多个虚拟机中运行我的数据库,以及后来在多个物理服务器中运行吗? 我需要备份,负载平衡,并为我的数据库服务器提供更高的可用性!?

另外,使用并行查询功能是否容易(例如,在Django中或通过Pythons psycopg2)? 这对于提供报告和聚合非常有用!

最后一件事:它似乎在Postgres和psycopg2之间起作用。 这是对它的正确理解,所以我可以像平常一样使用psycopg2,而不考虑pgpool-II?

I just stumbled upon pgpool-II in my search for clustering my Postgres DB (just getting ready to deploy a web app in a couple months). I still have the shakes from excitement, but I'm nervous, as each time I find something this excellent I am soon let down. Have you any experience with pgpool-II, and will it help me run my database in multiple VMs, and later in multiple physical servers altogether? Is it all I need for backing up, load balancing, and providing a higher availability for my DB server!?

Also, is it easy to use the parallel query function (for instance, in Django or through Pythons psycopg2)? This would be most excellent for providing reporting and aggregation!

One last thing: It seems to work between Postgres and psycopg2. Is this a correct understanding of it, so I can use psycopg2 the same as normal, without regard for pgpool-II?

最满意答案

pgpool-II可以正常工作。 它以您期望的方式适合您的应用程序和数据库; 只需将psycopg2指向它而不是直接在数据库中,然后离开。

您必须注意的主要事项是,虽然它支持许多不同类型的功能 - 复制,负载平衡,并行查询 - 但您不能一次性使用它们。 听起来你可能会觉得你可以做到这一点,并且它不会那样工作。 关于这个主题的文件并不是那么清楚(至少英文版,我不能说原文日文版)。

例如,如果您在“主/从”模式下运行pgpool-II,以便它支持用于扩展读取的负载平衡,则必须使用另一个程序来实际执行这些节点之间的复制。 在早期的PostgreSQL版本中,Slony是支持的复制解决方案,从pgpool-II 3.0和PostgreSQL 9.0开始,你也可以使用即将发布的新版本的Streaming Replication / Hot Standby功能。

pgpool-II是一个有用的组件,您可以通过许多有趣的方式使用它,但我怀疑它是“您需要的”,以满足您希望用它实现的每个要求。

pgpool-II works fine for what it claims to do. And it fits between your application and the database the way you expect it to; just point psycopg2 toward it instead of directly at the database and off you go.

The main thing you have to note is that while it supports many different types of features--replication, load balancing, parallel query--you can't use them all at once. It sounds like you may be under the impression you can do that, and it doesn't work that way. The documentation is not all that clear on this subject (the English version at least, I can't speak to the original Japanese one).

For example, if you run pgpool-II in its "Master/Slave" mode, so that it supports load-balancing for scaling reads, you have to use another program to actually do the replication between those nodes. Slony was the supported replication solution to put underneath of there in earlier PostgreSQL versions, as of pgpool-II 3.0 and PostgreSQL 9.0 you can also use the soon to be released Streaming Replication/Hot Standby features of that new version as well.

pgpool-II is a useful component and you can use it in a lot of interesting ways, but I doubt it will be "all you need" for every requirement you hope to achieve with it.

更多推荐

本文发布于:2023-07-05 06:55:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Postgres   pgpool

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!