Brent,
I’m curious to understand this situation more deeply. Which RPC methods have serious problems? And what are the “multiple models” that we’re querying? Have you run a query logger?
My intuition is basically your first option, though I wouldn’t necessarily call it “preloading”, so I could be misunderstanding what you’re describing. I’ve seen pref problems when using ORMs in lots of cases. And I would imagine that we’d be able to improve our querying by not leaning on Django’s ORM magic as heavily. I’ve done this sort of optimization work before, with good success. But it’s hard for me to tell if that’s the case here without seeing the details up closer.
I’d be keen to hop on a call on poke around on a pairing session sometime to brainstorm further.
Hmmm interesting, if these performance issues are in fact limited to the “connect database” flow, then I’d be inclined to not even worry about it unless a user complains directly to us. Let’s say it takes 10 seconds to connect a new database. I’m not sure that would actually even be a problem worth solving at this point because (as it see it) it’s just so far from the “hot path” of typical usage that I’d expect.