librelist archives

« back to archive

High Availability a Web App

High Availability a Web App

From:
Jonathan Chen
Date:
2011-12-18 @ 08:09
Hey all,

I am going to start working on a project that would need to have my Flask
App High Availability. My setup will be nginx/loadbalancer/reverse proxy,
two app servers, and a clustered Database.

Anyways, this will be the first time for my web app career that I had to
build something with a requirement for High Availability. So I was
wondering how do I make sure that sessions persist across both application
servers? I looked on the internet and found this on stackoverflow

http://serverfault.com/questions/32421/how-is-session-stickiness-achieved-across-multiple-web-servers

Which one do you guys recommend? How would you do it too? I am looking into
the third option maybe using redis? Just wondering what some of your
thoughts about this.

~Jonathan C.

Re: [flask] High Availability a Web App

From:
Jökull Sólberg Auðunsson
Date:
2011-12-18 @ 09:55
The default session storage is simply an encrypted cookie stored in the
browser so persistance is achieved without any backend solution. If you
need to store a large amount of information per session object you could go
with redis, although you'd want to make sure the total number of objects
can fit in memory otherwise the redis speed advantage starts to
disappear.[^1]

[^1]: See discussion about dataset sizes http://redis.io/topics/faq

On Sun, Dec 18, 2011 at 8:09 AM, Jonathan Chen <tamasiaina@gmail.com> wrote:

> Hey all,
>
> I am going to start working on a project that would need to have my Flask
> App High Availability. My setup will be nginx/loadbalancer/reverse proxy,
> two app servers, and a clustered Database.
>
> Anyways, this will be the first time for my web app career that I had to
> build something with a requirement for High Availability. So I was
> wondering how do I make sure that sessions persist across both application
> servers? I looked on the internet and found this on stackoverflow
> 
http://serverfault.com/questions/32421/how-is-session-stickiness-achieved-across-multiple-web-servers
>
> Which one do you guys recommend? How would you do it too? I am looking
> into the third option maybe using redis? Just wondering what some of your
> thoughts about this.
>
> ~Jonathan C.
>