This project showcases a sophisticated microservices architecture, utilizing Symfony PHP for each microservice, RabbitMQ as a dynamic message broker, and Redis for efficient caching. The architecture comprises two pivotal Symfony microservices: User & Event Microservice and Betting Microservice. RabbitMQ orchestrates asynchronous communication between these microservices, while Redis optimizes data retrieval speed, enhancing overall performance and mitigating database load.
-
User & Event Microservice:
- Manages user data and sports events using Symfony PHP.
- Publishes user-related events (e.g., customization) and sports events data.
- Leverages Redis for caching frequently accessed user data and sports events.
-
Betting Microservice:
- Handles betting-related data using Symfony PHP.
- Consumes user-related events and sports events data, then publishes betting data.
- Takes advantage of Redis for caching frequently accessed betting-related data.
-
RabbitMQ:
- Serves as a dynamic message broker between the User & Event Microservice and Betting Microservice.
- Facilitates seamless asynchronous communication.
-
Redis:
- Employs caching for frequently accessed data within the User & Event Microservice and Betting Microservice.
- Enhances data retrieval speed and reduces the load on databases.
+----------------------+ +----------------------+
| User & Event | | Betting |
| Microservice | | Microservice |
+-----------^----------+ +----------^-----------+
| |
| Publishes events, user data |
| |
v v
+---------------------+ +-----------------------------+
| Redis Cache | | Redis Cache |
| | | |
+---------------------+ +-----------------------------+
| |
| Caches user and sports events |
| data |
| |
+-----------+--------------------------------+------------------+
| RabbitMQ Message Queue |
+----------------------------------------------------------------+
|
| Consumes events, user data, and publishes betting data
|
+-----------v----------+ +-----------------------------+
| User Entity | | Bet & Trend Entity |
| Event Entity | | |
+---------------------+ +-----------------------------+
-
Clone the Repository:
git clone https://github.com/yourusername/your-repo.git
-
Install Dependencies:
- Navigate to each Symfony microservice directory and run:
composer install
- Navigate to each Symfony microservice directory and run:
-
Configure RabbitMQ and Redis:
- Update configuration files in each Symfony microservice to point to your RabbitMQ and Redis instances.
-
Run Microservices:
- Start each Symfony microservice:
php bin/console server:start
- Start each Symfony microservice:
- Adjust Symfony configuration files (config/packages/*.yaml) in each microservice to set environment-specific variables for RabbitMQ and Redis connections.
Contributions are welcome! Please follow our Contribution Guidelines.
This project is licensed under the MIT License.