One of the most complex modules we built was one that integrated with the SalesForce CRM system. The goal behind this was to sync certain SalesForce objects with Drupal objects. For example, SalesForce Accounts were equivalent to a node type in Drupal. When one was created on either system, a notification was sent to the other via a SOAP interface to create its companion in the other system. The same relationship existed between Contacts and users etc.
One of the biggest challenges here was to keep the data valid as the SalesForce system had different data validation algorithms than Drupal and thus data entered from one side may not validate on the other. A number of security failsafes and content entry protocols were put in place to help prevent this.
A unique feature that we incorporated was integrating the permissions system into certain SalesForce data when rendered in Drupal. Contacts who belonged to certain Accounts in SalesForce were subsequently allowed to access certain content on the Drupal site that others weren't. Because the data could change on the SalesForce side quickly and timely, the website needed to be as accurate as possible.
Another important issue was server speed. Because there were so many calls back and forth between the website and SalesForce, we needed to integrate a local management system that would later sync the data to SalesForce only when certain updates were performed. This prevented consistet data fetching from an external source.