https://github.com/semihalev/tsdb
Lightweight Time Series Database
https://github.com/semihalev/tsdb
series-database time timeseries timeseries-database tsdb
Last synced: about 1 year ago
JSON representation
Lightweight Time Series Database
- Host: GitHub
- URL: https://github.com/semihalev/tsdb
- Owner: semihalev
- License: mit
- Created: 2015-06-26T13:27:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T00:28:18.000Z (almost 6 years ago)
- Last Synced: 2025-03-24T03:53:23.050Z (about 1 year ago)
- Topics: series-database, time, timeseries, timeseries-database, tsdb
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 24
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lightweight Time Series Database
TSDB is lightweight in-memory time series database with [BuntDB](https://github.com/tidwall/buntdb) as backend
[](https://travis-ci.org/semihalev/tsdb)
[](https://codecov.io/gh/semihalev/tsdb)
[](https://goreportcard.com/report/github.com/semihalev/tsdb)
[](https://godoc.org/github.com/semihalev/tsdb)
## Warning
```
BoltDB backend changed. If you update latest version, migrate your data first.
```
## Features
+ HTTP API support
## Roadmap
- [x] Backend change to BuntDB
- [ ] Redis server support
- [ ] Raft support
## Usage
### Start using it
Download and install it:
```sh
$ go get github.com/semihalev/tsdb
```
```sh
$ go build
```
## API Usage
Query Series:
```
$ curl http://127.0.0.1:4080/api/v1/query?series=world (Optional parameters order=asc|desc, limit, offset)
```
Write Series:
```
$ curl http://127.0.0.1:4080/api/v1/write?series=world&value=hello (Optional parameters ttl=duration)
```
Count Series:
```
$ curl http://127.0.0.1:4080/api/v1/count?series=world
```
Delete Series:
```
$ curl http://127.0.0.1:4080/api/v1/delete?series=world
```
Delete by Time:
```
$ curl http://127.0.0.1:4080/api/v1/deletebytime?series=world&time=1435184955779847472
```
Backup:
```
$ curl http://127.0.0.1:4080/backup -o backup.db
```
## PHP Example Usage
- tsdb::query()
- tsdb::write()
- tsdb::count()
- tsdb::delete()
- tsdb::deletebytime()