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 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?