one database multiple sites

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

one database multiple sites

fugee ohu
i have the idea to use the same database for multiple sites but i guess each site needs it's own database in addition? Anyone  can guide me?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: one database multiple sites

Walter Lee Davis
There are a number of different ways you can manage this. One popular approach is to use the Apartment gem to create what is known as the "multi-tenant" database pattern. See if that term gets you closer to what your are looking for.

One database (or at least one schema) per site is the usual method, so maybe say a little more about why you feel that you need to have the same database for multiple sites. What makes these sites special, or what makes the number of databases constrained?

Walter

> On Mar 13, 2017, at 6:30 PM, fugee ohu <[hidden email]> wrote:
>
> i have the idea to use the same database for multiple sites but i guess each site needs it's own database in addition? Anyone  can guide me?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/02013FE1-1548-4E63-9EC2-3325CD5784BC%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: one database multiple sites

fugee ohu

On Monday, March 13, 2017 at 7:51:03 PM UTC-4, Walter Lee Davis wrote:
There are a number of different ways you can manage this. One popular approach is to use the Apartment gem to create what is known as the "multi-tenant" database pattern. See if that term gets you closer to what your are looking for.

One database (or at least one schema) per site is the usual method, so maybe say a little more about why you feel that you need to have the same database for multiple sites. What makes these sites special, or what makes the number of databases constrained?

Walter

> On Mar 13, 2017, at 6:30 PM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
>
> i have the idea to use the same database for multiple sites but i guess each site needs it's own database in addition? Anyone  can guide me?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

I want each app/site to have it's own database but i also wanna let them update a commonly shared database in addition to each apps own database

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7ec4af7b-2b68-4bf6-aad3-4152d2f42e21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: one database multiple sites

fugee ohu
In reply to this post by Walter Lee Davis


On Monday, March 13, 2017 at 7:51:03 PM UTC-4, Walter Lee Davis wrote:
There are a number of different ways you can manage this. One popular approach is to use the Apartment gem to create what is known as the "multi-tenant" database pattern. See if that term gets you closer to what your are looking for.

One database (or at least one schema) per site is the usual method, so maybe say a little more about why you feel that you need to have the same database for multiple sites. What makes these sites special, or what makes the number of databases constrained?

Walter

> On Mar 13, 2017, at 6:30 PM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
>
> i have the idea to use the same database for multiple sites but i guess each site needs it's own database in addition? Anyone  can guide me?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.
table has
The users "role" is the condition that determines which database the user will access  although in this case it's not roles it's just a field in the users table that says which database the user will be using

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8b108fe7-edb8-4728-b302-0ac9725ef522%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: one database multiple sites

Colin Law
On 14 March 2017 at 00:28, fugee ohu <[hidden email]> wrote:

>
>
> On Monday, March 13, 2017 at 7:51:03 PM UTC-4, Walter Lee Davis wrote:
>>
>> There are a number of different ways you can manage this. One popular
>> approach is to use the Apartment gem to create what is known as the
>> "multi-tenant" database pattern. See if that term gets you closer to what
>> your are looking for.
>>
>> One database (or at least one schema) per site is the usual method, so
>> maybe say a little more about why you feel that you need to have the same
>> database for multiple sites. What makes these sites special, or what makes
>> the number of databases constrained?
>>
>> Walter
>>
>> > On Mar 13, 2017, at 6:30 PM, fugee ohu <[hidden email]> wrote:
>> >
>> > i have the idea to use the same database for multiple sites but i guess
>> > each site needs it's own database in addition? Anyone  can guide me?
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Ruby on Rails: Talk" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to [hidden email].
>> > To post to this group, send email to [hidden email].
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
> table has
> The users "role" is the condition that determines which database the user
> will access  although in this case it's not roles it's just a field in the
> users table that says which database the user will be using

Why use multiple databases? Why not put it all in one database?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLv4dTzb2ZxLN_qFm5J3Xcb2%3Dqzh7OardH2-LDVqUB--rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: one database multiple sites

gorav
In reply to this post by Walter Lee Davis
The way I architect such Apps is by using centralized scope based authorization. It keeps the App clean and avoid bugs like dev forgot to scope the records in controller - controller can ONLY operate on records that are permitted for the current user. If somebody tries to access resource outside of what they are permitted, :not_found is returned rather than :unauthorized - works well for security and user experience.

It has worked well for most of my Apps including complex ERP solutions. Based on project requirements, you may want to use independent schemas (pg), though it might be overkill in lot of use cases.

On Tuesday, March 14, 2017 at 5:21:03 AM UTC+5:30, Walter Lee Davis wrote:
There are a number of different ways you can manage this. One popular approach is to use the Apartment gem to create what is known as the "multi-tenant" database pattern. See if that term gets you closer to what your are looking for.

One database (or at least one schema) per site is the usual method, so maybe say a little more about why you feel that you need to have the same database for multiple sites. What makes these sites special, or what makes the number of databases constrained?

Walter

> On Mar 13, 2017, at 6:30 PM, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
>
> i have the idea to use the same database for multiple sites but i guess each site needs it's own database in addition? Anyone  can guide me?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wW1SMXwRBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rubyonra...@googlegroups.com.
> To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com&#39;;return true;">https://groups.google.com/d/msgid/rubyonrails-talk/54a73f7c-f8c5-4474-92b5-80a4ca884146%40googlegroups.com.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1fdc807b-00a6-44a3-9d81-157a6c6cf5f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...