0

I have just set up a slony replication set up between 2 postgres servers. One master, and one slave host. Data is being copied. We don't want to use this for data backup or anything, but want to do some computationally intensive calculations on the slave.

Is it possible/OK if we were to create an index on a table on the slave database which does not exist on the master database? We won't add any data to the slave, we merely want to be able to run certain queries faster on the slave.

Will this break the slony replication? Will this bite us in the bum later?

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246

1 Answers1

1

Slony is trigger based, and highly configurable. Yes - according to the documentation here .

DDL changes can be applied directly on a node through an application such as psql. The DDL changes will not be replicated by Slony-I and therefore must be manually applied to every relevant node. The following points should be kept in mind when applying DDL changes directly.

Regarding pros/cons. Our team was facing the same kind of problems (clustering solution for High Availability, IOPS off load) a while ago and after investigating/testing a few of them we ended up with just Streaming Replication. - Simple to setup/maintain, read-off loading on relicas.

Multi-tenancy (Slony cannot split postgres schemas across different nodes), heavy usage of triggers in our application backend, indexes with extensions (cube, pg_trgm, cube, earthdistance and frequent DDL changes made it impossible to use Slony for us. In other words - you should understand your application and goals in order to choose right solution.

For sharding data - PostgresXL is definitely worth attention.We also tried it! but it didn't work out for us as it does not support all types of indexes we are using :(

Dmitry S
  • 231
  • 3
  • 6