Somehow, people use to consider just three ways of inter-process communication:
- web services (that come in many styles and flavors)
- file transfer
- database sharing (yuck!)
Undoubtedly you can cover pretty much every business scenario using those approaches only, but:
- Connecting applications with web services (peer-to-peer paradigm) makes them tightly coupled. That’s ok if we’re speaking about 2,3,5 applications, but what if you have 10 or more? Would you be able to plan application maintenance with all those dependencies? And are you sure your every app is able to handle unavailability of services it depends on? What if your applications depends on application that depends on another application that is not available? Are you able to point out the consequences?
- File transfer may be fine as DB extract handling mechanism if you have to deal with 2,3,5 large files, but if you’re about to send hundreds / thousands of files in usual transactional activities will you be able to monitor and control the traffic? Do you trust the file systems on your machines so that there won’t be any lock / filename colliding?
- Database sharing is an obvious fail in 95% of cases. It causes problems with DDL database maintenance, it reduces maintainability as it’s harder to detach applications linked by shared database. It may also cause some problems with locking (especially if both applications do write to the same tables) - in general, you may experience a lot of problems with synchronization between your applications.
What’s the solution then? What are we looking for? Basically, we’re looking for something that would provide:
- Asynchronous communication that won’t fail even if receiving node is not present when message is being sent
- Transaction support (ACID model)
- Technology agnosticism
- Simple configuration without sacrificing security model quality
Yes, that’s going to be MOM - Message Oriented Middleware, the foundation of ESB (Enterprise Service Bus). It guarantees all the points for list above, but this value comes for a price:
- Designing (and developing) applications that communicate in asynchronous way is usually way harder.
- If you want to do it in really decoupled, SOA way, you should make an effort on preparing message formats suited for true business needs, not for your actual applications (and it’s hard and may cost a lot).
- You’ll need MOM technology (low-level communication protocol) and most likely also some kind of message broker.
More on MOM:
MOM in general - http://en.wikipedia.org/wiki/Message-oriented_middleware
MSMQ as Microsoft’s approach to MOM - http://msdn.microsoft.com/en-us/library/windows/desktop/ms711472(v=vs.85).aspx
ActiveMQ (well respected open-source MOM) - http://activemq.apache.org/