> Has anyone done such a thing before? No doubt.
> Can someone point me to docs or > modules which could help doing this? Perhaps raw sockets might be a consideration. However, Apache is great middleware, so I tend to use it in cases like this. You might want to use a session-based approach between the db-Apache and the app-Apache. The db-Apache would cache the connections to the legacy DB returning sessions the app-Apache which would cache them as well. You'd get the performance of cached DB connections without having to ensure the HTTP connections remain alive across app-Apache queries. When a session times out on the db-Apache tier, just rollback (assuming your DB is transactional) and put it in the free pool for new sessions. > Or is this whole idea maybe just > plain stupid? I don't think so. I assume the DB connection cost is high (on the order of seconds) iwc you need some way to cache connections. > Are there obvious caveats I haven't thought of? Garbage collection is an issue. How do you know when to timeout (rollback) queries on db-Apache? Are the queries "atomic" to app-Apache, i.e. within a single end-user HTTP request or do they span multiple end-user requests? (This latter a good idea, imo.) mfg, Rob