Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to design background jobs in microservices architecture?

I am using microservices architecture. As per my requirements, there are some Restful services required and some background jobs to be developed.

For an example of Groceries delivery system,

  • Customers service - some restful service
  • Provider service - some restful service
  • OrderProvision - some background service which checks whether all of customer items got provided by different providers.

Once done, send an initiation to customer with the status and initiate delivery system to start delivering

For the case of OrderProvision what is the best way to implement microservices? In case of .Net framework, I can create a windows service/ scheduler task to run in background and do the checks. If it needs to be deployed on other servers like Linux, it does not work. What would be the best way to code such background tasks in microservices architecture?

like image 672
Nagendra Avatar asked Jul 12 '16 12:07

Nagendra


People also ask

What are the major design considerations of microservices architecture?

Being Stateless is a very important design principle for the modern applications which needs to scale on demand. The main idea behind breaking the complex application into multiple microservices is that they need to scale independently so while designing microservices we need to make sure that they are stateless.

Which design pattern is used in microservices?

Branch Pattern Branch microservice design pattern is a design pattern in which you can simultaneously process the requests and responses from two or more independent microservices.

What are the 3 components of a microservice?

A typical Microservice Architecture (MSA) should consist of the following components: Clients. Identity Providers. API Gateway.

What is microservices architecture?

Microservices are an evolved architectural pattern that involves the design and development of an application as a collection of small, autonomous, loosely coupled services that communicate with each other. At its elemental level, each individual microservice acts as an application in itself.

What are the most challenging design decisions in microservice architecture?

7.Asynchronous Communication: One of the most challenging design decisions in Microservice Architecture is how the services will communicate and share data among themselves. This is even more important when each Microservice has its own Data Storage. Typically, one Microservice can exist along but it cannot fulfill all the business goals alone.

How many people does it take to build a microservice architecture?

If an organization plans to develop Microservice Architecture, then it should make the team size accordingly (two “American” Pizza team: 7±2 person). Also, the team should be cross-functional and ideally will have Frontend/Backend Developer, Ops Engineering and Tester.

What is the best framework for building microservices?

ASP.Net, the .Net framework for web development makes it simple to build the APIs that becomes the microservices. It includes built-in support for building and deploying microservices using Docker containers. .


1 Answers

You can use task queues. Take a look at following article. Although it is for python, concepts can be adopted for other languages.

https://www.fullstackpython.com/task-queues.html

like image 174
atv Avatar answered Sep 24 '22 18:09

atv