Re: [web2py] Re: horizontal scaling question

2018-01-08 Thread Anthony
On Sunday, January 7, 2018 at 2:45:30 PM UTC-5, Massimo Di Pierro wrote: > > I am curious whether anybody has actually tried this. > > I am concerned about a few things that can go wrong: > 1) even GET request may write to the DB (maybe write session in DB or > logging some action) > Yes, obvious

Re: [web2py] Re: horizontal scaling question

2018-01-07 Thread Massimo Di Pierro
I am curious whether anybody has actually tried this. I am concerned about a few things that can go wrong: 1) even GET request may write to the DB (maybe write session in DB or logging some action) 2) all web2py requests are wrapped in a transaction, can this cause deadlocks? 3) there is a delay

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Anthony
Something like that -- it depends on what is easiest. If writing happens in only a few places, then you can maintain a list of the functions that do writes rather than those that only do reads. You could also take Dave's approach and use the HTTP method to determine the connection: READ_ONLY_UR

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Chinh Dang
So given the example below from the book, I would add all the controller functions that does database read to read_only_actions list? I would have to continuously maintain this list as my application grows. Is this the right approach? if request.function in read_only_actions: db = DAL(sample(['

Re: [web2py] Re: horizontal scaling question

2018-01-06 Thread Dave S
On Friday, January 5, 2018 at 7:50:28 PM UTC-8, CDA wrote: > > How does web2py select a database to connect to based on the http request > content? Is it feasible to connect to different databases depending on > whether it is a read request or a write request? Can you provide example on > how

Re: [web2py] Re: horizontal scaling question

2018-01-05 Thread Chinh Dang
How does web2py select a database to connect to based on the http request content? Is it feasible to connect to different databases depending on whether it is a read request or a write request? Can you provide example on how to do this? On Fri, Jan 5, 2018 at 6:35 PM, Anthony wrote: > Do you hav

[web2py] Re: horizontal scaling question

2018-01-05 Thread Anthony
Do you have doubts about whether it would work? Seems fairly straightforward. On Friday, January 5, 2018 at 3:59:29 PM UTC-5, CDA wrote: > > > Below is an excerpt about horizontal scaling from Chapter 13 in the book. > Has any one successfully implemented this using web2py? > > It is also possib