BoltDB - indexing, replication, binaries, ...?

I am working on application where I need embedded database. BoltDB is looking as best option. But I have a lot of entities (go structs). Exists some projects for BoltDB where are solved some problems ?

  1. Indexing. For some entities I need several indexes. Some indexes must be for example unique. Maybe some fulltext indexing etc…

  2. Replication. I want have a “cloud” solution.

  3. Application layer where I could change my engine (BoltDB vs MongoDB vs …)

  4. How store large binaries (images, videos). Is BoltDB suitable solution ?

There is project https://github.com/asdine/storm

Indexing

You can use a separate bucket from your data to store indexes. For example, if you want to index by user email, you can make a “Users.Email” bucket and store the “email” as the key and the user id as the value.

If you need full text search you may want to look at something like bleve.

Replication. I want have a “cloud” solution.

There’s no cloud solution for BoltDB. You can snapshot the database quickly using Tx.WriteTo() but there’s no streaming replication currently. That may be added in the future though.

Application layer where I could change my engine (BoltDB vs MongoDB vs …)

I would suggest that you define your interface at your application level (in your application) and simply have various implementations. I wrote a blog post about separating out an application like this.

How store large binaries (images, videos). Is BoltDB suitable solution?

Large blobs will cause fragmentation and will not be very efficient. I would suggest that you just use BoltDB for the meta data.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.