I have an app, lets call it MyApp, that I would like to run in cluster on lets’ say 3 nodes (but it can be 2, 5, 10, any number of nodes). Each instance of MyApp is independent from the other instance - each gets its set of initial data, that needs to be stored in DB so it can be accessed by MySecondApp.
So, to summarize,
- There is some initial data in DB, it is accessed by MySecondApp
- MySecondApp can operate on initial data, add/update/delete
- There are instances of MyApp - each instance gets part of initial data - they are independent. I was thinking that MySecondApp reads all initial data and serves as coordinator. But it needs to know which instances exists. Does Docker that provide? MySecondApp gets all instances of MyApp (service registry) and initializes one by one. Should I implement this as custom solution or can use some framework?
- If initial data is updated via MySecondApp, changes need to be propagated to the MyApp instance that is operating on that data
- (Optionally) If additional data is added, I can create new instance of MyApp that will handle that added data
I am now looking into Docker to see what features it provides to run my scenario. So far, I understand that by using Docker Swarm I can start 3 instances of MyApp on 3 nodes. However, I cannot find how can I provide each with initial data. It seems to me that I cannot use the “Docker Config” for this because, with MySecondApp I should be able to update initial data and changes should be propagated to correct instances of MyApp (those operating on that modified data).
What from the list above can be handled by Docker (Swarm)?
I am very new to all of this so any help would be great!