0.1.8 • Published 4 years ago

makkari v0.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Makkari is a library developed in NodeJS that aims to execute multiple database queries using Worker Threads. In order to reach significant numbers, we created several workers which will execute queries in parallel. Initially Makkari was developed for internal projects, but we understand that it can be useful for other developers..

To run the queries, we use some libraries known as pg, mysql, among others.

Quick Start

const { Makkari } = require('makkari')

const queries = Array(50).fill('select * from example, pg_sleep(5) limit 1')

const database = {
  type: 'postgres',
  config: {
    database: 'postgres',
    host: 'localhost',
    port: 5432,
    user: 'postgres',
    password: 'postgres',
  },
}

const makkari = new Makkari({ queries, database })

const main = async () => {
  console.time('QUERY')
  console.log(await makkari.run())
  console.timeEnd('QUERY')
}

main()

Benchmarks

Send 50 queries and sleep for 5 seconds after execute then

LibraryQueryDuration
pgselect * from example, pg_sleep(5) limit 14 minutes
makkariselect * from example, pg_sleep(5) limit 16.04 seconds

Supported Databases

DatabaseStatus
pgworking
mysqlin development

Install

yarn add makkari

Run tests

yarn test

🤝 Contributing

You can contribute to Napa.js in following ways:

  • Report issues and help us verify fixes as they are checked in.
  • Review the source code changes.
  • Contribute creating new database modules to Makkari.
  • Contribute bug fixes.