I consider myself a very experienced node.js developer.
Yet I still wonder if there is a better way to write the following code so I don\'t get the pyramid of doom..
Consider rewriting your code to have less back-and-forth with the database. The rule of thumb I use to estimate an app's performance under heavy load is that every async call will add two seconds to the response (one for the request, and one for the reply).
For example, is there maybe a way you could offload this logic to the database? Or a way to "SELECT nextval('last_resource_bundle_string_id')"
at the same time as you "SELECT * FROM localization_strings WHERE local_id = 10 AND string_key = '" + key[0] + "'"
(perhaps a stored procedure)?