Surf store is a cloud based file storage and syncing system like Drop Box.
It is based on protocol buffers using (gRPC Remote Procedure Calls).
There is a MetaStore for and a BlockStore service.
The MetaStore service manages the metadata of files and the entire system. Most importantly, the MetaStore service holds the mapping of filenames to blocks. Furthermore, it should be aware of available BlockStores and map blocks to particular BlockStores. In a real deployment, a cloud file service like Dropbox or Google Drive will hold exabytes of data, and so will require 10s of thousands of BlockStores or more to hold all that data.
The content of each file in SurfStore is divided up into chunks, or blocks, each of which has a unique identifier. This service stores these blocks, and when given an identifier, retrieves and returns the appropriate block.
- Download and Install Go https://go.dev/doc/install
- Download plugins for gRPC
- go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
- Then run the server
- go run cmd/SurfstoreServerExec/main.go -s <service> -p <port> -l -d (BlockStoreAddr*)
- <service> can be meta store, block store, or both. (run both services on the same port)
- e.g: go run cmd/SurfstoreServerExec/main.go -s both -p 8081 -l localhost:8081
- You can also use make run-both
- go run cmd/SurfstoreServerExec/main.go -s <service> -p <port> -l -d (BlockStoreAddr*)
- Then run client (Sync)
- Once you create a folder (e.g dataA), provide a path to that folder to sync
- Before you sync to the server, you can modify or delete files. For multiple clients, syncing will be based on versioning.
- go run cmd/SurfstoreClientExec/main.go server_addr:port <folder path> <blockSize>
- blockSize is how big are the blocks in bytes for the data.
- e.g go run cmd/SurfstoreClientExec/main.go localhost:8081 dataA 4096
- e.g go run cmd/SurfstoreClientExec/main.go localhost:8081 dataB 4096
