Graham Dumpleton
grahamd at dscpl.com.au
Tue Oct 4 22:39:50 EDT 2005
David Clarke wrote .. > On 10/5/05, Graham Dumpleton <grahamd at dscpl.com.au> wrote: > > > > David Clarke wrote .. > > > This might be a little out of left field. Say I wanted to use mod_python > > in > > > a mult-tier environment where I have a website that uses mod_python, > > some > > > business rules, and a database. I want to minimise the coupling between > > the > > > tiers, i.e. I don't want to make database calls directly from my web > > tier. > > > What is a good approach for doing this? What is a good mechanism for > > hosting > > > business rules? > > > > One way would be to embed all the business logic and database access > in > > a separate process which implements a XML-RPC server. The code written > > in mod_python can then use XML-RPC calls to access the backend server > to > > do the real work. One could also use a full messaging system to > > communicate between mod_python handlers and the backend rather than XML- > > RPC. This would possibly avoid the socket creation costs associated with > > individual XML-RPC calls. > > > > Graham > > > > Thanks Graham, I guess that makes sense and I probably should have thought > more about it before asking the question. Is this something people actually > do with mod_python? Presumably Python could be used to provide the business > logic in the middle tier as well. I'd be surprised if people aren't doing this. I personally use XML-RPC calls out of mod_python to multiple application instances running across about 120 sites. This though is purely for monitoring and control of some production systems for technical reasons and isn't relied upon by the business as such. One good point about using XML-RPC is that one has a large choice of languages one could use for the backend as a lot of languages have server side support for XML-RPC. Eg. Python, C, C++ Java, Perl etc etc. In my case the backend applications are written in C++, although if I had a chance to do it again, would use Python. :-) Graham
|