SlideShare a Scribd company logo
Copyright 2022 AppTweak S.A. All Rights Reserved
From Sinatra to Grape
How we are migrating
from Sinatra to Grape
and why?
Copyright 2022 AppTweak S.A. All Rights Reserved
Who am I?
- I've been with AppTweak since 2019
- Been using Ruby since around
2016. Before that, I was using C,
C++, PHP and other technologies.
- Have a few open-source projects,
the most used one being the
Mastodon/Twitter crossposter
(Rails + Sidekiq).
Renato "Lond" Cerqueira
Copyright 2022 AppTweak S.A. All Rights Reserved
#1 ASO Tool
for Apps & Games
Driven by Data Science
AppTweak fuels growth for the world’s most
popular apps and games by providing
actionable insights in a simple interface.
Copyright 2022 AppTweak S.A. All Rights Reserved
Recognized ASO Leader
ASO pioneer launched in 2014, trusted by 1,500+ mobile leaders in 70+ countries.
Tokyo
Bengaluru
Brussels
San Francisco
About our Dev Team
Copyright 2022 AppTweak S.A. All Rights Reserved
What did we need from Sinatra?
At Apptweak, we write endpoints for both internal and external use.
Documentation was a pain point, so we wanted to be able to use code annotations to
generate swagger output.
Our idea was that anything we wrote for parameter validation would output as
documentation.
We could not find anything like that for Sinatra.
Copyright 2022 AppTweak S.A. All Rights Reserved
What Grape offered?
Grape is designed with APIs in mind. It has parameter validation built-in with a lot of nice
DSLs.
It has a companion gem, Grape-swagger, which exports documentation based on the
parameter validation. It also allows for specific documentation overrides.
Grape is inspired by Sinatra. That means our devs will not have to get used to something
completely different.
Copyright 2022 AppTweak S.A. All Rights Reserved
Copyright 2022 AppTweak S.A. All Rights Reserved
Exploration tests and migration path
We did internal testing and confirmed that Grape did what we wanted it to do:
- It allowed us to validate our parameters
- It exported the parameters as swagger documentation
- The DSL was flexible enough that we could expand on it if needed
We would not, however, be able to convert all our endpoints at once:
- Most endpoints had no proper documentation, so they would have to be
documented as we migrated.
- Some endpoints had some documentation but it was written so long ago it was
most likely out-of-date.
Copyright 2022 AppTweak S.A. All Rights Reserved
Rack::Cascade to rescue
We decided to use Rack::Cascade to be able to migrate the endpoints in a timely manner.
We cascade the old Sinatra app and the new Grape API and we're then able to remove an
endpoint from Sinatra and re-create it in Grape for the migration.
Copyright 2022 AppTweak S.A. All Rights Reserved
Copyright 2022 AppTweak S.A. All Rights Reserved
Copyright 2022 AppTweak S.A. All Rights Reserved
Thank you!

More Related Content

PDF
Grape(Ruby on Rails)
PPTX
Ruby on Grapes. Why did we choose Grape and why I would choose it again
PDF
Finding Frank - Spotify API.pdf
PPTX
Ruby On Grape
PDF
The Grapes of Rapid (RubyConf 2010)
PDF
Rapid-ruby-api-on-grape
PPTX
Migrating from monolithic rails
PDF
Restful API On Grape
Grape(Ruby on Rails)
Ruby on Grapes. Why did we choose Grape and why I would choose it again
Finding Frank - Spotify API.pdf
Ruby On Grape
The Grapes of Rapid (RubyConf 2010)
Rapid-ruby-api-on-grape
Migrating from monolithic rails
Restful API On Grape

Similar to Lightning Talk: From Sinatra to Grape.pdf (11)

PPTX
Building RESTful APIs w/ Grape
PPTX
Building an API using Grape
PDF
Building Mobile Friendly APIs in Rails
PDF
Sinatra and JSONQuery Web Service
PDF
Api presentation
PDF
Sinatra: прошлое, будущее и настоящее
PDF
Using Sinatra to Build REST APIs in Ruby
PPTX
Where is my scalable API?
PDF
Sinatra Rack And Middleware
PDF
APIs for mobile
PPTX
Where is my scalable api?
Building RESTful APIs w/ Grape
Building an API using Grape
Building Mobile Friendly APIs in Rails
Sinatra and JSONQuery Web Service
Api presentation
Sinatra: прошлое, будущее и настоящее
Using Sinatra to Build REST APIs in Ruby
Where is my scalable API?
Sinatra Rack And Middleware
APIs for mobile
Where is my scalable api?
Ad

Recently uploaded (20)

PPTX
UNIT 4 Total Quality Management .pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
OOP with Java - Java Introduction (Basics)
DOCX
573137875-Attendance-Management-System-original
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
UNIT 4 Total Quality Management .pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Mechanical Engineering MATERIALS Selection
OOP with Java - Java Introduction (Basics)
573137875-Attendance-Management-System-original
R24 SURVEYING LAB MANUAL for civil enggi
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Sustainable Sites - Green Building Construction
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Model Code of Practice - Construction Work - 21102022 .pdf
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Ad

Lightning Talk: From Sinatra to Grape.pdf

  • 1. Copyright 2022 AppTweak S.A. All Rights Reserved From Sinatra to Grape How we are migrating from Sinatra to Grape and why?
  • 2. Copyright 2022 AppTweak S.A. All Rights Reserved Who am I? - I've been with AppTweak since 2019 - Been using Ruby since around 2016. Before that, I was using C, C++, PHP and other technologies. - Have a few open-source projects, the most used one being the Mastodon/Twitter crossposter (Rails + Sidekiq). Renato "Lond" Cerqueira
  • 3. Copyright 2022 AppTweak S.A. All Rights Reserved #1 ASO Tool for Apps & Games Driven by Data Science AppTweak fuels growth for the world’s most popular apps and games by providing actionable insights in a simple interface.
  • 4. Copyright 2022 AppTweak S.A. All Rights Reserved Recognized ASO Leader ASO pioneer launched in 2014, trusted by 1,500+ mobile leaders in 70+ countries. Tokyo Bengaluru Brussels San Francisco
  • 6. Copyright 2022 AppTweak S.A. All Rights Reserved What did we need from Sinatra? At Apptweak, we write endpoints for both internal and external use. Documentation was a pain point, so we wanted to be able to use code annotations to generate swagger output. Our idea was that anything we wrote for parameter validation would output as documentation. We could not find anything like that for Sinatra.
  • 7. Copyright 2022 AppTweak S.A. All Rights Reserved What Grape offered? Grape is designed with APIs in mind. It has parameter validation built-in with a lot of nice DSLs. It has a companion gem, Grape-swagger, which exports documentation based on the parameter validation. It also allows for specific documentation overrides. Grape is inspired by Sinatra. That means our devs will not have to get used to something completely different.
  • 8. Copyright 2022 AppTweak S.A. All Rights Reserved
  • 9. Copyright 2022 AppTweak S.A. All Rights Reserved Exploration tests and migration path We did internal testing and confirmed that Grape did what we wanted it to do: - It allowed us to validate our parameters - It exported the parameters as swagger documentation - The DSL was flexible enough that we could expand on it if needed We would not, however, be able to convert all our endpoints at once: - Most endpoints had no proper documentation, so they would have to be documented as we migrated. - Some endpoints had some documentation but it was written so long ago it was most likely out-of-date.
  • 10. Copyright 2022 AppTweak S.A. All Rights Reserved Rack::Cascade to rescue We decided to use Rack::Cascade to be able to migrate the endpoints in a timely manner. We cascade the old Sinatra app and the new Grape API and we're then able to remove an endpoint from Sinatra and re-create it in Grape for the migration.
  • 11. Copyright 2022 AppTweak S.A. All Rights Reserved
  • 12. Copyright 2022 AppTweak S.A. All Rights Reserved
  • 13. Copyright 2022 AppTweak S.A. All Rights Reserved Thank you!