# Stateful Ruby on Rails?

**URL:** <https://www.ruby-forum.com/t/stateful-ruby-on-rails/130046>\
**Category:** Rails\
**Created:** [February 24, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/stateful-ruby-on-rails/130046 "2008-02-24T21:55:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgbr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lgbr](https://www.ruby-forum.com/u/lgbr)\
**Post date:** [February 24, 2008, 9:55pm UTC](https://www.ruby-forum.com/t/stateful-ruby-on-rails/130046/1 "2008-02-24T21:55:26Z")

</div>

I’ve done developing in several different web languages now. I’ve come  
across a problem which might entail some background processing. One of  
the things that really excited me about Java was the ability to create  
servlets. Small little applications you write that are running in the  
background and have a get() and post() function that your program  
responds to. This would allow me to use threading in my web  
applications. It also allows me to maintain some data in memory, rather  
than pull it from the disk with every request.

Is there something equivalent available for RoR?

---

<div class="post-metadata">

**Author:** ![lgbr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lgbr](https://www.ruby-forum.com/u/lgbr)\
**Post date:** [February 24, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/stateful-ruby-on-rails/130046/2 "2008-02-24T22:15:54Z")

</div>

Benjamin Waldher wrote:

> Is there something equivalent available for RoR?

Store intermediate data in the database, and store their ID in your  
session[].  
Don’t store whole objects in the session (though it lets you think you  
can),  
because that doesn’t scale very well.

If you really really reeeeally need to multitask, get backgroundrb. But  
try real  
hard to timeslice your activity up instead, using a timer.

Also look at the cron system!

–  
Phlip
