Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c9s/sid
Sequential ID generator as a micro-service, implemented in Go
https://github.com/c9s/sid
generator go grpc id mysql sequential
Last synced: 3 months ago
JSON representation
Sequential ID generator as a micro-service, implemented in Go
- Host: GitHub
- URL: https://github.com/c9s/sid
- Owner: c9s
- Created: 2017-12-24T02:25:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-24T12:34:20.000Z (about 7 years ago)
- Last Synced: 2024-04-15T10:59:07.974Z (10 months ago)
- Topics: generator, go, grpc, id, mysql, sequential
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sequence ID generator as a micro-service
The sequence ID is designed to generate sequential ID for no-sql applications.
gRPC protocol is used to provide high efficiency network communication.
## Requirement
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/go-sql-driver/mysql## Install
go get github.com/c9s/sid/cmd/sidserver
## Setting up
To setup the sid generator, you need few things:
1. DSN for MySQL server
2. The keys of the sequences.You need to create a config file like this:
```json
{
"backend": {
"mysql": {
"dsn": "root@unix(/opt/local/var/run/mysql57/mysqld.sock)/sid"
}
},
"sequences": {
"jobs": {},
"orders": {}
}
}
```## Running
Simply run the following commands to run the server:
sid-server -config config.json
## License
MIT License
## Author
Yo-An Lin