NAVADMC / ADSM

A simulation of disease spread in livestock populations. Includes detection and containment simulation.
Other
10 stars 5 forks source link

Design New Base Server Architecture #527

Closed BryanHurst closed 9 years ago

BryanHurst commented 9 years ago

We need a quick to deploy (for automated hard deployment reasons) and scalable server architecture. The Apache and ModWSGI was a bit heavy and required compiling of MPMs.

BryanHurst commented 9 years ago

NGinx (engine-x) is more slim than Apache, and it has a more pluginable and scriptable configuration. Plus, it has a better solution for MPMs, so you don't need to compile different variants depending on the forking architecture you need.

BryanHurst commented 9 years ago

uWSGI allows for programmatically launching WSGI server instances (of Django projects) using Emperor mode.

BryanHurst commented 9 years ago

supervisord will keep the Emperor running.

BryanHurst commented 9 years ago

It is messy, but beautiful.

distributed-django-server-architecture

This is a secure implementation as well. All HTTP requests are handled by the www-data user which has access to nothing on the server (doesn't even have a folder for normal html hosting). The Django app is handled by the projects user which doesn't have access to http ports and can only modify project files. Communication between the two is handled by a unix socket that only forwards http requests.

boomtown15 commented 9 years ago

@BryanHurst - how is redundancy/fail over handled?

BryanHurst commented 9 years ago

The Frontend server can be duplicated in different server zones and the network router does load balancing between the different locations. So if for some reason one server goes down, failover to the other would be instant and not noticed with user sessions preserved between the two.

The Cloud Storage Buckets (where user files live) and the Database are both hosted by Google and have builtin backup and redundancy protocols.

boomtown15 commented 9 years ago

Perfect, thanks Bryan.