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

1400万ユーザーのWebサービスを 15年運用して考える、
Javaである理由

1400万ユーザーのWebサービスを 15年運用して考える、
Javaである理由

masaozi3

May 18, 2019
Tweet

More Decks by masaozi3

Other Decks in Technology

Transcript

  1. w ࠓ೔ͷΰʔϧ w ࿩ͷ͖͔͚ͬ w ฐࣾͷαʔϏεͱٕज़બ୒ͷ࿩ w ೔ʑͷӡ༻͔ΒΈΔ+BWBͰ͋Δཧ༝ w ʲ͓·͚ʳ+%,ͷҠߦͷ࿩

    w ݁࿦ w ͓͠Βͤ ࠓ೔࿩͢͜ͱ !3 ੩͔ʙʹฉ͘ΑΓ΋
 ΘʔΘʔݴ͍ͳ͕Β
 ฉ͍ͯ΋Β͑Ε͹خ͍͠Ͱ͢ʂ
  2. w ࠓ೔ͷΰʔϧ w ࿩ͷ͖͔͚ͬ w ฐࣾͷαʔϏεͱٕज़બ୒ͷ࿩ w ೔ʑͷӡ༻͔ΒΈΔ+BWBͰ͋Δཧ༝ w ʲ͓·͚ʳ+%,ͷҠߦͷ࿩

    w ݁࿦ w ͓͠Βͤ ࠓ೔࿩͢͜ͱ !4 ʮ೥ӡ༻ͯ͠ʯͱ͍͍ͭͭ
 ೥ϲ݄͔͠ݟͯͳ͍ͷͰ
 ௐ΂ͨ৘ใ΋͋Γ·͢
  3. w 4DBMB͕େ޷͖ͳઌഐ͕೔ʑۤͦ͠͏Ͱ͋Δ w पғͷ༑ਓ͕ʮ+BWB͸ઈରॻ͖ͨ͘ͳ͍ʯͳͲݴ͍ͬͯͯɺͳΜ͔ͩ൵ ͍͠ w ͱ͸͍͑ࣗ෼΋+BWB͕͘͢͝޷͖ͱ͍͏Θ͚Ͱ͸ͳ͍ w ྡͷνʔϜ͸αʔόαΠυ,PUMJOΛݕ౼͍ͯ͠ΔΑ͏ͩʁ w

    ผͷݴޠΛݕ౼ͨ͜͠ͱ͸͋ΔΒ͍͠ ࿩ͷ͖͔͚ͬ !9 ͳΜͰ+BWBΛ࢖͍ͬͯΔΜͩΖ͏ʁ +BWB͕ద͍ͯ͠Δ΋ͷͬͯͳΜͩΖ͏ʁ ഑ଐ͞ΕͨϓϩμΫτ͕+BWB͔ͩͬͨΒ
 Ҏ֎ͷཧ༝͸ͳ͍ͷͩΖ͏͔ʁ
  4. w 4DBMB͕େ޷͖ͳઌഐ͕೔ʑۤͦ͠͏Ͱ͋Δ w पғͷ༑ਓ͕ʮ+BWB͸ઈରॻ͖ͨ͘ͳ͍ʯͳͲݴ͍ͬͯͯɺͳΜ͔ͩ൵ ͍͠ w ͱ͸͍͑ࣗ෼΋+BWB͕͘͢͝޷͖ͱ͍͏Θ͚Ͱ͸ͳ͍ w ྡͷνʔϜ͸αʔόαΠυ,PUMJOΛݕ౼͍ͯ͠ΔΑ͏ͩʁ w

    ผͷݴޠΛݕ౼ͨ͜͠ͱ͸͋ΔΒ͍͠ ࿩ͷ͖͔͚ͬ !10 ⾠ܾͯ͠ϚαΧϦΛ౤͛ʹདྷͨͷͰ͸ͳ͍Ͱ͢ ʮ࢖͏͔Βʹ͸ɺྑ͞Λ஌Γ͍ͨʯ Έͳ͞Μͷ+BWBΛબΜͩཧ༝΍
 +BWBͷ޷͖ͳͱ͜ΖͳͲ΋ͥͻฉ͖͍ͨͰ͢
  5. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !38 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ Vegetable getInSeason(List<Vegetable> vegetables); }
  6. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !39 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> vegetables = refrigeratorService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }
  7. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !40 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> vegetables = refrigeratorService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } } ०ͷ໺ࡊͬͯ
 Ұݸ͡Όͳ͍Αͳ
  8. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !41 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables); }
  9. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !42 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> stockVegetables = refrigeratorService.findVegetables(); List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }
  10. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !43 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> stockVegetables = refrigeratorService.findVegetables(); List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }  ίϯύΠϧ
 Τϥʔ
  11. ಉ͘͡ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !44 public class ShoppingController { @Resource VegetableService vegetableService;

    @RequestMapping(path = "/market") public ModelAndView market() { List<Vegetable> vegetables = specialPriceService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ०ͷ໺ࡊΛͲ΍͜΍… return new ModelAndView("/market.html"); } } ͸Θʔ͍͢·ͤΜ
 ͦͬͪ΋࢖ͬͯͨ
  12. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !47 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables); }
  13. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !48 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables) throws NoVegetablesException; } ۭͳΒ
 ྫ֎ʹͨ͘͠
 ͳ͖ͬͯͨ
  14. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !49 
 List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); 
 try

    { List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); } catch (NoVegetablesException e) { e.printStackTrace(); } ,JUDIFO$POUSPMMFSͱ 4IPQQJOH$POUSPMMFSͰ
 ࢖͚ͬͯͨͬͳʙ
  15. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !50 
 List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); 
 try

    { List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); } catch (NoVegetablesException e) { e.printStackTrace(); }  ίϯύΠϧ
 Τϥʔ
  16. ػೳ௥Ճ͞Ε͍ͯͨʂ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !51 public class FlyerController { @Resource VegetableService vegetableService;

    @RequestMapping(path = "/available") public ModelAndView availableFlyerView() { List<Vegetable> vegetables = specialPriceService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ०ͷ໺ࡊΛͲ΍͜΍… return new ModelAndView(“/available.html"); } } Θʔ͓
 ͦͬͪ΋࢖ͬͯͨ
  17. ߟ͑ΒΕΔબ୒ࢶ͸͍͔ͭ͘ w 0SBDMF+%,Ͱܖ໿͢Δ w 0SBDMF+%,Ͱܖ໿͢Δ w ֤ࣾஂମͷ+%,ʹҠߦ͢Δ w ͍ͬͦଞͷݴޠʹͯ͠͠·͏ +%,ͷҠߦ

    !67 ͙͢ʹରԠ͢Δͷ͸೉͍͠ ͙͢ʹରԠ͢Δͷ͸೉͍͠ ͳ͔ͳ͔ͷֹۚʹͳΓͦ͏ʜ ͳ͔ͳ͔ͷֹۚʹͳΓͦ͏ʜ