Disillusioned with Java, many small startups are considering either Python or Node.js for their micro-services. This blog can help you decide which is right for you. I will explore what it is like to develop a rudimentary news feed micro-service written in version 3 of Python on Flask by comparing that experience with developing the same micro-service in Node.js
In the peer review process for the document below, people have asked these questions.
|You mentioned tornado and gevent but what about gunicorn and twisted web? Aren't those server backends available too?
|They are available for Flask but not for Connexion.
|If Flask supports more server backends, then why not just code to Flask? Why bother with Connexion if it is going to limit you?
|Connexion is the integration with Swagger which accelerates your time to value by automatically generating all the HTTP parts for both clients and server. In order to be a fair comparison, both services needed to have feature parity. Since the node.js service had a swagger integration, the python service had to have a swagger integration too.
|You mentioned that only one MySql driver would work with Python 3 and SQL Alchemy. Which driver was that?
|Precisely version 2.0.4 of the MySql Connector for Python. The latest versions had problems.
|Why didn't you test the Flask server running both multi-threaded and multi-process?
|I tried but that configuration is not supported. It wouldn't even start.
|Why not just run a second instance of feed5 on the same server but listening to a different port and have kong proxy requests to both?
|Because then feed4 and feed5 would have different deployments which would be an unfair comparison.
|Where can I find the outbound post source code for feed 4 and feed 5 that you compared?
|here and here
|What is cluster mode?
|A single instance of Node.js runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node.js processes to handle the load. The cluster module allows easy creation of child processes that all share server ports.
|What is Business Driven Development?
|Your unit tests are written more like a Domain Specific Language in the problem domain of the business.
Here are the links to the projects referenced in the document below.
|Flask integration with Swagger
|run micro-services in containers
|keyword based search engine
|Flask Sql Alchemy
|Flask integration with SQL Alchemy
|Flask unit testing framework
|cluster aware message broker
|Mocking library for Node.js unit tests
|Node Package Manager
|Use this to install dependencies for and start Node.js services.
|Use this to install dependencies for python services.
|IDE for Python
|programming language used to develop the feed 5 micro-service
|external memory cache
|Python SQL Toolkit and Object Relational Mapper
|single user SQL database that can plug into SQL Alchemy for unit tests
|MDSD for APIs
|Node.js swagger integration
|IDE for Node.js