Before I proceed with how Nameko, a python framework makes microservice development, let have in mind that microservice is just another way developing software by building services or components separately from each other.
Assuming we have decided to build a Bus Ticketing System with the following components in mind:
- Register
- Login(Reset)
- Billing
- Booking
- Notification
- Verification
In a monolithic pattern, a team of software engineers would develop the following functions using a server-side language such as Ruby, Golang, Node.js or Python for all components.
These components would all reside on each instance of web servers backed by a load balancer such as Nginx to prevent DDOS attack.
However, in a microservice pattern, the structure is a bit different. These components could be developed with different server-side languages or frameworks.
Nameko as a microservice framework has made it possible for software developers to implement services with ease with the help of dependency injection.
Dependency injection by Nameko allows software developers to separate code for external entities such as databases, Cached systems from the services code.
For instance, the register
service and login
service could just call the insert()
function or query()
function from a mongodb
or postgres
database.
Also have in mind that both the register
service and billing
service may have a separate postgres
database to store users' details.
This is how nameko make microservice development quite flexible for software engineers without the hustle of clustering services with the backend code.
Top comments (2)
Hi Michael, I didn't know about this tool.
I'm going to link it here for future reference:
nameko / nameko
Python framework for building microservices
Nameko
[nah-meh-koh]
A nameko service is just a class:
You can run it in a shell:
And play with it from another:
Features
Getting Started
Support
For help, comments or questions, please go to <discourse.nameko.io/>.
Contribute
License
Apache 2.0. See LICENSE for details.
Have you used it in production? By looking at the README it seems like it's very RPC oriented. It's an interesting choice the one of using AMQP as an interchange protocol.
The drawbacks seem to be its requirement of RabbitMQ as a companion server and that by being built on eventlet you have to use special compatible libraries to do I/O.
It's a peculiar and different choice, I guess it also predates asyncio which seems the direction Python is going for async concurrency nowadays.
The DI pattern on which is built is neat, I'm not sure I would use it though, I have the feeling that it's going to be cumbersome to integrate with Nameko from clients written in other languages (though if you're a 100% Python shop it might be the right choice!)
A suggestion, I think your post deserves the following tags:
#python
#nameko
#microservices
Thanks, bro. Yes. I'm 100% python backend developer. I use nameko for small projects. yet to do so in production...hopefully this year
You can try it. It is awesome because of its dependency injection mechanism.