We run an application more like competition organizing websites like HackerEarth.com, HackerRank.com. When the tasks start, we see huge load on our server. The problem is, we need to interact with Postgres heavily in order to give random questions and then submitting their answers. There are JOINS between multiple tables and searching and other things, which results in a lot of data traffic and it makes our system slow and unresponsive many times, which is embarrassing.
What can we do in order to make it better? How to handle things which interacts a lot with RDBMS, any caching or in-memory database usage. I searched a lot over various sources, but couldn't find concrete solutions for our needs. How companies organise database and user interactions? What are some good architectures for models like these? Any insight would be helpful.