🎓 E-Learning API - From Strategy to Practice: A Blueprint for Designing a Scalable and Robust System
This project is an E-Learning API built as a microservices architecture. The project considers aspects like maintainability, evolvability, and scalability, providing a blueprint to a real-world application.
The API allows users to interact with various media types and receive recommendations based on a scoring system. All the operations related to media, ratings, and recommendations are handled by individual microservices. Detailed research underpinning this project can be found at this link research paper.
📘 Contents
📚 Project Structure
The project is structured as a microservice API. There are several folders containing various components of the project:
- 0-DBScripts: Scripts for creating your own database.
- 1-Tools: Batch files for starting the servers and analyzing all the microservices.
- 2-Configs: Configuration files to set up your own Logstash & Prometheus servers and a dashboard for Grafana (Dashboard).
- Test Data & Demo Scripts: The last two folders contain some test data and batch files to demo the app.
💼 Strategies
Several strategies were implemented in this project, each with a specific purpose:
- Architectural Styles: I used REST because of its simplicity, wide acceptance, compatibility with HTTP, and compatibility with many frameworks.
- Architectural Patterns: The project uses a microservices architecture for scalability, flexibility, and modularity.
- Database Design: The database design follows classic principles like ACID, CAP theorem, and normalization.
- Web Security: Input validation and sanitization, cookies restrains, JPA to prevent SQL injection, and session timeouts for session hijacking.
- Stateless: Each request contains all the information necessary for the server.
- Loose Coupling: Microservices can operate independently without significantly impacting others.
- Evolvability: Easy to modify or add new features without affecting other parts of the system.
- Resilience & Mitigation: Circuit Breaker, Retry, Rate Limiter, and Time Limiter are used for resilience. Shifting load, caching, and scheduling are used for mitigation.
More details on each strategy can be found in the research paper.
🏛️ Architecture
The system is comprised of several microservices, each with a specific role:
- Media Service: Handles all operations related to media. Utilizes five types of DTOs: media, audio document, image, and video.
- Rating Service: Handles all rating operations.
- Recommendation Service: Provides different media recommendations based on a scoring mechanism.
- Notification Microservice: Sends notifications to the system administrator in different situations.
- Discovery Server: Naming registry
- Load Balancer: Manages workload
- Observability: Slf4j, ELK stack, Actuator, Prometheus, Grafana
- Zipkin Server: Collects and looks up data from interconnected systems
- Redis Server: Caching
- Starter Library: Extracts all the common objects and functionality
- Jenkins Server: Clean, build, and test if there are any commits
- SonarQube Server Analizes the quality of the project
- Swagger Server Testing and Documentation
🚀 Getting Started
Prerequisites
- Postgres & all the servers mentioned in the arhitecture
- Java 8 or higher
- Any Java-supported IDE or text editor
Usage
Each microservice is standalone, and you can run them independently.
📜 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
📮 Contact
- GitHub @EmanuelButoiGit
- LinkedIn Emanuel-Sebastian Butoi
Keep coding and improving! 🚀