top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

RoR: separate the db DBA user and the db app user

+2 votes
312 views

How can I separate the database DBA user and app access user in rails? The app user will be able to run the app but perform no DDL. The DBA user will be used for migrations.

I do not want the user that runs the rails app to be able to create, drop or modify database objects. This type of user access-rights separation is a pretty minimal best practice and I am concerned that this does not seem to be the norm in the rails world. What am I missing?

My current thinking is that I should create 2 stanzas per database in the database.yml file. One for the dba user and one for the normal app user. Does anyone have any better suggestions?

posted Dec 30, 2013 by Sheetal Chauhan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

In your database.yml file, specify the DBA credentials in the development environment, and the "normal user" credentials in the production environment. Either don't run migrations on the production server, and use a different technique to update the schema there once you have settled on your DB structure, or change the password in the yml file to the DBA for installation/upgrades, and return it to "normal" once you have things working in production.

answer Dec 31, 2013 by Amit Parthsarthi
Similar Questions
+2 votes

I have couple of databases named as abc, xyz. If I want to use database "xyz" then type command "use xyz". Command in console show output as "switched to db xyz" but still an user uses commands start with "db" rather than actual name "xyz" why ?

+1 vote

I deployed one small app in heroku built on ROR, now I want to send mails. How is it possible can anyone give me a details how to do it.

+1 vote

My Ruby on Rails App needs to connect to a ODBC Datasource that has SSL only enabled.

Can somebody give me an example of connecting to a ODBC Source with SSL?

I constantly get SSL required error. I don't see the option of passing SSL Certificates via UnixODBC. May be something I am missing.

+2 votes

How to convert utc time to a time in a particular time zone. As I need to display local time of Timezone(-05:00).

...