the future of postgres sharding
play

The Future of Postgres Sharding This presentaon will cover the - PowerPoint PPT Presentation

, The Future of Postgres Sharding This presentaon will cover the advantages of sharding and future Postgres sharding implementaon requirements. Creave Commons Aribuon License hp://momjian.us/presentaons Last updated:


  1. , The Future of Postgres Sharding This presenta�on will cover the advantages of sharding and future Postgres sharding implementa�on requirements. Crea�ve Commons A�ribu�on License h�p://momjian.us/presenta�ons Last updated: August, 2019 B���� M������, A�������� K������� 2019 October 17 B���� M������, A�������� K������� The Future of Postgres Sharding 1 / 39

  2. , Outline 1. Scaling 2. Ver�cal scaling op�ons 3. Non-sharding horizontal scaling 4. Exis�ng sharding op�ons 5. Built-in sharding accomplishments 6. Future sharding requirements B���� M������, A�������� K������� The Future of Postgres Sharding 2 / 39

  3. , 1. Scaling Database scaling is the ability to increase database throughput by u�lizing addi�onal resources such as I/O, memory, ���, or addi�onal computers. However, the high concurrency and write requirements of database servers make scaling a challenge. Some�mes scaling is only possible with mul�ple sessions, while other op�ons require data model adjustments or server configura�on changes. Postgres Scaling Opportuni�es http://momjian.us/main/presentations/overview.html#scaling B���� M������, A�������� K������� The Future of Postgres Sharding 3 / 39

  4. , 2. Ver�cal Scaling Ver�cal scaling can improve performance on a single server by: ▶ Increasing I/O with ▶ faster storage ▶ tablespaces on storage devices ▶ striping (���� 0) across storage devices ▶ Moving ��� to separate storage ▶ Adding memory to reduce read I/O requirements ▶ Adding more and faster ���s B���� M������, A�������� K������� The Future of Postgres Sharding 4 / 39

  5. , 3. Non-Sharding Horizontal Scaling Non-sharding horizontal scaling op�ons include: ▶ Read scaling using Pgpool and streaming replica�on ▶ C��/memory scaling with asynchronous mul�-master The en�re data set is stored on each server. B���� M������, A�������� K������� The Future of Postgres Sharding 5 / 39

  6. , Pgpool II With Streaming Replica�on Streaming replica�on avoids the problem of non-determinis�c queries producing different results � � � � pgpool ���� ���� � � � � on different hosts. ���� ���� � � � � ���� ���� � � � � ���� ���� � � � � ���� ���� � � � � � � � � � � � � INSERT, UPDATE, � � � � SELECT ����� ����� ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � DELETE to master to any host ����� ����� � � � � ����� ����� � � � � host ���� ���� � � � � ���� ���� � � � � ���� ���� � � � � ���� ���� � � � � streaming ���� ���� � � � � ���� ���� � � � � � � � � � � � � � � � � � � � � � � � � � � � � ���� ���� ���� ���� ���� ���� � � � � � � � � � � � � ���� ���� ���� ���� ���� ���� � � � � � � � � � � � � ���� ���� replication ���� ���� ���� ���� � � � � � � � � � � � � � � � � � � � � � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � � � � � � � � � � � � � ����� ����� ����� ����� ����� ����� ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � ����� ����� � � � � Master Slave Slave replication B���� M������, A�������� K������� The Future of Postgres Sharding 6 / 39

  7. , Why Use Sharding? ▶ Only sharding can reduce I/O, by spli�ng data across servers ▶ Sharding benefits are only possible with a shardable workload ▶ The shard key should be one that evenly spreads the data ▶ Changing the sharding layout can cause down�me ▶ Addi�onal hosts reduce reliability; addi�onal standby servers might be required B���� M������, A�������� K������� The Future of Postgres Sharding 7 / 39

  8. , Typical Sharding Criteria ▶ List ▶ Range ▶ Hash B���� M������, A�������� K������� The Future of Postgres Sharding 8 / 39

  9. , 4. Exis�ng Sharding Solu�ons ▶ Applica�on-based sharding ▶ PL/Proxy ▶ Postgres-XC/XL ▶ Citus ▶ Hadoop The data set is sharded (striped) across servers. B���� M������, A�������� K������� The Future of Postgres Sharding 9 / 39

  10. 5. Built-in Sharding Accomplishments: Sharding Using Foreign Data Wrappers (���) , SQL Queries PG FDW SQL Queries ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ Foreign Server Foreign Server Foreign Server ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ ������������������������ ������������������������ ����������������������� ����������������������� ������������������������ ������������������������ https://wiki.postgresql.org/wiki/Built-in_Sharding B���� M������, A�������� K������� The Future of Postgres Sharding 10 / 39

  11. , F�� Sort/Join/Aggregate Pushdown SQL Queries PG FDW joins (9.6) aggregates (11) sorts (9.6) Foreign Server Foreign Server Foreign Server B���� M������, A�������� K������� The Future of Postgres Sharding 11 / 39

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend