3 ms·
We have a lot of internal APIs written using Sinatra. I first started writing my APIs using Sinatra about 10 years ago. I had started with Rails when it first
by cortesoft 4y ago
We have a lot of internal APIs written using Sinatra.
I first started writing my APIs using Sinatra about 10 years ago. I had started with Rails when it first came out around 2005, liked it, but then ran up against a lot of issues. Sinatra and the Sequel gem were amazing so I switched to that, since I didn’t need most of what Rails had.
Now I just use those two out of habit. Rails is a LOT better now, but i still just reach for Sinatra and Sequel usually.
- LanceH 4y agoI see a good bit of Sinatra out there in the wild for exactly this -- API only services. I even see it in shops that are running Rails everywhere else. It does seem to be much more the exception than the rule. But it may be getting more common with kubernetes deployments which make lots of individual services a bit easier to manage.
- hk1337 4y agoI really like Sinatra but a lot of the Rails improvements kind of took away some of the benefits of using Sinatra over Rails.
- cortesoft 4y agoI believe it. I keep reading about Rails improvements but haven’t really tried it in anger in a long time. I started with Rails when migrations were just .sql files you wrote by hand. I switched to Sinatra mostly to use Sequel, because ActiveRecord at the time would do horrible queries unless you wrote them by hand. I know they have solved that issue, so I should try Rails again… but my Sequel muscle memory is pretty strong at this point.
- hk1337 4y agoIt's not just Sinatra. Devise, AFAIK, has been a staple for authentication and authorization and rails (or at least in blog posts it has) and in Rails 7 it seemed like it complicated things more than helped and I can do all the secure handling pretty easily in Rails.
- yamtaddle 4y agoSinatra + Sequel is the only way I've ever loved using Ruby for Web development. After extensive contact with Rails across several projects, I've... concluded I simply cannot enjoy using it, is a nice way to put it, I guess. Sinatra + Sequel is a delight, though.