both patterns are often used concurrently. the same eai system could be keeping multiple applications in sync (mediation), while servicing requests from external users against these applications (federation).