Visitor's probability to purchase on eCommerce site, based on aggregate historic data
This is a big topic known as Recommender Systems or Recommendation Engines.

The most common method is use what is known as collaborative filtering. Most methods on the internet try to guess what the user will rank an item, but I think this can be extended to if the user will make a purchase or not, given that if a user were to rank something highly they would also be more likely to buy that item.

The idea is that each item has a n-dimensional vector, and each user has an n-dimensional vector. You can predict a user's predicted rating by some operation between the two vectors. In this example lets use the dot product between the two vectors as a means to predict the user's rating for an item they haven't yet seen.

While taking the 2 vectors and getting a prediction is not a machine learning problem, finding suitable values for the vectors is most definitely a machine learning problem. I won't get too deep into how you can get these vectors because many different algorithms apply and it seems that you are asking more of a system design question.

Once you have trained 1 vector for each user and 1 vector for each item, you have 2 more problems to solve:
1. Estimate the top N candidate items to recommend
2. Take the dot product between each of these N items and recommend the few with the highest score.

Number 1 will likely involve some use of spatial indexing in your database (example PostGIS for PSQL) so you can find some vectors that would give reasonably good dot-products. You may want to consider using a ball tree data structure to search for a good set of candidate items.

Number 2 will be pretty simple by just dotting the vectors and picking the best few.

It will be a big challenge for you to undertake but I'm certain you'll learn a lot. Since it was such a big system you want to create I wasn't able to go into detail but hopefully, I pointed you in the right direction.