Hacker News new | past | comments | ask | show | jobs | submit login

They aren't really meant to accomplish the same goals, async and microservices. What I mean is, these are architectural choices. While at some level they may look interchangeable, they really aren't.

There's no 100% correct way to say when to use one or the other, but here's one way I would think of them.

Microservices are used to help define the architecture of your system overall. This is more ... high level. Async would be more at a process level.

So, for your example, you could have a flask microservice that exposed an interface that accepted a list of email addresses and a message to send to each. The request handler for that could then call a method using asyncio to send the emails. This would allow the microservice to remain responsive and wait for more requests.




Point taken. Much appreciated, thank-you




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: