
Microservices Architecture: Java Spring Boot + Python Flask
## Why Hybrid Microservices?
When building McIntosh Digital Solutions, I needed a system that could handle both complex business logic and AI/ML processing efficiently. The solution? A hybrid approach using Java Spring Boot for business logic and Python Flask for AI services.
Architecture Overview
┌─────────────────┐ ┌─────────────────┐
│ React Frontend │────▶│ API Gateway │
└─────────────────┘ └────────┬────────┘
│
┌────────────┼────────────┐
│ │ │
┌─────▼─────┐ ┌────▼────┐ ┌────▼────┐
│ Spring │ │ Flask │ │ Auth │
│ Boot │ │ AI │ │ Service│
│ Service │ │ Service│ │ │
└─────┬─────┘ └────┬────┘ └────┬────┘
│ │ │
┌─────▼────────────▼────────────▼─────┐
│ PostgreSQL / Redis │
└─────────────────────────────────────┘Spring Boot for Business Logic
Java Spring Boot handles all core business operations:
@RestController
@RequestMapping("/api/projects")
public class ProjectController {
@Autowired
private ProjectService projectService;
@PostMapping
public ResponseEntity<Project> createProject(
@Valid @RequestBody ProjectDTO dto
) {
return ResponseEntity.ok(
projectService.create(dto)
);
}
}Flask for AI Processing
Python Flask handles all AI/ML operations where Python's ecosystem shines:
from flask import Flask, request, jsonifyapp = Flask(__name__) classifier = pipeline("sentiment-analysis")
@app.route("/api/ai/analyze", methods=["POST"]) def analyze(): text = request.json.get("text") result = classifier(text) return jsonify(result) ```
Inter-Service Communication
Services communicate via REST and message queues for async operations.
Results
- 60 FPS animations on the frontend
- Sub-100ms API response times
- Scalable AI processing
- Clean separation of concerns

Kaleb McIntosh
Full-Stack Software Engineer
Founder, McIntosh Digital Solutions

