-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# compiled binary | ||
simple-storage-server | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
*.dll | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,57 @@ | ||
# simple-storage-server | ||
Simple storage server homework assignment for interview. Go microservice for managing multipler user accounts for personal file storage. | ||
>Go microservice that allows registered users to store files. | ||
Completed all instructions. Tried to include best practices but could use improvements. Should give a general idea of my capabilities. | ||
# File Storage Microservice | ||
|
||
Suggestions welcome. | ||
* [Good practices](#good-practices) | ||
* [Usage](#usage) | ||
* [Run](#run) | ||
* [Test](#test) | ||
* [Before Production](#before-production) | ||
* [Personal Note](#personal-note) | ||
|
||
# Good practices | ||
- Use store interface which allows for easy mock testing | ||
- Seperate struct for configs used to instantiate service | ||
- Vendored dependencies | ||
- JWT session validation | ||
- Authorization data set in request context | ||
|
||
### Build and run | ||
From within repo: | ||
# Usage | ||
- Register | ||
- Login | ||
- List files | ||
- Put file | ||
- Get file | ||
- Delete file | ||
|
||
# Run | ||
From root folder: | ||
``` | ||
go build && ./simple-storage-server | ||
``` | ||
Localhost address is http://localhost:9999/ | ||
|
||
Expected file form field is "file" | ||
|
||
### Test | ||
# Test | ||
``` | ||
go test | ||
``` | ||
|
||
### TODO if this were a production project | ||
Handle space limitations<br> | ||
More test coverage - gave just a few examples<br> | ||
Store registered users to disk - currently an in memory map, <br> | ||
Create and cleanup folders on startup - folders included in project<br> | ||
Logger middleware instead - currenlty just does validation<br> | ||
Integration tests<br> | ||
Read configs from text file<br> | ||
Docker image<br> | ||
# Before Production | ||
- Handle space limitations | ||
- More test coverage | ||
- Store registered users to disk | ||
- Create and cleanup folders on startup | ||
- Logger middleware | ||
- Integration tests | ||
- Read configs from text file | ||
- Docker image | ||
- Publish API | ||
|
||
# Personal Note | ||
What's the big deal with microservices? Honestly, it's just the next logical step in the evolution of service oriented architecture (SOA). | ||
|
||
SOA allowed us to escape the single point of failure of having everything run on one server. Back then, network bottlenecks prevented us from over using services but that is much less of problem now. | ||
|
||
With clouds, we can freely decouple data and the logic that goes with them across infrastructure. Just imagine your working code stays up. When something goes wrong, only one service goes down. It's a beauatiful dream. The cost is the heavy lifting of configuring, monitoring, and complicating your system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters