Performance BoltDB as a base database

I think about using BoltDB as the main database base and few questions with Go code; you also need your opinion on using BoltDB as the main database.

  • I use Go net / http and use boltDb as a global variable.
  • When the program starts, it will read BoltDB, and the file will be open until the program terminates.
  • When requests (http) are sent to the program, it will contact BoltDB. (HandleFunc)
  • I have not used any channels.

Q1. The most important question is BoltDB, capable of producing simultaneously 1000? Q2. If parallel recordings were to be performed, would BoltDB be automatically processed one by one?

Thank you very much. I am new to Go and BoltDB, and I am wondering if I am using the correct DB correctly.

+6
source share
1 answer

A1. Yes, we use it with more than 1000 parallel connections.

A2. Yes, the bolt is thread safe, when you call db.Update, it locks the database, so you know that the data will always be consistent.

Also a hint, never do the hard work inside the update function.

+6
source

All Articles