I have mobile app with backend server running in nodejs with cassandra as database. The app is like social network where you can share pictures and follow other people. Some operation like updating username, the nodejs runs select query to find all pictures shared by user and updates the username there and some other tables wherever username is present and then finally returns.
Sometimes it ends up updating 5-10k records and takes around 15-20 secs. I tried running those updates on different tables in parallel fashion using async library, could not get significant improvements. How to handles this scenario where client app shouldn't have to wait for that long? Also how does facebook handles this kind of scenario?