Assignment Title: Backend Engineering Challenge
Introduction: In this assignment, you will build a microservices-based system that manages a simple e-commerce application. The system should handle user authentication, product management, and order processing. Emphasis will be placed on implementing concurrency control and ensuring the system can handle clustering for high availability.
Requirements:
-
Microservices Architecture:
- Design a microservices architecture for the system, breaking it down into services for user authentication, product management, and order processing.
- Use a technology stack suitable for building and managing microservices (e.g., Spring Boot, Node.js with Express, Flask, etc.).
-
Concurrency Control:
- Implement concurrent access control for the product management service. Ensure that multiple users can safely read and update product information without conflicts.
- Choose a suitable method for managing concurrent access (e.g., optimistic locking, pessimistic locking, or another approach).
-
Clustering and High Availability:
- Set up a clustering mechanism for your microservices to ensure high availability. Use a technology or framework suitable for your chosen programming language.
- Deploy the system on multiple nodes or containers, and demonstrate that the system remains available even if one node/container goes down.
-
Database Integration:
- Utilize a database (e.g., PostgreSQL, MySQL, MongoDB) for storing user information, product data, and order history. Design the database schema for these entities.
- Implement database connections and appropriate queries within your microservices.
-
APIs and Communication:
- Develop RESTful APIs for each microservice, allowing them to communicate with each other.
- Implement endpoints for user registration, product CRUD, and order management.
- Ensure that microservices can make synchronous or asynchronous calls to other microservices as needed.
-
Authentication and Authorization:
- Implement user authentication and authorization for accessing protected endpoints.
- Ensure that users can only access their own orders and the products they are authorized to view/update.
General Requirements:
-
Code Quality: Write clean, well-documented, and maintainable code. Follow best practices for the chosen programming language and framework.
-
Version Control: Use a version control system (e.g., Git) to track changes in your code and provide a Git repository for the assessment.
-
Error Handling: Implement comprehensive error handling and logging for the microservices.
-
Testing: Write unit tests for critical components, including concurrency control mechanisms.
-
Deployment: Provide clear instructions for deploying and running your microservices on a local development environment or a cloud platform (e.g., AWS, Azure, Google Cloud).
Bonus Features (Optional):
- Implement API rate limiting to prevent abuse.
- Use message queues for asynchronous communication between microservices.
- Implement caching strategies to improve system performance.
- Create monitoring and alerting solutions for the microservices (e.g., Prometheus and Grafana).
Submission:
- Provide a link to your version-controlled repository (e.g., GitHub, GitLab).
- Include clear instructions on how to set up and run your microservices.
- Share any additional documentation or notes that might help reviewers understand your project.
Assessment Criteria:
Your assignment will be evaluated based on:
-
Microservices Architecture: Is the system structured as microservices and are they correctly divided by functionality?
-
Concurrency Control: Is concurrent access controlled effectively, and is data integrity maintained?
-
Clustering: Does the system demonstrate high availability and clustering capabilities?
-
Code Quality: Is the code clean, well-documented, and maintainable?
-
Testing: Are there unit tests for critical components and concurrency control mechanisms?
-
Bonus Features: If implemented, do they enhance system functionality and performance?
This assignment will assess your backend engineering skills, especially in microservices, concurrency control, and high availability. Good luck!
P.S. Any assumptions taken while design / implementation should be documented in README file