Does TiDB have plans to support the PostgreSQL protocol?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB是否有计划支持PostgreSQL协议?

| username: Sean007

[Problem Scenario Involved]
A Stack Overflow survey in May 2023 showed that PostgreSQL has surpassed MySQL as the preferred database for developers, with 45.55% of respondents using PostgreSQL, compared to 41.09% for MySQL and 30.9% for SQLite.

[Expected Requirement Behavior]
TiDB supports the PostgreSQL protocol.

[Alternative Solutions for the Requirement]

[Background Information]

| username: tidb菜鸟一只 | Original post link

Uh, probably not. If you need a domestic database that supports the PostgreSQL protocol, you can use GaussDB or PolarDB.

| username: redgame | Original post link

Watching the trend, haha.

| username: ShawnYan | Original post link

Please refer to:

| username: Sean007 | Original post link

Although GaussDB or PolarDB support PG, the HTAP feature of TiDB supported by TiFlash is still unmatched by other databases :sunglasses:

| username: xfworld | Original post link

There has been TiDB supporting the PG protocol for a long time, but not many people have paid attention to it. If you have any needs, contact @hey-hoho for guidance. :upside_down_face:

| username: Sean007 | Original post link

Even if TiDB supports more computational factors than PG, if the syntax is incompatible, existing PG users will still face certain migration costs. Of course, whether to support PG or not depends on PingCAP’s overall strategy. Here is a comparison of features of mainstream distributed databases for reference.

| username: Sean007 | Original post link

Are you referring to this project? GitHub - DigitalChinaOpenSource/TiDB-for-PostgreSQL: PgSQL compatible on distributed database TiDB
It seems it hasn’t been updated for a long time.

| username: xfworld | Original post link

Yes, that’s it. If you have any needs, just contact hoho :upside_down_face: :upside_down_face: :upside_down_face: :upside_down_face:

| username: 托马斯滑板鞋 | Original post link

The time service of OB is actually also centralized TSO;
CockroachDB’s storage engine has been switched to a self-developed storage engine written in Go.

| username: Anna | Original post link

After implementing some of the expected features of TiDB for PostgreSQL, we have basically verified the feasibility of the direction. However, there is still a lot of work to be done in the future. Even though there are various open-source distributed databases available now, we still believe that TiDB for PostgreSQL is a very good idea. Therefore, after implementing the basic protocol and completing the Sysbench test, we are also very eager to have the community’s support to verify the current test results and discuss the technical aspects and requirements of this project direction together. Embracing open source has always been our persistent effort. Since the end of 2020, we have been integrating into the TiDB ecosystem community and providing continuous support to the community. Not only do we contribute code to TiDB on GitHub, but we also solve related problems on platforms like asktug, showcasing our capabilities in TiDB development and implementation.

| username: Anna | Original post link

PostgreSQL

Refer to this: 专栏 - 【优质技术文章推荐】TiDB for PostgreSQL—牛刀小试 | TiDB 社区

| username: Sean007 | Original post link

Thank you for the correction. Strictly speaking, OB should be considered a centralized structure. However, OB’s GTS is tenant-level, and it uses an OBServer integrated storage-compute architecture, which is more distributed compared to TiDB’s independent PD architecture. Additionally, OB only takes a timestamp at transaction commit, whereas TiDB takes timestamps twice, at the beginning and at the commit of the transaction.

| username: zhanggame1 | Original post link

Although Stack Overflow shows that PostgreSQL is used more, it is still rarely used in China. It is estimated that its popularity in China would need to reach the level of MySQL before it gets support.

| username: Sean007 | Original post link

Our TiDB is an international open-source product :sunglasses:

| username: 南征北战 | Original post link

In China, it would be better to be like OceanBase and be compatible with multiple Oracle versions. Many systems in the financial industry are based on Oracle as the underlying database. Currently, OceanBase is almost monopolizing this field (even though it is very poor, lacks many features, and is not suitable for many business scenarios, it is compatible with Oracle).

| username: Sean007 | Original post link

If you want to gain a share in the information technology innovation industry, compatibility with Oracle would be a huge advantage. GaussDB is also compatible with Oracle, but it may not be as highly compatible as OB.

| username: Mickyun | Original post link

I have to say, for central state-owned enterprises, going O is now a top priority, so Huawei GaussDB, Tencent Tbase, and Alibaba PolarDB are among the candidates.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.