Hi Jonathan,

1. Is done by alchemy automatically
2. If you mean running SELECT EXISTS query, I don't do that
3. It's called lazy session, my library provides one
4. I had this on my mind, and might implement it, I just did not think it's 
very important

Regarding bots I can't comment - generally you have to assume that DB will 
always perform worse.
I had one feature in mind to implement hybrid mode where you could run 
cookie sesison for anonymous
and DB session for authenticated users, but it would require significant 
amount of code so I'm not sure.

On Monday, June 26, 2017 at 4:59:53 AM UTC+8, Jonathan Vanasco wrote:
>
> FWIW i'm not sure if this applies to your code or not, but a few things to 
> look out for in writing server-side libraries in pyramid:
>
> 1. make sure you're only 'writing' the session once (a few libraries had 
> written on each change)
> 2. a few libraries have done a preliminary check to see if a session 
> exists. it's best to just "load", and create a new session on a load 
> exception
> 3. it's also best to only write/create a session if you have data to store 
> (or edit).  a handful of libraries will create a session by simply 
> accessing/inspecting the `request.session` property.  
> 4. i found it useful to fingerprint a serialized version of the session, 
> and detect changes on nested data by that. that overhead was much smaller 
> than the load on Redis to store sessions that didn't really change.
>
> i've had problems in the past with spiders/bots nearly taking a site 
> offline from the effect of 100k+ hits in the span of a few minutes... each 
> one generating a new session.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/cb2e13e8-068b-4a5a-8a25-da0bc0d19e24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to