ServiceStack and Batch Processing at scale

8/1/2018

This question is potentially more stylistic that programmatic although it does have implementation implications.

I have a ServiceStack microservices architecture that is responsible for processing a potentially large number of atomic jobs. I'm comfortable with the Service Gateway in combination with Service Discovery and have this running. In order to best orchestrate the individual jobs, there are a couple (I'm sure people will suggest more and alternatives) of patterns I can follow and my code is such that I could lean either way. Do people have experience or preferences for particular model to process these large batch jobs?

The impact is potentially more on how I define the Swarm/Kubernetes management for the containers.

Option 1 Inbound method responsible for divide and conquer

The load management in this case is primarily the responsibility of the cloud infrastructure

Option 2 Marshaller responsible for divide and conquer

The main difference here is in the persistence layer, job recovery and in effect the Marshaller being responsible for dynamically spooling up containers as necessary to do the work and bring them down when complete. There will be latency in bringing up Worker pods but you could go as crazy as 1 pod per job and then tear it down again (with an understanding of the overheads in doing so).

I can't help but feel that when approaching Microservices, that when scaling out to cloud scale that some of the orginal GoF patterns still apply or I'm feeling nostalgic (Abstract Factory for example)

Please excuse the rough 'marketecture' drawings, was hopefully enough to convey the concept.

-- sturmstrike
architecture
docker
kubernetes
servicestack

0 Answers