Architecture For Semi-Distributed Site?

I would like to improve UX by geographically distributing EC2-based web services. There’s a constraint, though, that some server processes be centrally managed. The overwhelming majority of network traffic would go to the nearest instance, and a smaller amount would go to a specific instance. For the latter of these, high performance is a lower priority.

I can think of several ways of implement this. I’m curious though as to what others here think, as I don’t yet have he benefit of designing this retrospectively.

I don’t think you’ve given enough information to comprehensively be given an architectural solution but my advice is don’t reinvent the wheel.

Use any of the CDN providers out there to do this for you.

If you want to stay in the AWS ecosystem CloudFront.

If you have to distribute your own content provider services I would personally want more information about the pages you are publishing. Like are they static? Can they sit on S3 and not an EC2 instance. What’s the underlying framework?

But I am also interested in other opinions so RemindMe! 3 days.

(Not sure if I can invoke the bot from here so using this as a test)

I will be messaging you in 3 days on 2022-08-08 02:02:55 UTC to remind you of this link

1 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

^(Parent commenter can ) ^(delete this message to hide from others.)


Most of the content is not cacheable. It’s generated dynamically, hence the need to generate it closer to the user. A subset of pages is pre-rendered for search engines.

Basically, I have static content, distributed APIs, centralized APIs, and an email server (also centralized). I’m using a well-known Python framework. Below are some ideas I’ve considered. All of them use Rt53 and place static content on CloudFront.

Architecture 1) Use a domain/subdomain model, where the domain points to multiple EC2s and the subdomain points to a single EC2. The distributed APIs would be put on the main domain, while the centralized APIs and email would go on a subdomains.

Architecture 2) use a spoke/hub design, where spoke EC2s forward data to a hub EC2 when necessary. With this design, EC2s can communicate over peered VPCs, and the need for an HTTP subdomain is eliminated.

Architecture 3) Use CloudFront as the main endpoint. Cloudfront would route requests to the appropriate instance. This could be a simple way to incorporate serverless components. Performance is uncertain though. Also, more monolithic frameworks (e.g. Django, Rails) provide solutions to a lot of common engineering problems, and, presently, the design ends up looking much like #1.