There are a lot of considerations when looking at where a production environment should be deployed.

The first question that comes to mind is whether we can “get away with” one production instance or need to support multiple production instances by region or even country/division.

Additional factors apply:

  • Latency, weighted by number of workers in each location/geo
  • Licensing: every user needs a license in every production instance they access.
  • IT management/governance for: multiple code bases, multiple configurations, consolidated reporting, consolidated financials, interfaces, security by environment
  • Multiple geographies to support, either with one instance or multiple instances.  Multiple instances may provide better flexibility at the cost of additional overhead.
  • Functionality implications, such as automated or manual inter-company transactions, consolidated financials, consolidated planning, and consolidated reporting.

This is not an exhaustive list by any means… I’ve personally lead countless conversations around this topic and would be happy to talk with you!!  But I wanted to optimize the selection process.  I mean, once we have the functional requirements down, let’s explore what would be the lowest latency option for our global user base.  I could have used Excel and Power BI, as I have for the past 10+ years… but with the AI age, I felt I needed to modernize.

So I set out using OR tools solver (AI) in Python to answer this question.  I had used the same for scheduling soccer tournaments personally, but I wondered whether it could be used in this context. Instead of going line by line, I will explain how these solver AIs work.

1. First you have constraints.  These are the non-negotiable requirements.  When buying a car, no matter what it needs to be petrol-powered, and have a certain size.  Any “solution” otherwise I wouldn’t consider.

2. Second, you have some variables you want to optimize for… I want to maximize my trunk space, while minimizing the cost.  ((The constraints must be true too.))  This is the optimization function.

3. Finally, let’s see if we have an answer, and if so let’s celebrate, but if not, we have to re-evaluate all of our assumptions, constraints, and optimizations.

Please check out my code which shows the above supporting the determination of where to host Dynamics 365: See the code

The code won’t accept a latency greater than 450ms, but still optimizes for the latency, and that means it likely will be within the ideal (<200ms).  Additionally, the code can be adjusted, whether you would accept or desire 1 or 2 or even 3 production instances.

For now, it does not solve for statutory requirements.  To handle that, I would change the latencies input to be a “score” based on a formula of the requirements (user count, statutory requirements, business importance, …).  Certainly too the inputs could be from a CSV and not hard-coded.

I hope this incites an interest in understanding this problem, and also the AI solution.  Feel free to engage with me on Twitter, LinkedIn, or directly via email should we already know one another.