The solution needs to be cost-effective, highly available, scalable and secure, how would you design a solution to meet the above requirements?
Setup an RDS MySQL instance in 2 availability zones to store the user preference data. Deploy a public facing application on a server in front of the database to manage security and access credentials
Setup a DynamoDB table with an item for each user having the necessary attributes to hold the user preferences. The mobile application will query the user preferences directly from the DynamoDB table. Utilize STS. Web Identity Federation, and DynamoDB Fine Grained Access Control to authenticate and authorize access.
Setup an RDS MySQL instance with multiple read replicas in 2 availability zones to store the user preference data .The mobile application will query the user preferences from the read replicas. Leverage the MySQL user management and access privilege system to manage security and access credentials.
Store the user preference data in S3 Setup a DynamoDB table with an item for each user and an item attribute pointing to the user’ S3 object. The mobile application will retrieve the S3 URL from DynamoDB and then access the S3 object directly utilize STS, Web identity Federation, and S3 ACLs to authenticate and authorize access.
Explanations:
Using RDS MySQL may not be the most cost-effective or scalable solution for a high number of users (5 million) with user preferences averaging 50KB each. RDS can also introduce complexity in terms of scaling and availability, and it may require significant management overhead.
DynamoDB is designed for scalability and high availability, making it a suitable choice for storing user preferences. It can handle the anticipated load efficiently and allows for fine-grained access control. This option also eliminates the need for managing infrastructure, enhancing cost-effectiveness.
While RDS with read replicas provides scalability, it is still more complex and potentially more costly than using DynamoDB. The overhead of managing a relational database may not be justified given the use case of storing user preferences.
This approach adds unnecessary complexity by using S3 for storing preference data, which is not ideal for structured data access. It requires additional management for accessing S3 objects and may introduce latency. DynamoDB alone would suffice for this scenario.