Patent attributes
Some embodiments provide a method for processing data messages through an overlay network for a cluster of application instances operating on machines located across several datacenters. The method receives a data message, from a first application instance of the cluster operating on a first machine in a first datacenter, destined to a second application instance. When the second application instance operates on a machine in a different, second datacenter, the method (i) encapsulates the data message according to an overlay network defined for the cluster and (ii) forwards the encapsulated data message to a publicly accessible machine of the second datacenter. Only a subset of the application instances operating in the second datacenter operate on publicly accessible machines. When the second application instance operates on a machine in the first datacenter, the method forwards the data message directly to the machine on which the second application instance operates.