# Distributed models

**URL:** <https://www.ruby-forum.com/t/distributed-models/170073>\
**Category:** Rails\
**Created:** [June 11, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/distributed-models/170073 "2009-06-11T23:32:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://www.ruby-forum.com/u/slava)\
**Post date:** [June 11, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/distributed-models/170073/1 "2009-06-11T23:32:12Z")

</div>

Hello,  
I am designing a web application that has several tiers including a  
Flex client, Rails server and SAP back-end. The application is an  
extension of functionality offered by SAP system. SOAP based web  
services are used communicate with the back-end.  
I am pondering on the implications of the fact that some of my data  
models are likely to be in the back-end and some in the Rails  
application and some are distributed (shared) between Rails and the  
back-end. I would appreciate any pointers toward relevant knowledge on  
this subject and if anyone tried something similar with Rails.  
Some of the questions I have to find answers to are:

- How does one use ActiveRecord with shared models?
- What are the implications of this type of distributed design?
- Relevant design patterns.

thank you,  
Slava

---

<div class="post-metadata">

**Author:** ![slava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://www.ruby-forum.com/u/slava)\
**Post date:** [June 12, 2009, 4:41am UTC](https://www.ruby-forum.com/t/distributed-models/170073/2 "2009-06-12T04:41:17Z")

</div>

On Thu, Jun 11, 2009 at 6:30 PM, slava[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> - How does one use ActiveRecord with shared models?

You don’t, ActiveRecord is for relational databases only. If your  
backend support REST-style web services, you can use ActiveResource  
that looks like ActiveRecord.

> - What are the implications of this type of distributed design?
> - Relevant design patterns.

You’ll find a discussion and many patterns related to this at  
“Patterns of Enterprise Application Architeture” and “Domain Driven  
Design” books.

- 

Maurício Linhares  
[http://codeshooter.wordpress.com/](http://codeshooter.wordpress.com/) | [http://twitter.com/mauriciojr](http://twitter.com/mauriciojr)

---

<div class="post-metadata">

**Author:** ![slava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://www.ruby-forum.com/u/slava)\
**Post date:** [June 12, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/distributed-models/170073/3 "2009-06-12T17:56:32Z")

</div>

Fine answer thank you much for your help.

- 

[http://www.vaunce.net](http://www.vaunce.net) web directory

---

<div class="post-metadata">

**Author:** ![slava](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://www.ruby-forum.com/u/slava)\
**Post date:** [June 12, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/distributed-models/170073/4 "2009-06-12T21:46:40Z")

</div>

thanks,  
My back-end does not support REST web services. It supports SOAP web  
services, so I can not use ActiveResource.  
Since I posted this question, I found sap4rails library that replaces  
ActiveRecord with SAP3Rails. The library looks like it was not  
modified since 2007, so I am wondering if it is up-to-date. I wonder  
if anyone has worked with sap4rails and if it is a good solution for  
integrating with SAP back-end.

thanks,  
Slava
