Description
ObjectBox is a superfast database for objects. Using this Golang API, you can use ObjectBox as an embedded database in your Go application. A client/server mode will follow soon.
ObjectBox persists your native Go structs using a simple CRUD API:
id, err := box.Put(&Person{ FirstName: "Joe", LastName: "Green" })
ObjectBox Go Database alternatives and similar packages
Based on the "Database" category.
Alternatively, view ObjectBox Go Database alternatives based on common mentions on social networks and blogs.
-
prometheus
The Prometheus monitoring system and time series database. -
cockroach
CockroachDB - the open source, cloud-native distributed SQL database. -
tidb
TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial -
influxdb
Scalable datastore for metrics, events, and real-time analytics -
Milvus
A cloud-native vector database, storage for next generation AI applications -
dgraph
The high-performance database for modern applications -
vitess
Vitess is a database clustering system for horizontal scaling of MySQL. -
rqlite
The lightweight, distributed relational database built on SQLite -
groupcache
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases. -
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM. -
VictoriaMetrics
VictoriaMetrics: fast, cost-effective monitoring solution and time series database -
immudb
immudb - immutable database based on zero trust, SQL/Key-Value/Document model, tamperproof, data change history -
go-cache
An in-memory key:value store/cache (similar to Memcached) library for Go, suitable for single-machine applications. -
BigCache
Efficient cache for gigabytes of data written in Go. -
bytebase
Database DevOps and CI/CD for Developer, DBA and Platform Engineering team. -
go-mysql-elasticsearch
Sync MySQL data into elasticsearch -
ledisdb
A high performance NoSQL Database Server powered by Go -
rosedb
Lightweight, fast and reliable key/value storage engine based on Bitcask. -
pREST
PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new -
buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support -
go-memdb
Golang in-memory database built on immutable radix trees -
dbmate
:rocket: A lightweight, framework-agnostic database migration tool. -
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server -
tiedot
A rudimentary implementation of a basic document (NoSQL) database in Go -
nutsdb
A simple, fast, embeddable, persistent key/value store written in pure Go. It supports fully serializable transactions and many data structures such as list, set, sorted set. -
LinDB
LinDB is a scalable, high performance, high availability distributed time series database. -
cache2go
Concurrency-safe Go caching library with expiration capabilities and access counters -
GCache
An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC -
fastcache
Fast thread-safe inmemory cache for big number of entries in Go. Minimizes GC overhead -
gocraft/dbr (database records)
Additions to Go's database/sql for super fast performance and convenience. -
CovenantSQL
A decentralized, trusted, high performance, SQL database with blockchain features -
lotusdb
Most advanced key-value store written in Go, extremely fast, compatible with LSM tree and B+ tree, optimization of badger and bbolt.
Static code analysis for 29 languages.
Do you think we are missing an alternative of ObjectBox Go Database or a related project?
README
Do you ♥️ using ObjectBox?
We want to hear about your app! It will - literally - take just a minute, but help us a lot. Thank you! 🙏
ObjectBox Go API
ObjectBox is a superfast database for objects. Using this Golang API, you can use ObjectBox as an embedded database in your Go application. A client/server mode will follow soon.
ObjectBox persists your native Go structs using a simple CRUD API:
id, err := box.Put(&Person{ FirstName: "Joe", LastName: "Green" })
Want details? Read the docs or check out the API reference.
Latest release: v1.2.0 (2020-08-25)
Some features
- Powerful queries
- Relations (to-one, to-many)
- Secondary indexes based on object properties
- Asynchronous puts
- Automatic model migration (no schema upgrade scripts etc.)
- inline/prefix complex embedded structs (or you can use custom converters)
Getting started
To install ObjectBox, execute the following command in your project directory. You can have a look at installation docs for more details and further instructions.
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/master/install.sh)
You can run tests to validate your installation
go test github.com/objectbox/objectbox-go/...
With the dependencies installed, you can start adding entities to your project:
//go:generate go run github.com/objectbox/objectbox-go/cmd/objectbox-gogen
type Task struct {
Id uint64
Text string
}
And run code generation in your project dir
go generate ./...
This generates a few files in the same folder as the entity - remember to add those to version control (e. g. git).
Once code generation finished successfully, you can start using ObjectBox:
obx := objectbox.NewBuilder().Model(ObjectBoxModel()).Build()
box := BoxForTask(obx) // Generated function to provide a Box for Task objects
id, _ := box.Put(&Task{ Text: "Buy milk" })
See the Getting started section of our docs for a more thorough intro.
Also, please have a look at the [examples](examples) directory and for the API reference see ObjectBox GoDocs - and the sources in this repo.
Upgrading to a newer version
When you want to update, please re-run the entire installation process to ensure all components are updated:
- ObjectBox itself (objectbox/objectbox-go)
- Dependencies (flatbuffers)
- ObjectBox library (libobjectbox.so|dylib; objectbox.dll)
- ObjectBox code generator
This is important as diverging versions of any component might result in errors.
The install.sh
script can also be used for upgrading:
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-go/master/install.sh)
Afterwards, don't forget to re-run the code generation on your project
go generate ./...
License
Copyright 2018-2019 ObjectBox Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*Note that all licence references and agreements mentioned in the ObjectBox Go Database README section above
are relevant to that project's source code only.