No sync is required, there are two mongoTemplate's available all the time default one or @Primary i.e "mongoTemplate" and the other is "mongoTemplateShared".

For shared/global all we have to do is annotate it with @SharedCollection then query made to those collection "mongoTemplateShared" will be used.

For the rest "mongoTemplate" will be used i.e dynamic in nature will query there respective tenant DB's.( @EnableMongoRepositories we explicitly say for which all repository bind this specific template check MultiTenantMongoAppConfig and SharedMongoConfig)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store