RailsDM2019 Day1 B-7 登壇資料 『AskDoctorsの13年目を支える技術』
Technologies supportingfor 13 years@RailsDM2019
View Slide
> Web Engineer @M3, inc> Love Ruby, Vim, Gopher> Board-game GeekAbout MeOwl (@owl_works)
Changing the World of MedicineUsing the Internet
Central Service: m3.com270,000In Japan4,500,000WorldwideMember Doctors
Our Services 1/2NDPN Medical NewsΤϜεϦʔΩϟϦΞJob Recruitment.3܅PharmaceuticalPromotion
Our Services 2/2And over 20 other servicesσδΧϧ Cloud ElectronicMedical Records"TL%PDUPSTMedicalConsultation
And over 20 other servicesσδΧϧOur Services 2/2Cloud ElectronicMedical Records"TL%PDUPSTMedicalConsultation
You CanAsk Doctors5,900Doctors2,000,000Q&A
Back To the 2005First release:2005 (Dec)Now:2019 (Mar)
Back To the 2005First release:2005 (Dec)Now:2019 (Mar)13years
Back To the 2005 !!
2019
2015
2011
2005
( ).present? (2005)=> True-Rails (v.1 Release)-Git (v.1 Release)-PHP 5.0 (Release)-Feature phone
( ).present? (2005)=> False-iPhone (2008)-Chrome (2008)-jQuery (2006)
Tech Stack in 2005Version Control System=> CVSBug Tracker=> MantisJS Framework=> prototype.js
I have neverheard of those(I became an engineer3 years ago)
We also used Generator, aframework for developingweb apps with xmls.xml…Pardon?
Version Control System1.CVS2.SVN (subversion)3.Git (now!)
Bug Tracker1.Mantis2.REDMINE3.Jira (now!)
JS Framework1.Prototype2.jQuery3.Vue (now!)
App History
App Structure (ancient)AppsPCSmartphoneFeaturephoneForwomenDBJava Java Perl Java
Apps Constitution (ancient)AppsPCSmartphoneFeaturephoneForwomenDBJava Java Perl JavaDB structures are NOTshared.
Historical BackgroundFeature PhoneOutsourced to externalorganizations.For Women (AskMoon)Launched as a service witha different concept.
New RequirementLet's share contentdata between services!Sounds good.
PCSmartphoneFeaturephoneForwomenCoreAPINew!TopicQ&APatientWeb API
3 years later…
New RequirementWe need to developViews faster. How aboutintegrating PC with SP?LGTM !
PC & SPApps Constitution (middle)AppsFeaturephoneForwomenDBNew!
Pain Points
New RequirementFP users must also beable to use PC sites.Right.
Membership integrationAppsFeaturephoneDBPC & SPInsertUser Data
Membership integrationAppsFeaturephoneDBPC & SPInsertUser DataUser model has becomecomplicated…
DB has longevityApplicationsReplacedReplacedReplacedDB is unchanged
Pain Points #2
No one knowsIs this batch still working?Oh, this is ten years old.I was a high school studentat that time.
History rhymes 1/2It’s inconvenient ifwe don't have a batch list.I made one.It’s all right now.
Now batches areconsolidated in Digdag.
Get back on track…
PC & SPApps Constitution (middle)AppsFeaturephoneForwomenDBStop activedevelopment
PC & SPFeaturephoneForwomenCoreAPIWeb APIStop activedevelopment……
Problems with CoreAPI1. Increased volume of coding2. Data integrity problem (API transaction)3. API design difficulties
It’s micro-service !
At that time the bestpractices were not yetknown.
Keyword Trend on GoogleKeyword: microservice(ϚΠΫϩαʔϏεΞʔΩςΫνϟ)20142016
Keyword Trend on GoogleKeyword: microservice(ϚΠΫϩαʔϏεΞʔΩςΫνϟ)2014CoreAPI2009
Too many servicesV1 V2 AskmnCoreAPI Inspection ManageAdmin smartphone PaymentApps developed by our teamFP M3com
Let’s reduceV1 V2 AskmnCoreAPI Inspection ManageAdmin smartphone PaymentFPReplace and removeM3com
AdminLet’s reduceV1 V2 AskmnCoreAPI Inspection Managesmartphone PaymentFPStop active developmentM3com
AdminLet’s reduceV2Inspection ManageM3comKonmari !
Wait. Why did we have somany services?
Step By StepWe cannot replace allsystems at once.Step By Step!
Step By Step, and zombieAnd zombie servicesare born.
Step By Step, and zombieThe replacement isalmost over.But an old app isstill alive.
Step By Step, and zombieReason 1:99% complete!But a few complicatedbatches are running….
Step By Step, and zombieReason 2:99% complete!But the http server configis complex and we need toleave the redirectors...
Progress of replacement1 month later:2 months later:12 months later:50%95%99%
Nonetheless, the replacementwill be over soon.Thank you for everything!Rest in peace.
Next step ?2005-2009 :Let's just release anyway!2009-2017 :Calm down. Let's reorganize.
Next step is SCALING.Env and Application
Background2009-2017(Reorganize Age)The number of users was flat.And scalability wasnot important.But recently we have startedoffering services for companies.
More users! Surely.Scalability !
Development Env1. Add E2E tests2. DB migration (flyway)3. Consolidate batches (Digdag)
Application1. Replace Full-text search (Solr => Elasticsearch)2. Cache strategy3. DB ScaleUp4. Docker
But environmentalimprovement tends to bepostponed…RoI is a top priority…
Engineer’s TimeWithin our team, engineers havetime to make technicalimprovements.Many improvements were madeby this system.
Learn the history ofyour services
History Tells Us1. How hard our predecessors worked2. What was the concept of theservice3. Where we are in history