[web2py] Re: New web2py/pydal feautures for scalability

2018-08-10 Thread villas
This is a very welcome feature for scaling.
Thanks Joe for your super-helpful post,  I wish I had read it first!  :)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: New web2py/pydal feautures for scalability

2018-08-07 Thread Joe Barnhart
It took me a minute to decipher this post!  For the elucidation of others 
let me rephrase what I think you wrote...

Some users may not like STORING (not "strong") data in the filesystem. 
 Storing filesystem data is a bad idea when deploying the same website 
across multiple servers, i.e. it hinders "scalability" in web deployment.

You can now store the table definitions (currently in the "databases" 
directory of your web2py application) into the database itself.  This eases 
the problem of scaling the application at the cost of a little complexity. 
 First off, store "session" data on the user's web client by putting 
session data directly in the cookie.  Then configure DAL to store the 
"metadata" (i.e. "*.table" files) in the database itself, as shown below...

If I got it wrong, please let me know.

-- Joe

On Sunday, August 5, 2018 at 6:43:00 PM UTC-7, Massimo Di Pierro wrote:
>
> Some of you may not like using the filesystem for strong data. In 
> particular that is not a good solution for scalability. Now you can do:
>
> myconf = AppConfig(reload=True)
> # always store sessions in cookies
> session.connect(request, response, cookie_key=myconf.get('app.cookie_key'))
> # store metadata tables in db
> db = DAL(myconf.get('db.uri'),
>  pool_size=myconf.get('db.pool_size'),
>  migrate_enabled=request.is_local,  # trigger a migration when 
> called locally
>  fake_migrate_all=request.is_local and request.vars._fake, # 
> trigger a fake migration when passing ?_fake=1
>  adapter_args=dict(migrator=InDBMigrator), # store metadata tables 
> in db itself
>  check_reserved=['all'])
>
> Notice that if you change your code to do this in an exiting app, you must 
> run a fake migration.
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.