Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NEWT.net: Backend Technology Selection

Rodrigo Ramirez
November 22, 2022

NEWT.net: Backend Technology Selection

Rodrigo Ramirez

November 22, 2022


  1. RODRIGO RAMIREZ / ロドリゴ ラミレス @xpromx Argentinian Spanish: Native | English: Business

    | 日本語: 勉強中! https://xpromx.me Career • 2006~2008: Freelance Developer • 2008~2015: CEO/CTO - PowerSite (SaaS: NewsMaker, SocialHint) • 2015-2021: CTO - Travelience (GoWithGuide: Tour Guide Marketplace) • 2021~: Full-Stack Developer at ReiwaTravel (NEWT: Abroad Tour Package) ( + 10 years ) Self introduction Full-Stack Developer
  2. Choosing the right technology stack Development Speed + Scalability &

    Maintainability Developers available using that technology + Future proof Current team knowledge + Scope of the project your are trying to build
  3. API Layer Selection Criteria • One way to request information

    from our Web and Mobile apps. • It should be easy to maintain and scale
  4. API Layer Candidates Criteria REST GraphQL gRPC It should work

    for our Webs & Mobile Apps ✅ ✅ ⚠ Schema-based request ❌ ✅ ✅ Easy to maintain & test ⚠ ✅ ✅ Speed & Smaller payloads ⚠ ✅ ✅
  5. API Layer Conclusion GraphQL was the best option to cover

    all the uses cases we needed gRPC is more performant for internal communication between our apps, but it's not supported completed over HTTP.
  6. GraphQL What is GraphQL? • GraphQL is a query language

    for your API • It was created by Facebook (meta) • It gives the client the power to ask exactly what they need • It prevents Over and Under fetching of data • GraphQL has a strongly typed schema • Developers can easily check the GraphQL documentation schema • Big companies are using it: Facebook, Twitter, Netflix, Airbnb, etc
  7. GraphQL Libraries and Services used by NEWT Backend • Apollo

    Server • TypeGraphQL: Code First Approach • Apollo Studio : Schema Validation & Performance Monitoring
  8. GraphQL Vs REST HTTP Methods REST • GET • POST

    • PUT • PATCH • DELETE GraphQL POST → operation types • Queries → get data • Mutations → change data • Subscriptions → get real time data
  9. GraphQL Vs REST API Documentation REST GraphQL Open API (Swagger,

    etc.) Schema Introspection out of the box.
  10. Programming Language Selection Criteria • Current team knowledge • We

    decided to use GraphQL, so we need a language that fits well with that. • Easy to Develop and Deploy
  11. Programming Language Conclusion We decided select TypeScript, and the reasons

    are: • Our team members already had production experience with TypeScript and GraphQL • Our frontend team also use React and Typescript • Node.JS/Typescript is the most popular option for implementing GraphQL servers. • Node.JS/Typescript apps can be deployed anywhere.
  12. Infra / Cloud Providers Selection Criteria • Managed solutions •

    Easy to deploy our code, scale, and monitor.
  13. Infra / Cloud Providers Candidates We compared various solutions offered

    by GCP and AWS based on our selection criteria. We reduced it to two options. • GCP Cloud Run Managed Serverless Containers https://cloud.google.com/run • AWS Elastic Beanstalk Managed Services to Deploy and Scale EC2 instances https://aws.amazon.com/elasticbeanstalk/
  14. Infra / Cloud Providers Candidates Feature Cloud Run Elastic Beanstalk

    Cloud Provider GCP AWS Description Managed Serverless Container Managed EC2 instances Price ✅ (pay per second) ✅(pay per hour) Scalability ✅Automatically ✅Automatically Full Managed ✅YES ✅YES Deploy Method Docker Source Code, Docker DX ✅Very Good ✅Good Vendor Lock-in ✅ NO ✅ NO Integration with DB ✅ YES ✅ YES
  15. Infra / Cloud Providers Conclusion Both options were good enough,

    but we decided to go with GCP because: • GCP interface was easier to understand • Cloud run was easy to deploy and setup compared with Elastic Beanstalk. • We planned to use Firebase Auth and BigQuery. So keeping all in the same place will simplify the infra maintenance.
  16. Vercel & Testing Env. • Vercel automatically generates testing environments

    for each PR. • We use GitHub Action to create a DB based on the branch name. • After a branch is deleted, the DB is also destroyed. • Vercel also generates our testing environment for our Admin and Web apps
  17. Backend Stack Choosing the right technology stack https://engineering.reiwatravel.co.jp/blog/ choosing-the-right-technoloy-stack Backend

    Technology Selection for Building a digital travel agency. https://engineering.reiwatravel.co.jp/blog/newt-b ackend-stack