Given that we are using the .NET managed code libraries from the SDK, any disaster recovery scenarios for Dynamics 365 online are handled by the SDK. If the primary site fails and the failover site become primary, the libraries take care of the switch without any additional coding . This is not the case when using other connection means and other languages (Java). This MSDN article describes the different scenarios: https://msdn.microsoft.com/en-nz/library/hh771583.aspx.