Elkarte
Elkarte copied to clipboard
[2.0] Use stash for the cache
http://www.stashphp.com/index.html
Probably a good idea so as to not reinvent the wheel as much by using a popular, well tested library.
nods ... I think @joshuaadickerson was recommending to use this as well, looks like a very smart way to go!
intresting solution, but one thing is concerning me. This is the lock() thing, if i understand correctly: this mean you cant read data so long the data is generated. One db side would this mean you got "table/dataset" lock and can't read data so long the data is changed. And this kind of waiting didn't exists in pg world.
Following situation got i in my mind: A process change data (lock thema) and now another user want read them and had to wait until the first user is done, when you do this whitout stash in moment the second user is provided with data without waiting for the first user which would mean the not stash approach would be in this "special case" faster.
sorry you high? This isn't sql, rather, a replacement for the caching subsystem.
http://www.stashphp.com/API.html#lock
It's something you can do to stop stampedes. It doesn't lock anything
On Dec 2, 2016 6:25 PM, "John Rayes" [email protected] wrote:
sorry you high? This isn't sql, rather, a replacement for the caching subsystem.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elkarte/Elkarte/issues/2768#issuecomment-264589870, or mute the thread https://github.com/notifications/unsubscribe-auth/AAL6D9OsLpTTYVgvst4riSyUxJ_8LnB-ks5rEKjrgaJpZM4LCEhv .
This information was missing to me: // Check to see if the cache missed, which could mean that it either didn't // exist or was stale. If another process is regenerating this value and // there is a stored value available then this function will return a hit.
I was expecting that the other process hat to wait until the first process is done with regenerat of the new value