4 ms·
Am I missing something or wouldn't this be much (much) more efficient to do in SQL with a single parameterized query?
by rladd 7y ago
Am I missing something or wouldn't this be much (much) more efficient to do in SQL with a single parameterized query?
- cafard 7y agoIf you are, so am I. From the description "like to render a summary of published posts, with the post title, author, number of times it’s been viewed, and a fun fact about that view count number" I don't even see why you'd need a parameter.
- lunias 7y agoJust gotta rethink the architecture so that it scales: this sounds like at least 3 separate APIs w/ at least 3 separate DBs should be stood up. This is of course because if the post-title service goes down then the customers can still access post-authors and post-data from their respective services. /sarcasm
- lunias 7y agoYeah... I dunno what this article is trying to teach me from a database interactions perspective. It's unclear whether the JavaScript is executing client side or server side. The final code block seems like a really inefficient implementation if not constrained to some existing API. I think this may be better refactored as a post about async / await and Promise.all().