Friday, February 18, 2011

Read Scalability with PostgreSQL/EnterpriseDB

Read Scalability with Slony and EnterpriseDB/PostgreSQL
   One of the startups which I consult started to grow leaps and bounds which challenged me to achieve Read Scalability. As a general wisdom Read Scalability with PostgreSQL/EnterpriseDB can be achieved through various techniques like partioning, sharding, replication etc. Based on our existing infrastructure, we achieved the scalability through Slony and EnterpriseDB from the current vertically scaled Database Master.
The interesting snippets in our setup is Slony communication across different data centers using private vpn tunnel and also stunnel setup between hosts involved in replication cluster for improved security. Morever since Master and Slaves were in different data centers, communication between them was impossible in few cases due to Network Security requirements thereby forcing us to create multiple clusters for replication. Maintenance with multiple slony clusters becomes little trickier when we have schema changes and unsusbscription/subscription of sets which is reserved for another blog post. The below architecture diagram shows our slony setup in more detail.

Cluster Creation Code

No comments:

Post a Comment