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

AskDoctorsの13年目を支える技術

Owl
March 22, 2019

 AskDoctorsの13年目を支える技術

RailsDM2019 Day1 B-7 登壇資料 『AskDoctorsの13年目を支える技術』

Owl

March 22, 2019
Tweet

Other Decks in Programming

Transcript

  1. Technologies supporting
    for 13 years
    @RailsDM
    2019

    View Slide

  2. > Web Engineer @M3, inc
    > Love Ruby, Vim, Gopher
    > Board-game Geek
    About Me
    Owl (@owl_works)

    View Slide

  3. Changing the World of Medicine
    Using the Internet

    View Slide

  4. Central Service: m3.com
    270,000
    In Japan
    4,500,000
    Worldwide
    Member Doctors

    View Slide

  5. Our Services 1/2
    NDPN Medical News
    ΤϜεϦʔ
    ΩϟϦΞ
    Job Recruitment
    .3܅
    Pharmaceutical
    Promotion

    View Slide

  6. Our Services 2/2
    And over 20 other services
    σδΧϧ Cloud Electronic
    Medical Records
    "TL%PDUPST
    Medical
    Consultation

    View Slide

  7. And over 20 other services
    σδΧϧ
    Our Services 2/2
    Cloud Electronic
    Medical Records
    "TL%PDUPST
    Medical
    Consultation

    View Slide

  8. You Can
    Ask Doctors
    5,900
    Doctors
    2,000,000
    Q&A

    View Slide

  9. Back To the 2005
    First release:
    2005 (Dec)
    Now:
    2019 (Mar)

    View Slide

  10. Back To the 2005
    First release:
    2005 (Dec)
    Now:
    2019 (Mar)
    13years

    View Slide

  11. Back To the 2005 !!

    View Slide

  12. 2019

    View Slide

  13. 2015

    View Slide

  14. 2011

    View Slide

  15. 2005

    View Slide

  16. View Slide

  17. ( ).present? (2005)
    => True
    -Rails (v.1 Release)
    -Git (v.1 Release)
    -PHP 5.0 (Release)
    -Feature phone

    View Slide

  18. ( ).present? (2005)
    => False
    -iPhone (2008)
    -Chrome (2008)
    -jQuery (2006)

    View Slide

  19. Tech Stack in 2005
    Version Control System
    => CVS
    Bug Tracker
    => Mantis
    JS Framework
    => prototype.js

    View Slide


  20. I have never
    heard of those
    (I became an engineer
    3 years ago)

    View Slide


  21. We also used Generator, a
    framework for developing
    web apps with xmls.
    xml…Pardon?

    View Slide

  22. Version Control System
    1.CVS
    2.SVN (subversion)
    3.Git (now!)

    View Slide

  23. Bug Tracker
    1.Mantis
    2.REDMINE
    3.Jira (now!)

    View Slide

  24. JS Framework
    1.Prototype
    2.jQuery
    3.Vue (now!)

    View Slide

  25. App History

    View Slide

  26. App Structure (ancient)
    Apps
    PC
    Smart
    phone
    Feature
    phone
    For
    women
    DB
    Java Java Perl Java

    View Slide

  27. Apps Constitution (ancient)
    Apps
    PC
    Smart
    phone
    Feature
    phone
    For
    women
    DB
    Java Java Perl Java
    DB structures are NOT
    shared.

    View Slide

  28. Historical Background
    Feature Phone
    Outsourced to external
    organizations.
    For Women (AskMoon)
    Launched as a service with
    a different concept.

    View Slide

  29. New Requirement
    Let's share content
    data between services!
    Sounds good.

    View Slide


  30. PC
    Smart
    phone
    Feature
    phone
    For
    women
    CoreAPI
    New!
    Topic
    Q&A
    Patient
    Web API

    View Slide

  31. 3 years later…

    View Slide

  32. New Requirement
    We need to develop
    Views faster. How about
    integrating PC with SP?
    LGTM !

    View Slide

  33. PC & SP
    Apps Constitution (middle)
    Apps
    Feature
    phone
    For
    women
    DB
    New!

    View Slide

  34. Pain Points

    View Slide

  35. New Requirement
    FP users must also be
    able to use PC sites.
    Right.

    View Slide

  36. Membership integration
    Apps
    Feature
    phone
    DB

    PC & SP
    Insert
    User Data

    View Slide

  37. Membership integration
    Apps
    Feature
    phone
    DB
    PC & SP
    Insert
    User Data

    User model has become
    complicated…

    View Slide

  38. DB has longevity
    Applications
    Replaced
    Replaced
    Replaced
    DB is unchanged

    View Slide

  39. Pain Points #2

    View Slide

  40. Back To the 2005
    First release:
    2005 (Dec)
    Now:
    2019 (Mar)
    13years

    View Slide

  41. Version Control System
    1.CVS
    2.SVN (subversion)
    3.Git (now!)

    View Slide

  42. Bug Tracker
    1.Mantis
    2.REDMINE
    3.Jira (now!)

    View Slide


  43. No one knows
    Is this batch still working?
    Oh, this is ten years old.
    I was a high school student
    at that time.

    View Slide

  44. History rhymes 1/2
    It’s inconvenient if
    we don't have a batch list.


    I made one.
    It’s all right now.

    View Slide

  45. 3 years later…

    View Slide

  46. History rhymes 1/2
    It’s inconvenient if
    we don't have a batch list.


    I made one.
    It’s all right now.

    View Slide

  47. Now batches are
    consolidated in Digdag.

    View Slide

  48. Get back on track…

    View Slide

  49. PC & SP
    Apps Constitution (middle)
    Apps
    Feature
    phone
    For
    women
    DB
    Stop active
    development

    View Slide


  50. PC & SP
    Feature
    phone
    For
    women
    CoreAPI
    Web API
    Stop active
    development
    ……

    View Slide

  51. Problems with CoreAPI
    1. Increased volume of coding
    2. Data integrity problem

    (API transaction)
    3. API design difficulties

    View Slide

  52. It’s micro-service !

    View Slide

  53. At that time the best
    practices were not yet
    known.

    View Slide

  54. Keyword Trend on Google
    Keyword: microservice
    (ϚΠΫϩαʔϏεΞʔΩςΫνϟ)
    2014
    2016

    View Slide

  55. Keyword Trend on Google
    Keyword: microservice
    (ϚΠΫϩαʔϏεΞʔΩςΫνϟ)
    2014
    CoreAPI
    2009

    View Slide

  56. Too many services
    V1 V2 Askmn
    CoreAPI Inspection Manage
    Admin smartphone Payment
    Apps developed by our team
    FP M3com

    View Slide

  57. Let’s reduce
    V1 V2 Askmn
    CoreAPI Inspection Manage
    Admin smartphone Payment
    FP
    Replace and remove
    M3com

    View Slide

  58. Admin
    Let’s reduce
    V1 V2 Askmn
    CoreAPI Inspection Manage
    smartphone Payment
    FP
    Stop active development
    M3com

    View Slide

  59. Admin
    Let’s reduce
    V2
    Inspection Manage
    M3com
    Konmari !

    View Slide

  60. Wait. Why did we have so
    many services?

    View Slide

  61. Step By Step
    We cannot replace all
    systems at once.
    Step By Step!

    View Slide

  62. Step By Step, and zombie
    And zombie services
    are born.

    View Slide

  63. Step By Step, and zombie
    The replacement is
    almost over.
    But an old app is
    still alive.

    View Slide

  64. Step By Step, and zombie
    Reason 1:
    99% complete!
    But a few complicated
    batches are running….

    View Slide

  65. Step By Step, and zombie
    Reason 2:
    99% complete!
    But the http server config
    is complex and we need to
    leave the redirectors...

    View Slide

  66. Progress of replacement
    1 month later:
    2 months later:
    12 months later:
    50%
    95%
    99%

    View Slide

  67. Nonetheless, the replacement
    will be over soon.

    Thank you for everything!
    Rest in peace.

    View Slide

  68. Next step ?
    2005-2009 :
    Let's just release anyway!
    2009-2017 :
    Calm down. Let's reorganize.

    View Slide

  69. Next step is SCALING.

    Env and Application

    View Slide

  70. Background
    2009-2017(Reorganize Age)
    The number of users was flat.
    And scalability was
    not important.
    But recently we have started
    offering services for companies.

    View Slide

  71. More users! Surely.

    Scalability !

    View Slide

  72. Development Env
    1. Add E2E tests
    2. DB migration (flyway)
    3. Consolidate batches

    (Digdag)

    View Slide

  73. Application
    1. Replace Full-text search

    (Solr => Elasticsearch)
    2. Cache strategy
    3. DB ScaleUp
    4. Docker

    View Slide

  74. But environmental
    improvement tends to be
    postponed…

    RoI is a top priority…

    View Slide

  75. Engineer’s Time
    Within our team, engineers have
    time to make technical
    improvements.
    Many improvements were made
    by this system.

    View Slide

  76. Learn the history of
    your services

    View Slide

  77. History Tells Us
    1. How hard our predecessors

    worked
    2. What was the concept of the
    service
    3. Where we are in history

    View Slide