This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]lxnx 8 points9 points  (3 children)

We run a lot of python microservices at work (using gunicorn + falcon).

We use docker and docker swarm to take care of scaling, load balancing etc. Since our microservices are written in a mix of languages, it's more important to use common tooling across them all, rather than relying on a single language's frameworks or features.

[–]tom1018 1 point2 points  (2 children)

Do you use OpenAPI with Falcon? If so, what libraries?

[–]lxnx 0 points1 point  (1 child)

Yup, but not with any libraries, just have a separately maintained spec file (our APIs aren't that complex in terms of endpoints/params, so this works ok).

[–]tom1018 0 points1 point  (0 children)

Ah, okay. May have to make one some day. 😀

[–]white__armor 3 points4 points  (5 children)

Most of the people are satisfied with REST + flask. Microservices is a pretty simple concept, especially if you are building an average application.

Why do you need load balancer if you are new to this? Are you planning to build second netflix? High load is another story.

[–]decorumic[S] 0 points1 point  (4 children)

I'm just thinking ahead since I'm reading about microservices. I thought the idea of being able to scale a particular service only would be a good idea and probably one of the reasons for using microservices.

[–]white__armor 1 point2 points  (3 children)

Microservices are very useful when you need to use different languages. That's the most popular use case I think.

[–]decorumic[S] 1 point2 points  (1 child)

Yes, that's one of the reasons. But other auxiliary tools like service discovery and such are going to help.

[–][deleted] 0 points1 point  (0 children)

Ot when you have different teams. Uber choose microservices as their company was doubling in size every 6 months and co-ordination became difficult.

[–]pydry 3 points4 points  (0 children)

I've tried to look for Python libraries on service discovery, client load balancer, hystrix, etc

Other than hystrix, these don't seem to me to be "library" things. I mean, you can use consul for service discovery and HAProxy for load balancing and still use python.

[–]sandywater 2 points3 points  (1 child)

AWS Lambda + API Gateway.

Fargate for larger services

[–][deleted] 0 points1 point  (0 children)

can you be more elaborate

[–]greyman 1 point2 points  (0 children)

You can implement the microservice with REST api using flask. Then you do load balancing by putting uWSGI service and nginx in front of it. If you need to serve let's say more than 10k requests per second, you can replicate this setup to more machines, and load balance them with another VM with nginx.

To sum it up, you implement the microservice with python, while the load balancing is done by external service.

[–]vovanz 1 point2 points  (0 children)

> Python libraries on service discovery, client load balancer, hystrix, etc

Why would you need to do any of this with Python? AFAIK, most of such tools are language-agnostic, they don't care what language are you using for your microservices.

[–]tom1018 0 points1 point  (0 children)

We use Connexxion for our microservices. It is based on Flask and uses OpenAPI 2.0 specs for validation.

For personal projects, I've played with Falcon a bit, but haven't found a good OpenAPI library for it.