Extracting implementations into services
Having low-level implementation separated from the application-level interface via intermediate abstractions has one more interesting positive effect worth mentioning in this book.
When the abstraction distance is high, it can be possible not only to switch from one implementation library to another in a Ruby application but also to move the implementation, and even some infrastructure abstractions, to a separate service without affecting the rest of the application’s code base.
What could the motivation for splitting a majestically monolithic Rails application into multiple services be? Performance. There are some load scenarios in which Rails and Ruby do not act as the best performers. Extracting low-level, logic-less functionality into a heavily optimized service away from Rails can drastically increase the scalability of your application, and proper abstractions can make performing such a migration transparent
Let’...