0

I want to do sharding in postgresql without using citus plugin.

can anybody suggest how to do ?

cmh
  • 5
  • 2
kumar
  • 441
  • 4
  • 9
  • Sharding can be implemented natively using foreign tables. –  Oct 11 '17 at 06:05
  • Or use logical replication with Postgres 10: https://www.postgresql.org/docs/current/static/logical-replication.html –  Oct 11 '17 at 08:32

1 Answers1

1

Postgresql 10 actually added support for native partitioning, but that was released less than a week ago. Have a look here for some examples of SQL syntax for usage:

https://postgrespro.co.il/blog/whats-new-in-postgresql-10-part-2-native-partitioning/

P Ackerman
  • 2,266
  • 20
  • 24
  • Sharding is a type of partitioning. – P Ackerman Oct 11 '17 at 06:05
  • Thanks..it gives me lot of idea. However i want to do sharding (Multiple Server).I mean i am gonna create 3 read replica of server and there i want Sharding. – kumar Oct 11 '17 at 07:44
  • @kumar: replicas contain _exactly_ the same data as the master - sharding typically means you have _different_ data on each server (e.g. each server contains only the data for the country its in) - so there isn't one server that would contain **all** the data. Read replicas and sharding are two very different concepts. What **exactly** are you trying to achieve? If you just want to distribute the load of read access all you need are [hot standby](https://www.postgresql.org/docs/current/static/hot-standby.html) server combined with e.g. pgpool to distribute the requests –  Oct 11 '17 at 08:35
  • ya, basically i am intended to distribute load to improve performance of services. – kumar Oct 11 '17 at 12:05