goodsKill  by techa03

Microservice project for simulating flash sales, integrating AI

created 8 years ago
2,226 stars

Top 20.8% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a simulated microservices framework for high-concurrency scenarios like flash sales, targeting backend developers and students. It integrates various popular technologies to demonstrate robust distributed system design and offers multiple flash sale implementation strategies for learning.

How It Works

The system is built on Spring Cloud 2023.x and Dubbo 3.x, utilizing Nacos for service discovery and configuration. It employs Sharding-JDBC for database sharding and Seata for distributed transactions. Flash sale logic is implemented using various concurrency control mechanisms, including synchronized locks, Redisson, Kafka, and database atomic updates, with state management handled by Spring Statemachine. Spring AI is integrated for AI-driven simulation.

Quick Start & Requirements

  • Install: mvn clean install or mvn clean install -DskipTests.
  • Prerequisites: JDK 21, Docker (for provided docker-compose.yml). Requires Nacos, Redis, MySQL, Kafka, RabbitMQ, ZooKeeper, Elasticsearch, MinIO, and Seata.
  • Setup: Follow instructions to initialize MySQL database and configure Nacos. Run SampleWebApplication for the flash sale simulation API.
  • Docs: OpenAPI, Spring Boot Admin

Highlighted Details

  • Demonstrates 10 different flash sale concurrency strategies.
  • Integrates Spring AI for AI-powered simulation interactions.
  • Features database sharding (Sharding-JDBC) and distributed transactions (Seata).
  • Includes Spring Cloud Gateway for unified API access and Spring Boot Admin for monitoring.

Maintenance & Community

The project is actively maintained by techa03. Links to Gitee and Codecov are provided.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: Generally compatible with commercial use due to MIT license.

Limitations & Caveats

The project is stated to be for learning purposes and may omit real-world complexities. Compatibility of newer framework versions is not fully tested. Custom OAuth2.0 authorization server login is marked as "to be improved."

Health Check
Last commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
85 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.