r/CreateMod • • 11d ago

Discussion Microservices-based factory

Hi all!

I attempted to build a universal factory based on a microservices architecture. Each operation involving items constitutes an isolated place, which is linked to others via a system of "frog-based" logistics. Factory gauges define the sequence of operations, while chain transport the results of each microservice.

Overall, the concept is quite workable, but there is one annoying nuance. Since the factory is universal, it should be capable of producing any item, provided the chain is set up correctly. However, the mechanisms within each microservice do not know what specific item they are currently producing; they simply perform their own primitive tasks.

I’ve also run into an issue with getting the results out of the mechanism. Since the item varies each time, I can’t set up filters on the chutes or funnels. A chute can extract both output and input ingredients from a mechanism. In other words, ingredients arrive in a microservice's input buffer and are placed onto a depot, saw, basin or similar component; the output chute then simply picks up those incoming ingredients.

Is there any way to set filters dynamically ? Or perhaps a way to prevent the retrieval of incoming ingredients ? Or perhaps there are other ways to carry out my idea that just haven’t occurred to me?

3 Upvotes

13 comments sorted by

View all comments

3

u/912ehd 10d ago

Im doing this in my creative world right now. There are two options as far as ive figured out.

  1. Instead of each microservice giving results directly to other microservices, it should send it to a central warehouse and the next microservice in the chain should request that item from the central warehouse and not the other microservice.
  • pros: centralized item management, easy extendability
  • cons: inefficient item transfer through each microservice
  1. Or each microservice should own its own seperate warehouse and store its output there, and any other microservices that need that exact item should request from that warehouse specifically.
  • pros: efficient item transfer through each microservice
  • cons: logistics network might be hard to set up, decentralized item management.
  1. Extra tips
  • Use trains for inter micro-service transportation. Since chunks arent loaded between each production site(only the production chunk itself), item routing and transfer must happen through unloaded chunks. Trains, bee ports work through unloaded chunks, but chains, belts and frog ports do not.
  • Check your electricity mod if it transfers power between unloaded chunks. Electro energistics, power grid do. Crafts and additions do not.

2

u/912ehd 10d ago

Extra tip 3. Use attribute filters on saws, basins, if there are multiple outputs for one type of input. For example a log through a saw produces stripped logs or bark. Set it to an attribute of stripped log if you want just that

1

u/Calaquare 9d ago

I built a pretty big system using the centralized design before. It works well enough most of the time (as long as you're not trying too many concurrent operations. It is a very big mess if the chain overloads)