{"id":14969021,"url":"https://github.com/masfahru/nodejs-benchmark-postgresql-mysql-mongodb","last_synced_at":"2025-07-11T12:43:48.171Z","repository":{"id":243357804,"uuid":"812209311","full_name":"masfahru/nodejs-benchmark-postgresql-mysql-mongodb","owner":"masfahru","description":"Comparing performance of MySQL, PostgreSQL, and MongoDB in a Node.js environment","archived":false,"fork":false,"pushed_at":"2025-02-24T01:15:51.000Z","size":43,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T16:47:54.547Z","etag":null,"topics":["benchmark","javascript","mariadb","mongodb","mysql","nodejs","postgres","postgresql"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/posts/imamfahrurrofi_benchmark-mysql-postgresql-activity-7205478738199793664-UFPU","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/masfahru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T08:43:46.000Z","updated_at":"2025-02-24T01:15:54.000Z","dependencies_parsed_at":"2024-06-08T10:22:00.923Z","dependency_job_id":"09649abf-b4ed-47d0-8cbf-75bdcaa0794c","html_url":"https://github.com/masfahru/nodejs-benchmark-postgresql-mysql-mongodb","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.4285714285714286,"last_synced_commit":"ab7a7c567a78e5668b2e4200fb73b59a9e44cdf1"},"previous_names":["masfahru/nodejs-benchmark-postgresql-mysql-mongodb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/masfahru/nodejs-benchmark-postgresql-mysql-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/masfahru","download_url":"https://codeload.github.com/masfahru/nodejs-benchmark-postgresql-mysql-mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/masfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264811258,"owners_count":23667718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","javascript","mariadb","mongodb","mysql","nodejs","postgres","postgresql"],"created_at":"2024-09-24T13:40:57.647Z","updated_at":"2025-07-11T12:43:48.166Z","avatar_url":"https://github.com/masfahru.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Benchmark: MySQL vs PostgreSQL vs MongoDB\n\nThis repository contains a Node.js benchmarking project that compares the performance of MySQL, PostgreSQL, and MongoDB in a Node.js environment. The goal is to analyze runtime query performance for both databases and identify scenarios where each database excels.\n\n## Tools\n\n### Runtime\n\n* Node.js (version 22.x)\n\n### Database\n\n* MongoDB (version 5.0.26)\n* PostgreSQL (version 16.3)\n* MySQL (version 8.x)\n\n### Database Connectors\n\n* [Mongodb](https://github.com/mongodb/node-mongodb-native) (version ^6.7.0)\n* [Postgres](https://github.com/porsager/postgres) (version ^3.4.4)\n* [Mariadb](https://github.com/mariadb-corporation/mariadb-connector-nodejs) (version ^3.3.0)\n\n### Others\n\n* [Faker-js](https://github.com/faker-js/faker) (version ^8.4.1)\n* [Hirestime](https://github.com/seriousManual/hirestime) (version ^7.0.4)\n\n## Running The Benchmark\n\nThe benchmark runs using GitHub Actions. To see the workflows, check [benchmark.yml](.github/workflows/benchmark.yml).\n\n## Results\n\nExplore the [results directory](results).\n\n### Latest Results\n\n\u003c!-- start --\u003e\n```\nruntime: node v22.13.1 x64-linux\n\n[MySQL] Total inserted users: 66200\n[Postgres] Total inserted users: 66200\n[MongoDB] Total inserted users: 66200\n\nTime (ms) table:\n┌─────────────────────────────┬─────────┬──────────┬─────────┐\n│ (index)                     │ MySQL   │ Postgres │ MongoDB │\n├─────────────────────────────┼─────────┼──────────┼─────────┤\n│ insert 100 users            │ 24.71   │ 8.77     │ 29.79   │\n│ insert 1000 users           │ 212.36  │ 77.54    │ 272.73  │\n│ insert 5000 users           │ 1100.97 │ 361.02   │ 904.21  │\n│ insert 10000 users          │ 2146.96 │ 650.96   │ 1410.36 │\n│ insert 20000 users          │ 3878.1  │ 1267.04  │ 2551.46 │\n│ insert 30000 users          │ 5692.35 │ 1842.5   │ 3765.12 │\n│ select limit 100            │ 2.06    │ 1.66     │ 2.5     │\n│ select limit 1000           │ 6.44    │ 7.26     │ 17.91   │\n│ select limit 5000           │ 12.43   │ 18.42    │ 72.26   │\n│ select limit 10000          │ 24.52   │ 37.13    │ 101.74  │\n│ select limit 20000          │ 47.45   │ 89.63    │ 167.08  │\n│ select limit 30000          │ 60.37   │ 115.5    │ 222.93  │\n│ select by email limit 100   │ 14.51   │ 8.91     │ 19.22   │\n│ select by email limit 1000  │ 124.26  │ 46.56    │ 280.43  │\n│ select by email limit 5000  │ 491.21  │ 171.46   │ 989.77  │\n│ select by email limit 10000 │ 905.09  │ 336.96   │ 1722.72 │\n│ select by email limit 20000 │ 1754.47 │ 533.46   │ 3262.59 │\n│ select by email limit 30000 │ 2558.61 │ 740.06   │ 4891.54 │\n│ count by age range 15-20    │ 13.81   │ 6.72     │ 36.2    │\n│ count by age range 21-25    │ 13.22   │ 7.07     │ 38.38   │\n│ count by age range 26-30    │ 13.55   │ 6.77     │ 39.23   │\n│ count by age range 31-35    │ 12.99   │ 6.4      │ 40.64   │\n│ count by name prefix A      │ 14.81   │ 24.66    │ 38.37   │\n│ count by name postfix A     │ 17.97   │ 26.52    │ 40.35   │\n│ count by name contains A    │ 16.89   │ 27.83    │ 43.24   │\n│ count by name prefix I      │ 14.4    │ 24.32    │ 38.1    │\n│ count by name postfix I     │ 17.44   │ 25.49    │ 38.48   │\n│ count by name contains I    │ 17.05   │ 27.17    │ 41.6    │\n│ count by name prefix O      │ 14.92   │ 24.82    │ 37.97   │\n│ count by name postfix O     │ 16.91   │ 25.44    │ 38.35   │\n│ count by name contains O    │ 16.86   │ 26.47    │ 40.16   │\n└─────────────────────────────┴─────────┴──────────┴─────────┘\n\nTotal data table:\n┌─────────────────────────────┬────────┬──────────┬─────────┐\n│ (index)                     │ MySQL  │ Postgres │ MongoDB │\n├─────────────────────────────┼────────┼──────────┼─────────┤\n│ insert 100 users            │ 100    │ 100      │ 100     │\n│ insert 1000 users           │ 1000   │ 1000     │ 1000    │\n│ insert 5000 users           │ 5000   │ 5000     │ 5000    │\n│ insert 10000 users          │ 10000  │ 10000    │ 10000   │\n│ insert 20000 users          │ 20000  │ 20000    │ 20000   │\n│ insert 30000 users          │ 30000  │ 30000    │ 30000   │\n│ select limit 100            │ 100    │ 100      │ 100     │\n│ select limit 1000           │ 1000   │ 1000     │ 1000    │\n│ select limit 5000           │ 5000   │ 5000     │ 5000    │\n│ select limit 10000          │ 10000  │ 10000    │ 10000   │\n│ select limit 20000          │ 20000  │ 20000    │ 20000   │\n│ select limit 30000          │ 30000  │ 30000    │ 30000   │\n│ select by email limit 100   │ 100    │ 100      │ 100     │\n│ select by email limit 1000  │ 1000   │ 1000     │ 1000    │\n│ select by email limit 5000  │ 5000   │ 5000     │ 5000    │\n│ select by email limit 10000 │ 10000  │ 10000    │ 10000   │\n│ select by email limit 20000 │ 20000  │ 20000    │ 20000   │\n│ select by email limit 30000 │ 30000  │ 30000    │ 30000   │\n│ count by age range 15-20    │ 18910n │ '18910'  │ 18910   │\n│ count by age range 21-25    │ 15707n │ '15707'  │ 15707   │\n│ count by age range 26-30    │ 15994n │ '15994'  │ 15994   │\n│ count by age range 31-35    │ 15589n │ '15589'  │ 15589   │\n│ count by name prefix A      │ 4672n  │ '4672'   │ 4672    │\n│ count by name postfix A     │ 11476n │ '11476'  │ 11476   │\n│ count by name contains A    │ 39298n │ '39298'  │ 39298   │\n│ count by name prefix I      │ 993n   │ '993'    │ 993     │\n│ count by name postfix I     │ 1261n  │ '1261'   │ 1261    │\n│ count by name contains I    │ 26185n │ '26185'  │ 26185   │\n│ count by name prefix O      │ 849n   │ '849'    │ 849     │\n│ count by name postfix O     │ 2447n  │ '2447'   │ 2447    │\n│ count by name contains O    │ 18685n │ '18685'  │ 18685   │\n└─────────────────────────────┴────────┴──────────┴─────────┘\n\nSystem Info:\n┌──────────────┬────────────────────────────────────────┐\n│ (index)      │ Values                                 │\n├──────────────┼────────────────────────────────────────┤\n│ manufacturer │ 'Microsoft Corporation'                │\n│ model        │ 'Virtual Machine'                      │\n│ version      │ '7.0'                                  │\n│ serial       │ '-'                                    │\n│ uuid         │ '9814cac8-a906-b945-a805-d678c64a28a4' │\n│ sku          │ '-'                                    │\n│ virtual      │ true                                   │\n└──────────────┴────────────────────────────────────────┘\n\nCPU Info:\n┌──────────────────┬───────────────────────────────┐\n│ (index)          │ Values                        │\n├──────────────────┼───────────────────────────────┤\n│ manufacturer     │ 'AMD'                         │\n│ brand            │ 'EPYC 7763 64-Core Processor' │\n│ vendor           │ 'AMD'                         │\n│ family           │ '25'                          │\n│ model            │ '1'                           │\n│ stepping         │ '1'                           │\n│ revision         │ ''                            │\n│ voltage          │ ''                            │\n│ speed            │ 2.45                          │\n│ speedMin         │ NaN                           │\n│ speedMax         │ NaN                           │\n│ governor         │ ''                            │\n│ cores            │ 4                             │\n│ physicalCores    │ 2                             │\n│ performanceCores │ 2                             │\n│ efficiencyCores  │ 0                             │\n│ processors       │ 1                             │\n│ socket           │ ''                            │\n│ virtualization   │ true                          │\n└──────────────────┴───────────────────────────────┘\n\nOS Info:\n┌─────────────┬─────────────────────────────────────────────────────────────────────┐\n│ (index)     │ Values                                                              │\n├─────────────┼─────────────────────────────────────────────────────────────────────┤\n│ platform    │ 'linux'                                                             │\n│ distro      │ 'Ubuntu'                                                            │\n│ release     │ '24.04.1 LTS'                                                       │\n│ codename    │ 'noble'                                                             │\n│ kernel      │ '6.8.0-1021-azure'                                                  │\n│ arch        │ 'x64'                                                               │\n│ hostname    │ 'fv-az1690-151'                                                     │\n│ fqdn        │ 'fv-az1690-151.qpzrwuosrkvuxczmeamxp1lsch.ex.internal.cloudapp.net' │\n│ codepage    │ 'UTF-8'                                                             │\n│ logofile    │ 'ubuntu'                                                            │\n│ serial      │ 'e459e301882642258c2740f7faebc480'                                  │\n│ build       │ ''                                                                  │\n│ servicepack │ ''                                                                  │\n│ uefi        │ false                                                               │\n└─────────────┴─────────────────────────────────────────────────────────────────────┘\n```\n\u003c!-- end --\u003e\n\n## Contributing\n\nContributions are welcome! If you encounter any issues or want to add features, feel free to open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasfahru%2Fnodejs-benchmark-postgresql-mysql-mongodb/lists"}