Comparing Performance for Javascript ORM

Contender

ORM involved in this test are: typeORM, Prisma, Sequelize and we include one javascript sql client, mssql for SQL server for comparison purpose.

Database

Azure SQL Basic with 5 DTU (database transaction unit) is used during this test.

Web API

We wrote a rest api for each of the ORM to read and write to database. We host this API in Azure App Service B1 instance with single core and 1.75 GB RAM.

Testing Scenario

We tested for read and write operation on single table. HTTP requests sent to backend api with 10 concurrent connections and run continuously for 10 seconds period. We repeat the test three times for each of ORM and mssql client and calculate the average figure.

Before each test we make sure that we restart each service to clean-up any dirty process and memory. Also we truncate table before we do subsequent write testing.

All ORM were configured using their default and recommended settings based on their latest version and documentation. For sequelize we increase the default connection max pool to 10.

The Result

We calculate average request/second and average latency figures. Enjoy our findings.

Link:
https://typeorm.io/#/
https://www.prisma.io/
https://sequelize.org/
https://www.npmjs.com/package/mssql