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

Inside of Blog; Light and shadow of the service matured for 15 years and challenge chaos and legacy

Inside of Blog; Light and shadow of the service matured for 15 years and challenge chaos and legacy

Takahiro Omori
LINE Development Team B
https://linedevday.linecorp.com/jp/2019/sessions/C1-2

LINE DevDay 2019

November 20, 2019
Tweet

More Decks by LINE DevDay 2019

Other Decks in Technology

Transcript

  1. 2019 DevDay Inside of Blog; Light and Shadow of the

    Service Matured for 15 Years and Challenge Chaos and Legacy > Takahiro Omori > LINE Development Team B
  2. >Takahiro Ohmori • Lead of the Blog development team •

    Joined Blog development in 2015 • Server Side Engineer • Writing code in Perl Speaker
  3. livedoor Blog / LINE BLOG LINE BLOG livedoor Blog >

    Launch 2003 > 16 Years Ago > Launch 2014 > 5 Years Ago
  4. > LAMP • Linux + Apache + MySQL + Perl

    • Web App Framework: Sledge > One of the largest blog service in Japan • Many users, many contents • High performance, high availability livedoor Blog
  5. System Overview: Blog Core load balancer CDN main DB cache

    cache pool storage image store www image worker batch etc portal www app CMS www app user blog www app cluster DB
  6. System Overview: ALL adv
 admin feed
 service user information blog

    auth user profile traffic report feed
 api feed
 fetcher news
 sender talk
 notifier image
 resize image
 fetcher auth
 service blog
 admin service
 admin search anti
 spam mobile
 page image
 storage file
 storage email
 sender traffic
 analyzer access
 trade page
 render snippet
 generator blog
 reader internal
 feed api Blog Core
  7. 410,000+ 750+ 3,800+ 43,500+ 550+ 70+ livedoor Blog in Numbers

    Developers Servers DB Tables Files Program Files
  8. 410,000+ 750+ 3,800+ 43,500+ 550+ 70+ livedoor Blog in Numbers

    Developers Servers DB Tables Files Program Files Lines of Code
  9. Development Environment Difficulty Level Dev server
 exists Functions properly Matches

    with
 production server Does not use production data Used to have dev server Easy START!! No No No No No Yes Yes Yes Yes Yes NIGHTMARE Normal HARD
  10. Development Environment Difficulty Level Dev server
 exists Functions properly Matches

    with
 production server Does not use production data Used to have dev server Easy START!! No No No No No Yes Yes Yes Yes Yes NIGHTMARE Normal HARD
  11. Development Environment Difficulty Level Dev server
 exists Functions properly Matches

    with
 production server Does not use production data Used to have dev server Easy START!! No No No No No Yes Yes Yes Yes Yes NIGHTMARE Normal Hard
  12. Development Environment Difficulty Level Dev server
 exists Functions properly Matches

    with
 production server Does not use production data Used to have dev server Easy START!! No No No No No Yes Yes Yes Yes Yes Nightmare Normal Hard
  13. > Old functions • Feature phone page • Trackback •

    Old CMS • FTP • moblog • etc... Remove Old Functions
  14. > Very old version > No change since service launch

    LEGACY: Perl 5.8 2002 ver 5.8 <====== 2007 ver 5.10 2010 ver 5.12 2011 ver 5.14 2012 ver 5.16 2013 ver 5.18 ... 2019 ver 5.30 Perl Release
  15. • Apache module • mod_perl ver 1.3 • + Apache

    ver 1.3 LEGACY: mod_perl 1.3 2009 mod_perl ver 1.31 2010 Apache ver 1.3.42 Latest Update
  16. > 2 versions of Perl > Dual management of dependent

    modules > Maintain code compatibility > Since 2013 Perl 5.8 + Perl 5.16
  17. > 2 versions of Perl > Dual management of dependent

    modules > Maintain code compatibility Perl 5.8 + Perl 5.16
  18. LEGACY: MySQL 4.0 2003 ver 4.0 <====== 2004 ver 4.1

    2005 ver 5.0 2008 ver 5.1 2010 ver 5.5 2013 ver 5.6 2015 ver 5.7 2018 ver 8.0 MySQL Release > Very old version > No change since service launch
  19. > Online DDL v5.6 (Not Available) > Fast Index Creation

    v5.1 (Not Available) > Trigger v5.0 (Not Available) • Percona Toolkit: pt-online-schema-change v5.0 (Not Supported) ALTER TABLE
  20. > Online DDL v5.6 (not available) > Fast Index Creation

    v5.1 (not available) > Trigger v5.0 (not available) • Percona Toolkit: pt-online-schema-change v5.0 (not supported) ALTER TABLE (Virtually impossible)
  21. Workaround 3. Double write App 2. Alter table 1. Copy

    blank table TABLE A Original TABLE B New
  22. Workaround Batch 4. Row copy 3. Double write App 2.

    Alter table 1. Copy blank table TABLE A Original TABLE B New
  23. Workaround 1. Copy blank table TABLE A Original TABLE B

    New > CREATE TABLE new LIKE orig; v4.1 (not available)
  24. Data Bloat > innodb_file_per_table v4.1 (not available) > InnoDB Table

    Compression v5.1 (not available) > Transparent Page Compression v5.7 (not available)
  25. MySQL 4.0: Server Migration App server DB server MySQL 4.0

    is not database... MySQL 4.0 MySQL 4.0 MySQL 4.0
  26. Roadmap: livedoor Blog 2019 1H 2019 2H 2020 1H 2020

    2H 2021 1H Server Migration HTTPS Perl Update UTF-8 MySQL Update
  27. > Blog Service of LINE Brand • Authentication with LINE

    account • Launched 2014 LINE BLOG
  28. Service History 2016.11 2014.11 2016.04 livedoor Blog ASP LINE BLOG

    Launch LINE BLOG Renewal Launch Begin renewal
 development

  29. > MySQL 4.0 > Perl 5.8 > mod_perl > Mixed

    character set > Apache > Low code coverage > Legacy subsystems Forked from livedoor Blog
  30. Forked from livedoor Blog > MySQL 4.0 > Perl 5.8

    > mod_perl > Mixed character set > Apache > Low code coverage > Legacy subsystems
  31. > MySQL 4.0 > Perl 5.8 > mod_perl > Mixed

    character set > Apache > Low code coverage > Legacy subsystems > HTTP Breaking Away from Chaos and Legacy > MySQL 5.6 > Perl 5.16 > PSGI > utf-8 > nginx > High code coverage > LINE platform > HTTPS
  32. Server
 Migration HTTPS 2017 LINE BLOG
 Renewal LINE BLOG's Contribution

    > Verification • Server migration • Database migration • Middleware updates > Test cases • Data charset conversion • Always-On HTTPS (SSL) > etc...
  33. Now