So, been meaning to ask and clarify this for a while.
Say you own a very popular website (example.com). Or maybe this website is a web system that acts as a api for some app(s). Anyway so the question is, if you are expected to get more traffic than a server can handle for a website or such system, how would you go about setting up a load balancer?
Are there anyway to host the same domain/website at multiple servers and and do something tricky at the DNS level to direct traffic to the different server (load balancing). If so, how would you go about it, any DNS hosts like cloudflare offer this, if so how would you set this up? Also, how would you define logic, about who gets directed where/when?
Next, on this sort of approach, how would SSL work? Multiple IP addresses for same domain, how is that going to work?
Lastly. If the said system relies on a database, let's say its an api for something (so let's also say the data changes often). How would you go about keeping this dB synced? I suppose this might be a programming question, I know few ways, but if anyone know some good effective ways, I'm all ears :)
Thanks in advance :)