Coder Social home page Coder Social logo

xzero707 / db-performance-benchmarking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vikashchoudahry/db-performance-benchmarking

1.0 0.0 0.0 144 KB

PostgreSQL and MySQL DB performance benchmarking

License: BSD 3-Clause "New" or "Revised" License

TypeScript 100.00%

db-performance-benchmarking's Introduction

db-performance-benchmarking

PostgreSQL & MySQL DB performance benchmarking.

Steps to steup

Pre-requisites

Make sure Postgresql and MySQL database is installed and accessible.

Note: Tested on MySQL - v5.7 | PostgreSQL - v11.2

Set the necessary env variables by running the below command:

cp env.example .env

Add the env variable's value

At a time enable only one database env variables and others comment it out.

For e.g. if you have to get the stats of MySQL then comment out the PostgreSQL DB env variables and vice-versa.

Run the npm install: (node v12.13.1)

npm install

Build the application:

npm run build or npm run build:watch Note: For more details please refer to the package.json file.

To see the benchmarking stats, just run:

npm start

Output: Directly can be seen in the console

Sample output:

Total content size >>> 206

index | WRITE   | READ  | UPDATE
mysql | 3203.31 | 45.66 | 21.3

Total content size >>> 206

index     | WRITE   | READ  | UPDATE
postgres  | 2447.64 | 45.26 | 50.2

Note:

  1. If you want to calculate the average of 3 or whatever # of execution basis then execute the script those many times for the respective DB Dialect.
  2. The current stats are generated based on the sample json objected which is placed under src/app/response. This reponse object can be modified further. To get the more realstic stats add modified the json object and run the script.
  3. This stats are derived only on the basis of JSON types data. This will tell you how much time it takes to do the WRITE, READ and UPDATE operation.
  4. The primary focus was on WRITE & READ. The UPDATE stats can be ignored. Becuase there are rare case when we do the bulk update else we mostly perform the udpate operation using primary key (or composite primary key).

Enhancement: Make the script dynamic to get the benchmarking stats.

db-performance-benchmarking's People

Contributors

vikashchoudahry avatar vikashkrchoudhary avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.