Ruby services as a different layer

Is it good practice to use services as a layer between logical controller and database model, so that I can easily migrate to third party database in future if I have to. Are there any other better ways to solve this problem?