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

Rails engineを用いたゆるふわモジュラーモノリス のご紹介

Rails engineを用いたゆるふわモジュラーモノリス のご紹介

Omotesando.rb #98でLT発表した資料です。

https://omotesandorb.connpass.com/event/319813/

Avatar for free_world21

free_world21

June 07, 2024
Tweet

More Decks by free_world21

Other Decks in Programming

Transcript

  1. ▪ খྛ ޛ࢙ʢখྛ ϊΤϧʣ ▪ ຊۀɿϒϧʔϞূ݊גࣜձࣾ औక໾$50 – ถࠃגɾถࠃ&5'ઐۀͷ௕ظࢿ࢈ܗ੒ಛԽ ܕͷ౤ࢿΞϓϦΛ࡞ͬͯΔ'JOUFDIελʔ

    τΞοϓ ▪ ೥ ΄ͲϑϦʔϥϯεΤϯδχΞ – ్தࣄۀձࣾͷதͷਓ΋΍ͬͨ ▪ ʙɿϒϧʔϞΠϯϕετϝϯτגࣜձࣾ Λڞಉ૑ۀʢޙʹϒϧʔϞূ݊גࣜձࣾʹ঎߸ มߋʣ ▪ झຯɿཱྀߦɾੈքͷίϫʔΩϯάεϖʔεΊ͙ ΓʢϫʔέʔγϣϯతͳԿ͔ʣ @free_world21 THE FARM@NY CARR WORKPLACE@Chicago https://bloomo.co.jp/
  2. େΞʔΩςΫνϟʢʁʣ ϞϊϦεΞʔΩςΫνϟ ▪ ͍ΘΏΔຕؠ ▪ ͭͷϦϙδτϦʢϓϩδΣΫτʣ ʹ͢΂ͯͷίʔυ͕ೖͬͯΔ ▪ ݸਓ։ൃ΍খن໛։ൃͰ΍ΔͳΒ͜ Ε

    ▪ ૊৫తʹ΍͍ͬͯ͘৔߹͸ɺਆͷ໨ Λ࣋ͭγϯɾΤϯδχΞ͕ඞཁʹ ͳͬͯ͘Δؾ͕͢Δ ϚΠΫϩαʔϏεΞʔΩςΫνϟ ▪ ෳ਺ͷখ͞ͳαʔϏεʢσϓϩΠ Մೳͳ୯Ґ㲈ϓϩηεɺίϯς φʣ͕ڠௐ͋ͬͯͭ͠ͷେ͖ͳ αʔϏεΛ࣮ݱ͢Δ ▪ ,VCFSOFUFTͱηοτͰޠΒΕΔ ͜ͱ͕ଟ͍ʢಛʹ(Pք۾ʣ ▪ ਓ΋ۚ΋͋Δڧऀͷઓུʢͩͱ ࢥͬͯΔʣ ϞδϡϥʔϞϊϦεΞʔΩςΫνϟ ▪ ͦͦ͜͜େ͖͍մΛෳ਺૊Έ߹Θͤ ͯͭͷେ͖ͳαʔϏεΛ࣮ݱ͢Δ ▪ ϞϊϦεͱϚΠΫϩαʔϏεͷதؒ ʢʁʣɻਖ਼֬ͳఆٛ͸ͳ͍ʢʁʣͱ ࢥͬͯΔ ▪ ϕετϓϥΫςΟεJTͲΕʁ
  3. ϚΠΫϩαʔϏεͷىݯ ▪ +BNFT-FXJT BOE.BSUJO'PXMFS  l.JDSPTFSWJDFT zNBSUJOGPXMFSDPN  ▪ ϚΠΫϩαʔϏεͷରൺͱͯ͠ϞϊϦε͕ޠΕΔ

    ▪ ͦͷޙ֓೦ͱͯ͠ఆண͠ɺଟ͘ͷॻ੶΍ࣄྫ͕ग़൛ ͞ΕΔ https://martinfowler.com/articles/microservices.html
  4. ϞδϡϥʔϞϊϦεJTԿʁ ▪ ద౓ʹ෼ׂ͞Ε͍ͯΔ ▪ σϓϩΠ͢Δ࣌ʹ݁߹ͯͭ͠ͷαʔϏεʢϞϊϦ εʣʹ͢Δ ▪ ʰϚΠΫϩαʔϏεʹࢸΔ·Ͱͷલஈ֊ͱͯ͠༗༻ʱ ▪ ϑϨʔϜϫʔΫ΍ࣄྫ

    – (PPHMF4FSJWDF8FBWFS (P – 4IPQJGZQBDXFSL 3BJMT – %KBOHP 1ZUIPO ΋࣮͸ϞδϡϥʔϞϊϦεͳؾ ͕͢Δ খྛͷཧղ ϞϊϦεͱϚΠΫϩαʔϏεͷ྆ํͷྑ͞ΛڗडͰ͖Δ Α͏ʹ͍͍ײ͡ʹ෼ׂͨ͠΋ͷ https://arxiv.org/pdf/2401.11867
  5. ϒϧʔϞͷΏΔ;ΘϞδϡϥʔϞϊϦε ΞϓϦ༻"1*αʔό DPNNPO@NPEFMT DPOUSPMMFS BENJO༻SBJMTΞϓϦ DPNNPO@NPEFMT BENJO@NPEFMT BENJOଆDPOUSPMMFST BENJOଆWJFXT "1*ݺͼग़͠

    "1*ݺͼग़͠ • ڞ௨෦෼͸SBJMTFOHJOFͱ࣮ͯ͠૷ʢFOHJOF໊ɿ commonʣ • جຊతʹ͸NPEFMͷΈΛ഑ஔ • BQJଆɺBENJOଆͷ(FNGJMFʹcommonΛهࡌ͢Δ • BQJଆͷNPEFM͸͢΂ͯBENJOଆͰ΋ѻ͑Δ • BQJଆͷapp/modelsҎԼʹ͸ಠࣗNPEFM͸ఆٛ ͠ͳ͍ • BENJOଆ͸app/modelsҎԼʹ͸BENJOଆͰ͔͠ ࢖Θͳ͍NPEFMΛఆٛ͢Δ
  6. ϒϧʔϞͷΏΔ;ΘϞδϡϥʔϞϊϦε ΞϓϦ༻"1*αʔό DPNNPO@NPEFMT DPOUSPMMFS BENJO༻SBJMTΞϓϦ DPNNPO@NPEFMT BENJO@NPEFMT BENJOଆDPOUSPMMFST BENJOଆWJFXT "1*ݺͼग़͠

    "1*ݺͼग़͠ • ϚΠάϨʔγϣϯ͸BENJOଆͰҰׅͰߦ͏ • BQJଆʹ͸ςʔϒϧ͝ͱʹඞཁͳݖݶͷΈΛ༩͑Δ GRANT SELECT, INSERT ON on database_name.users; GRANT SELECT, INSERT, UPDATE ON on database_name.personal_infos; GRANT SELECT, INSERT, DELETE on database_name.likes;
  7. ϒϧʔϞͷΏΔ;ΘϞδϡϥʔϞϊϦε ΞϓϦ༻"1*αʔό DPNNPO@NPEFMT DPOUSPMMFS BENJO༻SBJMTΞϓϦ DPNNPO@NPEFMT BENJO@NPEFMT BENJOଆDPOUSPMMFST BENJOଆWJFXT "1*ݺͼग़͠

    "1*ݺͼग़͠ • BQJଆαʔόʢίϯςφʣʹ͸apiͱcommonΛσϓ ϩΠ͢ΔσΟϨΫτϦҎԼʹฒྻʹ഑ஔ • BENJOଆαʔόʢίϯςφʣʹ͸adminͱcommonΛ σϓϩΠ͢ΔσΟϨΫτϦҎԼʹฒྻʹ഑ஔ
  8. ΍ͬͯΈͨॴײ ▪ ྑ͔ͬͨ͜ͱ – ੹຿ͷ෼ׂ͕໌֬ʹͳΓɺνʔϜ΋෼཭Ͱ͖ͨ – ηΩϡΞʹͳͬͨ ▪ BQJଆͰ͸ʓʓͰ͖ͳ͍ɺΈ͍ͨͳSTQFDॻ͔ͳͯ͘͢Μͩ –

    ʢ·ͩ΍ͬͯͳ͍͚ͲʣDPOUSPMMFS΍WJFX΋΍Ζ͏ͱࢥ͑͹FOHJOF಺ʹॻ͘͜ͱ͕ͰΔ ▪ ѱ͔ͬͨ͜ͱ – BQJଆͷػೳͳͷʹBENJOଆʹॻ͔ͳ͚Ε͹͍͚ͳ͍΋ͷ͕Ұ෦͋ͬͯɺ໌֬ͳ෼཭͕Ұ෦ Ͱ͖ͯͳ͍ – BQJɺBENJOͱ෼͚ͨ΋ͷͷɺͦΕͧΕ͕΋͸΍ڊେϞϊϦεʹͳΓͭͭ͋Δ