I don't know .net and sometimes quite some janky code, but I think in this case I would preload everything I definitely needed, locking the records I'm modifying. Then use ConcurrentDictionary.GetOrAdd(Tkey,Func<...>) to load values I might need only when they're needed.
pohart
What language are you using? Is a good idea to limit db calls, but maybe we can help with specific techniques idiomatic to your language
You're right that this could introduce regressions, but it sounds like it's making more testable.
My biggest concern would be introducing db contention with locks being held for too long, and introducing race conditions because the cached data isn't locking the records when they're cached.
Edit: your->you're
Regardless of what pattern it is, you have a clear performance need and a testable implementation. That's a win.
Beyond looking for a pattern, I'd look at what your doing to make sure you're not loading a ton of extra dependencies of your know you won't use them.
Also, you generally want a database transacting to be one logical unit of work, that all commits or all rolls back together, if you're combining multiple transactions is likely what you want, but be aware that you might be holding locks for longer, so you might be introducing contention.
By the same token, make sure you've got records locked if you need them locked. If you had atomic updates before, or your first update locked the records you needed, you may need to lock records explicitly to keep your database consistent.
Six figure tech job here. I no longer feel like I can afford Applebee's, idk about olive garden because the food is gross. Certainly can't afford drinks and dinner.
Yeah, and the answer is quite a bit for some cases.
How much could performance even improve?
Right. I don't think the Palestinian government has the propaganda resources to match the combined Israeli and US governments.
When the October 7 attack happened my teenagers noticed the one sided media and hamfisted pro Israel propaganda asked what's really going on. Today's kids are getting constant propaganda and advertising. They're not immune but they recognize it and bristle.
When I was a teenager and Yitzhak Rabin was murdered i bought the anti palastine rhetoric that followed for an embarrassingly long time. And we knew that it was Netanyahu. Well, I don't think we knew until later that he was aware that night of what he was doing. But we knew it was his follower who pulled the trigger.
I'm skeptical that hamas has the resources to spread much misinformation to us. This doesn't feel like a "both sides" time.
I wrote myself an app that was very useful to me personally. I knew zero others who might be interested but was able to publish it. At its peek there were 100 users. It was relevant for just under two years and is now gone. That was super successful and useful for the people who used it. I would have had no way to get it to anyone but me had this policy been in place.
Edit: I don't even know 20 Android users. Maybe 5. Everyone uses iPhones.
It does.