A Totally Unbiased Comparison of Top Backend Frameworks
Backend Frameworks: Because Who Needs a Stable Server Anyway?
Backend Frameworks: Because Who Needs a Stable Server Anyway?
In 2023, there are a variety of backend frameworks available to developers for building web applications. However, with so many options, it can be difficult to determine which one is the most performant, and stable. In this article, we will compare the performance, stability, and concurrency of the top 6 most performant backend frameworks for 2023, namely:
To compare these frameworks, we created a custom endpoint in each framework that intentionally throws errors when called. We then used Apache JMeter to simulate a large number of requests to this endpoint at different levels of concurrency.
We tracked the percentage of requests that returned a 500 status code as a measure of the error rate for each framework. To compare them, we used the following metrics:
Requests per second (RPS): This metric will measure how many requests each framework can handle per second.
Average response time: This metric will measure the time it takes for each framework to respond to a request.
Error rate: This metric will measure the percentage of requests that return an error.
CPU usage: This metric will measure the amount of CPU usage each framework requires to handle requests.
To ensure consistent results, we limited each framework to running on a single CPU core, and we repeated the test multiple times.
Loading graph...
Framework | Requests per Second (RPS) | Average Response Time (ms) | ErrorRate (%) | CPU Usage (%) |
---|---|---|---|---|
Actix web | 4606.25 | 20.67 | 0.00 | 50.98 |
Gin | 4156.25 | 23.09 | 0.00 | 52.89 |
Express | 3212.50 | 31.09 | 0.02 | 51.83 |
Spring Boot | 2575.00 | 38.89 | 0.03 | 47.56 |
Django | 2125.00 | 46.95 | 0.12 | 39.15 |
Ruby on Rails | 1862.50 | 52.75 | 0.21 | 48.77 |
As we can see, Go with Gin and Rust with Actix Web had the highest requests per second, lowest error rates, and lowest average response times. Node.js with Express also performed well in these areas. Python with Django and Ruby on Rails had the lowest requests per second and the highest error rates and average response times.
When it comes to CPU usage, all frameworks were relatively similar, with Go with Gin having the highest CPU usage and Python with Django having the lowest.
Based on our comparison, Go with Gin and Rust with Actix Web are the most performant and stable backend frameworks, with Node.js with Express as a close third. However, it’s important to note that each framework has its own strengths and weaknesses, and the best choice for a particular project will depend on a variety of factors, including project requirements, team expertise, and available resources.