HAProxy Load Balancing + Central Master Database?
Added by d3fault d3fault about 13 years ago
Reading the HAProxy description, there's a nifty graphic demonstrating load balancing to several backend web servers that all use one master database: http://haproxy.1wt.eu/#desc
Is the configuration on http://redmine.webtoolkit.eu/projects/wt/wiki/Using_HAProxy_as_a_reverse_proxy set up for this? From casual observation it does not appear so.
I guess I should elaborate.. as the HAProxy configuration is probably not the issue. The Sqlite backend only opens local files... so it would seem that if I (for example) deployed the hangman example on the backend webservers, each one would have it's own high scores database.
Is the solution to use the Postgres backend instead... which supports remote connections? Has anyone tried this and had any luck with it? Is there any more to it aside from changing the db backend from sqlite to postgres (and of course setting up the postgres db on the remote server)?
Lastly, I also found this: http://sqlite.org/cvstrac/wiki?p=SqliteNetwork ... but I doubt it'll help (unless I/someone implement a new backend for them).
Replies (1)
RE: HAProxy Load Balancing + Central Master Database? - Added by Wim Dumon about 13 years ago
Hello,
You're right, sqlite is super-easy for simple installations, but does not support the load-balancing that you describe. Luckily, Wt::Dbo has other backends (Postgres, Firebird, MySQL) that are designed for remote access like demonstrated in the picture.
Switching the Database implementation in Wt::Dbo is indeed as simple as changing the backend. In the hangman example, this means that you modify Session.h and replace Wt::Dbo::backend::Sqlite3 sqlite3_;
to something more appropriate.