Note: This is not for unit testing or integration testing. This is for when the application is running.
I am working on a system which communicates to multiple back end systems, which can be grouped into three types
- Relational database
- SOAP or WCF service
- File system (network share)
Due to the environment this will run in, there are no guarantees that any of those will be available at run time. In fact some of them seem pretty brittle and go down multiple times a day :(
The thinking is to have a small bit of test code which runs before the actual code. If there is a problem then persist the request and poll until the target system until it is available. Tests could possibly be rerun within the code to check it is still available at logical points. The ultimate goal is to have a very stable system, regardless of the stability (or lack thereof) of the systems it communicates to.
My questions around this design are:
- Are there major issues with it? (small things like the fact it may fail between the test completing and the code running are understandable)
- Are there better ways to implement this sort of design?
- Would using traditional exception handling and/or transactions be better?
Updates
- The system needs to talk to the back end systems in a coordinated way.
- The system is very async in nature so using things like queuing technologies is fine.
- The system must run even if one or more backend systems are down as others may be up and processing of some information is possible.