When comparing Rack vs Rails API, the Slant community recommends Rack for most people. In the question“What are the best Ruby microframeworks?” Rack is ranked 3rd while Rails API is ranked 4th. The most important reason people chose Rack is:
Rack is great at separating the different stages of a request, allowing developers to easily follow separation of concerns, a key goal for any well designed software.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Separates concerns
Rack is great at separating the different stages of a request, allowing developers to easily follow separation of concerns, a key goal for any well designed software.
Pro Great ecosystem
There's a great community and ecosystem built around Rack. You can easily find pre-built components to do almost anything you are planning to.
Cons
Con Not great for large complex applications
Rack is a very bare-bones middleware useful for easily creating REST APIs without too many bells and whistles. As such, it may prove useless to build a complex web application that relies on the backend for most of its operations with Rack.