On May 7, 2012, at 10:35 AM, Anthony wrote: > If you just need to store data for a single user across requests, you can > store it in the session (each user has a separate session). But if you need > to store data from multiple users and then process it all together, you can > store it in the cache: http://web2py.com/books/default/chapter/29/4#cache.
That might be just slightly unsafe, don't you think, if a piece of data gets evicted before it's needed? I'd prefer to limit caching to data that can be recreated when it's not found in the cache. An alternative might be a memory-based SQLite database, taking care not to let it leak (a consideration regardless of the implementation). > > Anthony > > On Monday, May 7, 2012 11:27:30 AM UTC-4, cyan wrote: > > Hi group, > > Is it possible for one to store incoming user data (e.g. those submitted by > users on a page) in memory, manipulate them in memory, and send them back > with web2py? Or do I need to external modules/libraries to do that? So far, > it seems by default all user submitted data are written to database in web2py. > > More specifically, I want to implement this sort of logic on the server side: > the server waits for a pre-defined number of pieces data from different > users, and once all the data are in, the server processes the set of data, > saves the results in db and sends them back to respective users. > > The most obvious way I can think of is to keep (and track) the incoming data > in memory and only write to the db after they're processed. Is this something > that we can do using the existing functionalities of web2py? Thanks!

