Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
How to improve sqlite3 write speed compare to others?

I tested sqlite3, and mongodb with same task. loop task insert 10M times. mongodb done in 13seconds, but sqlite3 even run 30 minutes still writing, is there something wrong with my sqlite config? sqlite write temporary journal like 1-9kb repetitive. i know the ways to concanate query to insert all in 1 query. but, what i want to test is speed of bunch of query. ex, 10M times.

const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('database.db', error => {
    if (error) console.log(error)
    if (error == null) console.log('Succefully connected');   
});
// CREATE TABLE IF NOT EXISTS user (id BIGINT, username TEXT, password TEXT)
db.serialize(() => {
  const stmt = db.prepare('INSERT INTO user (id, username, password) VALUES ($id, $username, $password)');
        
  for (let i=0; i < 10000000; i++) {
    stmt.run({
      $id: i,
      $username: 'admin',
      $password: 'passadmin'
    })
  };

  stmt.finalize()
});

db.close();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!