CustomerManagerService is a Spring Boot-based RESTful API for managing customer records, designed with reliability, modularity, and testability in mind. This branch implements file-based persistence, enabling easy local testing without external cloud dependencies.
This RESTful service allows creation and retrieval of customer records. Key features include:
- Validation of request data
- Manual sorted insertion (without
.sort()) - File-based persistence to retain data across server restarts
- Modular, testable architecture (controller-service-persistence pattern)
CustomerController– handles API endpointsCustomerService– business logic and validationCustomerPersistence– handles file-based read/writeGlobalExceptionHandler– centralized error handlingCustomerApiSimulator– generates POST/GET requests for load testing
- ✅ RESTful API with
POSTandGETendpoints - ✅ Manual sorted insertion by
lastName, thenfirstName - ✅ Input validation using
@Validand custom logic - ✅ Global exception handling for both schema and business rule violations
- ✅ File-based persistence (via Jackson) with option to extend to cloud (e.g., GCS, DynamoDB)
- ✅ JUnit + MockMvc test coverage
- ✅ API simulator to test performance under concurrency
- Define model (Customer)
- Implement
/customersPOST and GET - Manual insertion without
.sort() - File-based persistence with Jackson
- Adding Unit Test and Integration Test
- Structured error handling
- Simulator
- Modular folder structure
- Cloud migration implemented separately (
cloud-integrationbranch)
- Java 17+
- Maven 3.8+
- IntelliJ or any Java IDE
- Open
CustomerManagerServiceApplication.java - Right-click → Run
./mvnw spring-boot:run./mvnw clean package
java -jar target/CustomerManagerService-0.0.1-SNAPSHOT.jarAdds multiple customers at once.
Requirements:
-
Must include at least 2 customers
-
Each customer must have:
-
firstName,lastName(non-empty) -
age between 10–90
-
Sequentially increasing id
[
{
"firstName": "Leia",
"lastName": "Ray",
"age": 25,
"id": 1
},
{
"firstName": "Frank",
"lastName": "Anderson",
"age": 30,
"id": 2
}
]Returns the list of all customers, sorted by :
lastName- then
firstName
| Branch | Description |
|---|---|
main (this one) |
🖥️ Local development with file-based persistence |
cloud-integration |
☁️ Deployed to AWS Lambda with DynamoDB storage |
Spring Boot offers:
-
Fast setup and built-in support for REST APIs
-
Strong testing ecosystem
-
Auto-configuration and cloud-native features
-
Easy extensibility for GCP, AWS, or Docker
-
It allowed rapid delivery with a scalable, professional structure.
File persistence allows:
-
Retaining state across server restarts
-
Avoiding the complexity of database setup
-
Easy cloning and testing by reviewers
- Replace file persistence with DynamoDB or GCS
- Add Swagger/OpenAPI documentation
- Add CI/CD pipeline (GitHub Actions)
- Implement request throttling/rate-limiting
- Extend simulator with CLI flags and metrics
