That's one mother of a question and requires a great deal more technical savvy than most people here would have.
Simple answer: middle ware. Unfortunately, that's all we have right now.
http://i14.photobucket.com/albums/a324/Arkives/Disccopy.jpg%5B/IMG%5D">http://i14.photobucket.com/albums/a324/Arkives/Disccopy.jpg%5B/IMG%5D">