makkari

0.1.8 • Public • Published

Build Test Version License: MIT

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

Library Query Duration
pg select * from example, pg_sleep(5) limit 1 4 minutes
makkari select * from example, pg_sleep(5) limit 1 6.04 seconds

Supported Databases

Database Status
pg working
mysql in 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.

Readme

Keywords

none

Package Sidebar

Install

npm i makkari

Weekly Downloads

2

Version

0.1.8

License

MIT

Unpacked Size

209 kB

Total Files

28

Last publish

Collaborators

  • leoves
  • igor.martins