A scalable backend system for managing and serving large volumes of articles.
This project aims to explore high-performance backend architecture using Spring Boot, JPA, and JWT-based authentication.
- β User & Post entity design (JPA)
- β Basic CRUD for User and Post
- β JWT-based authentication implemented
- β Swagger (OpenAPI) documentation integrated
- β Postman API testing completed
- β @Transactional issue resolved and documented
-
β Large Dataset Generation & Insertion
- Generated 10,000+ articles using Faker and inserted them into MySQL
- Indexed all records into Elasticsearch for search performance testing
-
β Search API Implementation
- MySQL Search: JPA with
findByTitleContainingOrContentContaining+ pagination & sorting - Elasticsearch Search: Java API Client with
MultiMatchQuery(title, content) + author/date filters
- MySQL Search: JPA with
-
β Performance Testing with Postman
- Designed 5 test scenarios changing
keyword,page, andsizeparameters - Measured response time for both MySQL and Elasticsearch
- Designed 5 test scenarios changing
-
β Performance Comparison Results
Request No. MySQL Time (ms) Elasticsearch Time (ms) 1 (keyword=love) 193 37 2 (keyword=kill) 186 31 3 (keyword=story) 143 25 4 (page=1) 104 25 5 (size=5) 137 26 Average 152.6 28.8 β Conclusion: Elasticsearch achieved ~5x faster average response times compared to MySQL.
-
β Redis Caching Integration
- Redis container launched via docker-compose
- Integrated Redis into Spring Boot for view count caching
- Implemented scheduler to periodically flush cached deltas back to MySQL
-
β Cache Performance Testing (JMeter)
- Designed tests with 100 concurrent users and different access patterns:
- Hot (few popular articles repeatedly requested)
- Random (uniform random requests)
- Zipf (realistic skewed distribution)
- Cold (no cache preloaded) vs Warm (cache preloaded)
- Designed tests with 100 concurrent users and different access patterns:
-
β Cache Hit/Miss Results
Scenario Cold (Hits/Misses) Warm (Hits/Misses) Hot 0 / 100 99 / 1 Random 0 / 100 50 / 50 Zipf 50 / 50 91 / 9 β Insights
- Caching is most effective under Hot access pattern (~99% hit ratio).
- Zipf distribution also benefits strongly from caching.
- Random distribution shows limited caching gains, as expected.
-
β Visualization
(Cache hit ratios for Hot, Random, Zipf under Cold vs Warm conditions)
| Layer | Tech Used |
|---|---|
| Backend | Spring Boot, Spring Security |
| Database | MySQL (JPA, Hibernate), Elasticsearch 8.x |
| Auth | JWT (access token only) |
| Docs/Test | Swagger (springdoc), Postman |
| Build Tool | Maven |
src/
βββ main/
βββ java/com/euni/articlehub/
β βββ controller/
β βββ service/
β βββ repository/
β βββ document/ # Elasticsearch documents
β βββ dto/
β βββ entity/
β βββ filter/
β βββ util/
βββ resources/
βββ application.yml
βββ static/templates (future)
# Clone the project
git clone https://github.com/your-username/scalable-article-hub.git
# Navigate into the project
cd scalable-article-hub
# Run the Spring Boot application
./mvnw spring-boot:runSwagger UI available at:
π http://localhost:8080/swagger-ui/index.html
Kibana (Elasticsearch monitoring) available at:
π http://localhost:5601
Redis (default port):
π redis://localhost:6379
RedisInsight (Redis GUI):
π http://localhost:5540
This project is part of my backend engineering portfolio, aimed at demonstrating:
-
Scalable API development with Java & Spring Boot
-
Performance optimization using Elasticsearch
-
Secure architecture with JWT authentication
-
Practical API testing using Postman
