SlideShare a Scribd company logo
1 of 13
Download to read offline
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

Similar to Lightning Talk: From Sinatra to Grape.pdf

SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststem
Sumit Kataria
 

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

The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...The SAS developer portal –developer.sas.com 2.0: How we built it by Joe Furb...
The SAS developer portal – developer.sas.com 2.0: How we built it by Joe Furb...
 
apidays Paris 2022 - The 12 Facets of the OpenAPI Specification, Steve Sfartz...
apidays Paris 2022 - The 12 Facets of the OpenAPI Specification, Steve Sfartz...apidays Paris 2022 - The 12 Facets of the OpenAPI Specification, Steve Sfartz...
apidays Paris 2022 - The 12 Facets of the OpenAPI Specification, Steve Sfartz...
 
Docker at SourceLair | Paris Kasidiaris | 1st Docker Crete Meetup
Docker at SourceLair | Paris Kasidiaris | 1st Docker Crete Meetup Docker at SourceLair | Paris Kasidiaris | 1st Docker Crete Meetup
Docker at SourceLair | Paris Kasidiaris | 1st Docker Crete Meetup
 
apidays Australia 2023 - APIs Aren't Enough: Why SaaS Leaders Are Investing I...
apidays Australia 2023 - APIs Aren't Enough: Why SaaS Leaders Are Investing I...apidays Australia 2023 - APIs Aren't Enough: Why SaaS Leaders Are Investing I...
apidays Australia 2023 - APIs Aren't Enough: Why SaaS Leaders Are Investing I...
 
Clouds in 2016
Clouds in 2016Clouds in 2016
Clouds in 2016
 
Why Automate the Network?
Why Automate the Network?Why Automate the Network?
Why Automate the Network?
 
X by orange; una telco en la nube
X by orange;   una telco en la nubeX by orange;   una telco en la nube
X by orange; una telco en la nube
 
Pentesting Android Applications
Pentesting Android ApplicationsPentesting Android Applications
Pentesting Android Applications
 
CIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIsCIS14: Best Practices You Must Apply to Secure Your APIs
CIS14: Best Practices You Must Apply to Secure Your APIs
 
Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...Building a Stock Prediction system with Machine Learning using Geode, SpringX...
Building a Stock Prediction system with Machine Learning using Geode, SpringX...
 
meet4psa
meet4psameet4psa
meet4psa
 
Sam segal resume
Sam segal resumeSam segal resume
Sam segal resume
 
Embarcadero RAD server Launch Webinar
Embarcadero RAD server Launch WebinarEmbarcadero RAD server Launch Webinar
Embarcadero RAD server Launch Webinar
 
Treasure Data Mobile SDK
Treasure Data Mobile SDKTreasure Data Mobile SDK
Treasure Data Mobile SDK
 
SumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststemSumitK's mobile app dev using drupal as base ststem
SumitK's mobile app dev using drupal as base ststem
 
A TRUE STORY ABOUT DATABASE ORCHESTRATION
A TRUE STORY ABOUT DATABASE ORCHESTRATIONA TRUE STORY ABOUT DATABASE ORCHESTRATION
A TRUE STORY ABOUT DATABASE ORCHESTRATION
 
The Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized ApplicationThe Technical Considerations for Creating a Decentralized Application
The Technical Considerations for Creating a Decentralized Application
 
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and FlutterFlutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
 
London IoT Meetup Sep 2022 - End to end encrypted IoT
London IoT Meetup Sep 2022 - End to end encrypted IoTLondon IoT Meetup Sep 2022 - End to end encrypted IoT
London IoT Meetup Sep 2022 - End to end encrypted IoT
 
Native - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile ArchitecturesNative - Hybrid - Web Mobile Architectures
Native - Hybrid - Web Mobile Architectures
 

Recently uploaded

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
hublikarsn
 

Recently uploaded (20)

HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Post office management system project ..pdf
Post office management system project ..pdfPost office management system project ..pdf
Post office management system project ..pdf
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
👉 Yavatmal Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Girl S...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257Memory Interfacing of 8086 with DMA 8257
Memory Interfacing of 8086 with DMA 8257
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
Convergence of Robotics and Gen AI offers excellent opportunities for Entrepr...
 

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!