Best practices for using SQLite3 + Node.js

前端 未结 1 1614
被撕碎了的回忆
被撕碎了的回忆 2020-12-25 14:53

I\'ve got a modest Node.js script that pulls down data from Wikipedia via the API and stores it in a SQLite database. I\'m using this node-sqlite3 module.

In some ca

相关标签:
1条回答
  • 2020-12-25 15:57

    When you are doing several insertions into a SQLite database, you need to wrap the collection of insertions into a transaction. Otherwise, SQLite will wait for the disk platters to spin completely around for each insert, while it does a read-after-write verify for each record that you insert.

    At 7200 RPM, it takes about 1/60th of a second for the disk platter to spin around again, which is an eternity in computer time.

    0 讨论(0)
提交回复
热议问题