Swift Backend with CouchDB: Kitura vs. Vapor vs. Node.js
I made few test projects to implement API for my simple app to run some benchmarks. It just makes 1 request to Database and returns JSON data.
All projects was executed on Linode VPS in London:
- 2 GB RAM
- 1 CPU Core
- 125 MBPS Out
- Ubuntu 16.10
- MySQL and CouchDB with equal data (about 13k rows/documents)
Benchmarks was run on another, more powerful dedicated server in Germany using wrk:
wrk -t4 -c20 -d5m https://my_url
Results are very different from another benchmarks by Ryan Collins.
What did I try:
- Node.js 7.0 + MySQL 5.7.16
- Node.js 7.0 + CouchDB 2.0 (via node-couchdb)
- Vapor 1.1.11 + CouchDB 2.0 (via HTTP)
- Kitura 1.1.1 + CouchDB 2.0 (via Kitura-CouchDB)
Requests per second
Results are very disappointing for me. Node.js was 50% faster than Swift. It looks like it's still not right time to make backends on Swift right now, unless you don't expect hight load and just want to write in Swift.
UPDATE: after about a month I run another tests for new version of Vapor (1.2.5) vs. Node.js and Vapor was very very fast. So now I'm very optimistic with using Swift as backend.keyboard_return back