3 ms·
Yes, it is. While I agree that databases could absolutely be improved to make streaming query results as described better, that isn't a limiting factor here IM
by Tostino 4y ago
Yes, it is.
While I agree that databases could absolutely be improved to make streaming query results as described better, that isn't a limiting factor here IMO.
I'd tackle that problem by batching my queries to the database into some logical batch size and send them as table valued parameters. If I had 10k phone numbers to check and minimum latency matters, why not batch into queries of 500-1000 values per-query? That cuts down time to first response, while reducing the network roundtrips.
The issue with taking this out of the database, is you lose consistency. I don't know about your industry, but I don't think mine would be terribly happy if I was using stale data to validate my Do Not Call/Email list. Now there are some situations where you can just update your list of numbers nightly/weekly/monthly, etc. If you don't need any concurrency or other guarentees, might as well save the time/resources on your DB server.
That's just not the world I have worked in.