Movatterモバイル変換


[0]ホーム

URL:


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

NEWT Backend Evolution

Avatar for Rodrigo Ramirez Rodrigo Ramirez
July 14, 2025

NEWT Backend Evolution

About NEWT Backend Tech Selection and how this has evolved since 2021
What are the challenges we are facing, and how do we plan to solve them?

Challenges:
- TypeScript Library Dependency Risks
- TypeScript Decorator Usage Risks
- From Modular Monolith to Modular Monolith Monorepo
- TypeScript Freedom

Avatar for Rodrigo Ramirez

Rodrigo Ramirez

July 14, 2025
Tweet

More Decks by Rodrigo Ramirez

See All by Rodrigo Ramirez

Other Decks in Programming

See All in Programming

Featured

See All Featured

Transcript

  1. © 2023 Reiwa Travel, Inc.
 Scaling Fast with Confidence NEWT

    Backend Evolution
  2. © 2023 Reiwa Travel, Inc.
 Profile • Nationality: Argentinian •

    Language: Spanish, English, Japanese • Full Stack Developer (+10y) Career • 󰎆 2006~: Freelance • 󰎆 2008~: PowerSite ( CTO/CEO ) ◦ Email Marketing SaaS • 󰏦 2015~: Travelience ( CTO ) ◦ Tour Guide Marketplace • 󰏦 2021~: ReiwaTravel ( Senior Engineer ) Senior Engineer / Product-Dev Rodrigo Ramirez
  3. 令和トラベル‧NEWTについて Information 1.

  4. 社名 株式会社令和トラベル 代表者 篠塚 孝哉 創業 2021年4⽉5⽇ 従業員 100名(役員‧正社員)※2024年5⽉1⽇時点 登録番号

    観光庁⻑官登録旅⾏業第2123号 資本⾦ 70.2億円 (資本剰余⾦を含む) 会社概要 About Us
  5. あたらしい旅⾏を、デザインする。 私たちは旅⾏が⼈⽣を豊かにしてくれると信じている。デジタルの⼒を活⽤し、 よりあたらしい旅⾏体験へとアップデートしていくことが、私たちの使命であり挑戦である。 ミッション Mission

  6. 事業⽅針‧計画 Our Business Plan ツアーから始まり、ホテル、エアー、グループ旅⾏と事業ポートフォリオを拡⼤予定。 テクノロジーを活⽤し、すべての旅⾏に対応するデジタルトラベルエージェンシーを⽬指しています。

  7. 事業⽅針‧計画 Our Business Plan 事業ポートフォリオの拡⼤と並⾏し、マーケットのターゲットを広げることで、事業の規模を伸ばしていきます。

  8. None
  9. 私たちのサービス Our Service 海外ツアー予約 宿‧ホテル予約 (ホテル + 航空券セット) 旅⾏ ガイド

    トラベル コンシェルジュ グループトラベル ‧修学旅⾏  ‧企業の研修旅⾏など かんたん‧おトク‧えらべる‧あんしんな旅⾏の提供 ‧旅⾏相談 ‧VIP対応
  10. 海外ツアー予約 Overseas Tour Reservations ⼤⼿ECサイトでミネラルウォーターを買うくらい「かんたん」に海外旅⾏を予約 煩雑になりがちな海外旅⾏予約を、直感的なUI/UXでストレスフリーなサービス設計

  11. 海外ツアー予約 Overseas Tour Reservations 予約のスマート管理 旅程表やチケットはすべてアプリに やることリスト 出発前の準備もばっちり パスポートスキャン トラベルリンク

    同⾏者のアプリに予約をリンク 煩雑な旅⾏準備もアプリで完結 パスポートはカメラで読みとり
  12. ⼀緒にチャレンジしてくれる仲間を募集中! We Want Co-Workers Who Will Take on A Challenge

    with Us!
  13. © 2023 Reiwa Travel, Inc.
 Scaling Fast with Confidence NEWT

    Backend Evolution
  14. AGENDA
 © 2023 Reiwa Travel, Inc.
 1. Context 2. Challenges

    3. 振り返り
  15. CONFIDENTIAL
 © 2023 Reiwa Travel, Inc.
 Context NEWT Overview

  16. NEWT Tech stack

  17. NEWT Tech stack

  18. Backend Stack 📆 Tech choices made in 2021 (PoC start

    – now ~4 years) • Language: TypeScript: ( Full-Stack team ) • Framework: None ( Build on top of Apollo Server and Express ) • ORM: TypeORM • Architecture: Modular Monolith • Infrastructure: GCP ├ 📁modules │ ├ 📁module-A │ ├ 📁module-B │ └ 📁… └ 📄server.ts
  19. We scaled from one product to multiple products Business Evolution

  20. We scaled from one backend team to multiple backend teams

    per product Team Evolution
  21. CONFIDENTIAL
 © 2023 Reiwa Travel, Inc.
 Challenges What challenges do

    we have and how are we solving them?
  22. © 2023 Reiwa Travel, Inc.
 Challenge ① 📦 Library Dependency

    Risks
  23. Issue • TypeScript ecosystem moves quickly → upgrades and replacements

    are necessary • Core libraries used directly without abstraction layer → expensive technical debt Challenge ① : 📦 Library Dependency Risks
  24. e.g: TypeORM • We decided to use TypeORM in 2021

    ( 4 years ago ) • Poor maintenance (project abandoned for long time) • Uncertainty about long-term evolution • Community migrating to Prisma Challenge ① : 📦 Library Dependency Risks
  25. Migration Pains: • Entities are imported directly from module •

    Business logic mixed with ORM calls • Hard to replace Booking/User entity implementation • Tests must hit the database Challenge ① : 📦 Library Dependency Risks
  26. Solution: • Added our Own repository layer to make swapping

    the ORM (TypeORM ↔ Prisma) easy • Testing simplified by mocking the repository interface • Incremental Replacement of current modules Challenge ① : 📦 Library Dependency Risks
  27. Lesson learned: • Libraries can become outdated or stop being

    maintained • To reduce future migration pain, add an abstraction layer around any library you use deeply in your system Challenge ① : 📦 Library Dependency Risks
  28. © 2023 Reiwa Travel, Inc.
 Challenge ② 🪄 Decorator Coupling

    Risks
  29. Context • We used TypeGraphQL + TypeORM that works based

    on decorators Issue • Magic Behavior • Refactoring Challenges • Mixing decorators can cause issues and coupling Challenge ② : 🪄 Decorator Coupling Risks
  30. Problems • GraphQL schema tied to entities • Cross-module cycles

    & tight coupling Challenge ② : 🪄 Decorator Coupling Risks
  31. Solution • Separation of TypeORM & TypeGraphQL Challenge ② :

    🪄 Decorator Coupling Risks
  32. © 2023 Reiwa Travel, Inc.
 Challenge ③ 🏢 Monolith Scalability

    Issues
  33. Growth Pain • Modular Monolith → many products → many

    teams Issues • Products mixed inside monolith • No rules → no isolation • One change affects many modules • Single deploy → can’t split apps Challenge ③ : 🏢 Monolith Scalability Issues
  34. Issue • Products mixed inside monolith Challenge ③ : 🏢

    Monolith Scalability Issues
  35. Issue • No rules → no isolation Challenge ③ :

    🏢 Monolith Scalability Issues
  36. Issue • No rules → no isolation Challenge ③ :

    🏢 Monolith Scalability Issues
  37. Issue • Single deploy → can’t split apps Challenge ③

    : 🏢 Monolith Scalability Issues
  38. Solution • Modular Monolith → Modular Monolith Monorepo Challenge ③

    : 🏢 Monolith Scalability Issues
  39. We changed the directory structure to a typical TypeScript monorepo

    ├ 📁modules │ ├ 📁module-A │ ├ 📁module-B │ └ 📁… └ 📄server.ts ├ 📁apps │ ├ 📁app-A │ └ 📁app-B └ 📁packages ├ 📁package-A ├ 📁package-B └ 📁core Before After Challenge ③ : 🏢 Monolith Scalability Issues
  40. Moved legacy code inside one of the apps and incrementally

    migrate it ├ 📁modules │ ├ 📁module-A │ ├ 📁module-B │ └ 📁… └ 📄server.ts ├ 📁apps │ ├ 📁app-A │ └ 📁app-B └ 📁packages ├ 📁package-A ├ 📁package-B └ 📁core Before After Challenge ③ : 🏢 Monolith Scalability Issues
  41. • Turborepo for builds & parallel tasks • CODEOWNERS to

    assign ownership • ESLint rules block forbidden imports Challenge ③ : 🏢 Monolith Scalability Issues
  42. © 2023 Reiwa Travel, Inc.
 Challenge ④ 🎨 Freedom &

    Governance
  43. • Issue: TS has no single framework (unlike RoR/Laravel) ◦

    → Developers do as they like → more of the above problems • Need: Clear Structure + Coding Rules Challenge ④ : 🎨 Freedom & Governance
  44. • Solution: ◦ Documentation as Code in .agent-rules/ ▪ AI

    agents read these rules automatically Challenge ④ : 🎨 Freedom & Governance
  45. AI Code Agents can • Generate code by our standards

    • Migrate old code → new style • Answer architecture questions • Suggest improvements in code review Implementation • .agent-rules/ mirrors monorepo layout • GitHub Actions runs AI review jobs • Agents (Cursor, Cline, Claude) load rules Challenge ④ : 🎨 Freedom & Governance
  46. © 2023 Reiwa Travel, Inc.
 振り返り

  47. 🎯 Lessons Learned • Don’t over-engineer eraly, instead incrementally evolve

    your code before it hurts. • Correct usage of Code Isolation and Layers are important when growing • AI code agents are the future, clear rules helps us to fully use their potential 振り返り
  48. Thank you!
 © 2023 Reiwa Travel, Inc.
 @xpromx


[8]ページ先頭

©2009-2025 Movatter.jp