The application was implemented according to the provided specifications. The main components are:
- Programming language: Go, selected for its strong typing and concurrency model
- Storage: SQLite, selected for its simplicity and performance
- Web server: Gin, selected for its lightweight HTTP routing and middleware support
- Logging: Zerolog, selected for its low overhead and efficient structured logging (useful for log analisys tools like Datadog)
- Bucket object deduplication: SHA-256, selected for its good balance of computational efficiency and collision resistance
- GET
/objects/{bucket}/{objectID}: retrieve an object by bucket ID and object ID - PUT
/objects/{bucket}/{objectID}: create an object in the specified bucket using the provided object ID, needs alsocontentto be passed in the request JSON body - DELETE
/objects/{bucket}/{objectID}: delete an object by bucket ID and object ID
- PUT
/objects/test-bucket/test-idBody:
{
"content":"some-content"
}Response:
{
"bucket": "test-bucket",
"objectID": "test-id",
"message": "Object stored successfully"
}- GET
/objects/test-bucket/test-id
Response:
{
"bucket": "test-bucket",
"objectID": "test-id",
"message": "Object retrieved successfully",
"content": "some-content"
}- DELETE
/objects/test-bucket/test-id
Response:
{
"bucket": "test-bucket",
"objectID": "test-id",
"message": "Object deleted successfully"
}LISTENING_ADDRESS: IP address or hostname on which the web server listens, defaults to0.0.0.0HTTP_PORT: TCP port on which the web server listens, defaults to8080GIN_MODE: configures wheter app should run in debug or production mode, defaults torelease
To run the integration test suite, execute make test.
NOTE: due to the limited scope of the task, only integration tests were implemented.
To deploy locally, run make all or make all-docker.
To deploy to production, apply the Kubernetes manifests in the deploy directory.
- Enable HA
- Migrate to an external PostgreSQL instance as the primary datastore
- Introduce stateless authentication (e.g. JWT) and application security controls (e.g. CORS, CSP, etc.)
- Introduce a caching layer (e.g. Redis)
- Kustomize or add Helm Chart for Kubernetes deployment
- Add a
/metricsendpoint - Add Swagger and OpenAPI documentation
- Add linting and hot reloading (for development purposes)
- Move to a fully RESTful resource structure
/buckets/{bucketID}/objects/{objectID}:- GET object on the
/buckets/{bucketID}/objects/{objectID}endpoint - POST new objects on the
/buckets/{bucketID}/objectsendpoint (the object ID must be assigned by the backend) - PUT existing objects (override) on the
/buckets/{bucketID}/objects/{objectID}(or just use PATCH) - DELETE object on the
/buckets/{bucketID}/objects/{objectID}endpoint
- GET object on the
During development, AI assistance was used exclusively to generate code boilerplate via GitHub Copilot. All generated boilerplate was manually reviewed, validated, and refined before integration.