# Basecamp Style multi-scoped database = cracked code!

**URL:** <https://www.ruby-forum.com/t/basecamp-style-multi-scoped-database-cracked-code/89769>\
**Category:** Rails\
**Created:** [March 22, 2007, 5:14pm UTC](https://www.ruby-forum.com/t/basecamp-style-multi-scoped-database-cracked-code/89769 "2007-03-22T17:14:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [March 22, 2007, 5:14pm UTC](https://www.ruby-forum.com/t/basecamp-style-multi-scoped-database-cracked-code/89769/1 "2007-03-22T17:14:57Z")

</div>

I’m the pesky guy that keeps posting questions aimed at understanding  
how to  
operate a web based business application that is able to serve (scope)  
many  
distinct users sharing a common monolithic database.  
I’ve finally come up with a database schema that accomplishes this in  
.xml  
or .png, and am happy to share this.  
Now, for my next question: Is there a way to call a Rails program from a  
Rails program?  
I am effectively creating a ‘Quarterback’ Rails program that based on  
user  
input and selected ‘project’ loads the user into the desired application  
accessing a set of distinct ‘scoped’ data. Obviously, the Session[]  
will be  
a passed along to this application and when they’re finished they’ll  
return  
to the ‘calling’ Rails program.  
I expect this is possibleÂ…has anyone ever done this? I’ve received  
responses  
saying to look at the System() method but that’s too ugly.  
Thank you,  
David  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [March 22, 2007, 7:53pm UTC](https://www.ruby-forum.com/t/basecamp-style-multi-scoped-database-cracked-code/89769/2 "2007-03-22T19:53:07Z")

</div>

Well, the current popular way of having rails apps talk to each other is  
to make them REST aware.

Rails 1.2 comes with a scaffold\_resource generator that sets up the  
controller for a domain object to be able to handle html requests or xml  
REST requests. I don’t mean to make REST sound simple though… there’s  
plenty o’ learnin’ to do there.

If your sessions are stored in the db, then you could probably pass the  
session id along with the REST request, although I’ve heard that future  
versions of rails will favor writing the entire session into the  
cookie… so that may not work with this approach.

But really, I’d question whether there’s some way you can get away from  
needing to use the session on the helper apps… it would probably be  
simpler for the main app to ask a helper app to do some work on it’s  
behalf without needing the session information at all.

Then again, if it’s just “helper function” sort of stuff that the other  
apps do for you, it might be better to look into backgrounddrb or a  
message queue and make that side work asynchronous.

Hope this is helpful… and not just incoherent ramblings…

b
