Projects
Backend Systems
CloudDrive
A tested Spring Boot backend for authenticated cloud file storage and sharing.
Spring Boot 3
Backend
PostgreSQL
Metadata
AWS S3
Objects
Redis
Cache
Testcontainers
Testing
Problem
A file platform must keep identity, metadata, object bytes, versions, shares, and cache state consistent while preserving secure access and recoverable deletes.
JavaSpring BootPostgreSQLAWS S3RedisElasticsearchDocker
GitHub Repository Client01
Spring Boot API02
PostgreSQL Metadata · S3 Objects03
Redis Cache · Elasticsearch Index04
Architecture
- Spring Boot controllers expose authentication, file, folder, version, sharing, and search APIs.
- PostgreSQL stores users, metadata, versions, shares, refresh tokens, and resumable-upload sessions.
- AWS S3 stores file bytes while Redis caches hot metadata and Elasticsearch indexes searchable fields.
- Flyway migrations and Docker Compose make the data services reproducible.
Design Decisions
- Separated object bytes from relational metadata and stored SHA-256 hashes alongside object keys.
- Used rotating persisted refresh tokens while keeping access tokens stateless.
- Made deletes soft by default and guarded permanent object deletion against remaining metadata references.
Performance
- Keeps large file bytes in S3 instead of the application database.
- Uses Redis for frequently accessed metadata and Elasticsearch for low-latency discovery.
Validation
- Mockito unit tests cover service behavior and error paths.
- Testcontainers integration tests exercise PostgreSQL-backed workflows.
- Flyway migrations version the source-of-truth schema.
Lessons Learned
Object storage and metadata databases need explicit consistency boundaries.
Secure file sharing depends on authorization checks at every metadata and download path.
Integration tests catch persistence and migration failures that isolated unit tests cannot.