I work as a junior backend developer for a product that has about 100.000 users on average per month. Our senior backend developer suddenly quit and now I'm on my own with still a lot to learn. Hence this beginner's question.
We have a Symfony 3 application connected to a MySQL database (hosted on AWS RDS) using Doctrine and Sonata Admin bundles, running on about 2-4 AWS EC2 instances. Most requests we need to handle are GET requests which return the same data for every user, thus very cacheable, which is why we can serve a large number of users with only 2-4 EC2 instances.
Now I have been tasked with creating a very lightweight "analytics" system, that stores some data for each user every time they use the application. Meaning a POST request that writes to the database for each user every time they use the app.
We sometimes have 20.000 concurrent users in the application. How can I achieve this without our EC2 autoscaling blowing up, or blocking the database? This user data is not time sensitive, so it doesn't have to be written to the database right away. A delay of up to an hour or so is acceptable.
Thank you.
