duanlijia5864 2016-03-30 03:09
浏览 303
已采纳

BoltDB作为后端数据库的性能

I am thinking about using BoltDB as a backend main DB and have few question with my Go code; also need your opinion of using BoltDB as a main backend DB.

  1. I am using Go's net/http, and use boltDb as global variable.
  2. When the program starts, it will read BoltDB and the file is open until the program terminates.
  3. When requests(http) are sent to the program, it will access BoltDB. (HandleFunc)
  4. I didn't use any channel.

Q1. Most important question, is BoltDB capable for production with 1000 concurrent connection? Q2. If there were concurrent writing queries, will BoltDB automatically process one by one?

Thank you so much. I am new to Go and BoltDB and I am wondering if I am using right DB with right way.

  • 写回答

1条回答 默认 最新

  • douju7765 2016-03-30 04:24
    关注

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

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

    Also a hint, never do any heavy lifting inside the update func.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度