WSO2 API Manager Multi Data Center Deployment — Deployment Synchronization

Read this article for details on WSO2 API Manager Multi Data Center Deployment. In this post, we will discuss different ways of achieving deployment synchronization in such multi data center deployment.

There are three ways of configuring deployment synchronization in multi data center API Manager deployment.

Pattern-1

  • Every DC will have its local SVN repository.
  • Master DC will have read-write access to SVN repository. Slave DCs will have read only access to SVN repositories.
  • Master DC will have privileged Gateway Manager who can checkin artifacts to its local SVN repository.
  • API publishing happens only from master DC (i.e, API Publisher will be deployed only in master DC).
  • Slave DCs’ SVN repositories will be synced with master DC’s SVN repository (uni-directional SVN replication).
  • There is a no cluster message broadcasted across DCs.
  • Gateways in slave DCs will eventually checkout the artifacts from their local SVN repositories by periodic polling. This polling will be triggered in random intervals from 5 min to 15 min. So in worst case it will take 15 min to checkout the artifacts. Its not recommended to reduce the max interval (15 min) as we have seen CPU spike issues in some deployment.
  • Syncing time = SVN replication time + polling interval (15 min in worst case) + SVN checkout time

Pattern-2

  • Every DC will have its local read-write SVN repository.
  • SVN repositories will not be synced.
  • Master DC will have privileged Gateway Manager who can checkin artifacts to its local SVN repository.
  • API publishing happens only from master DC (i.e, API Publisher will be deployed only in master DC).
  • Slave DCs’ Gateway Manager’s file system (deployment folders) will be synced with master DC’s Gateway Manager’s file system using tools like rsync.
  • Once the slave DC’s Gateway Manager gets synced, it will checkin the artifacts to its local SVN repository and send a cluster message to Gateway Workers.
  • Once Gateway Workers get cluster message from Manager, they will checkout artifacts from SVN repository.
  • Syncing time = rsync time + SVN checkin time (by manager) + cluster messaging time (negligible) + SVN checkout time (by worker)

Pattern-3

  • No SVN repositories used.
  • No Gateway Manager used in slave DCs.
  • API publishing happens only from master DC (i.e, API Publisher will be deployed only in master DC).
  • Every Gateways’ file system (deployment folders) will be synced with master DC’s Gateway Manager’s file system using tools like rsync.
  • Syncing time = rsync time

Pattern-2 is faster than Pattern-1 where as Pattern-3 is way faster than other two Patterns. You can choose one depending on your syncing time requirements and tools availability.