Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
日々大量の素材を扱うために改善したこと/webgenba-meetup-03
Search
hamuyuuki
March 08, 2018
Technology
0
1k
日々大量の素材を扱うために改善したこと/webgenba-meetup-03
2018/03/07 Web現場Meetup #3
hamuyuuki
March 08, 2018
Tweet
Share
More Decks by hamuyuuki
See All by hamuyuuki
VS CodeのExtensionを作ってみた/pixta-techcamp-05
hamuyuuki
0
1.2k
Other Decks in Technology
See All in Technology
5分でわかるDuckDB
chanyou0311
10
3.2k
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
120
.NET 9 のパフォーマンス改善
nenonaninu
0
440
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
260
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
170
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
3
1.4k
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
500
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
What's in a price? How to price your products and services
michaelherold
243
12k
Code Review Best Practice
trishagee
65
17k
Building an army of robots
kneath
302
44k
A better future with KSS
kneath
238
17k
It's Worth the Effort
3n
183
28k
Documentation Writing (for coders)
carmenintech
66
4.5k
Making Projects Easy
brettharned
116
5.9k
Side Projects
sachag
452
42k
Six Lessons from altMBA
skipperchong
27
3.5k
Transcript
ʑେྔͷૉࡐΛѻ͏ͨΊ ʹվળͨ͜͠ͱ 2018/03/07 WebݱMeetup ϐΫελגࣜձࣾɹҏ౻ ༟ر mits / 33114786
ࣗݾհ • ҏ౻ ༟ر • 2015/08 ʙ ϐΫελגࣜձࣾ • 2017/01
ʙ PIXTA VIETNAM ʹग़ • 2018/01 ʙ ٕज़ਪਐάϧʔϓ
ϐΫελגࣜձࣾͷ͝հ
ձࣾ֓ཁ • ઃཱ: 2005/08/25 • ཧ೦: ࠽ೳΛͭͳ͗ɺੈքΛϙδςΟϒʹ͢Δ • ࣄۀ༰: PIXTA,
fotowa, Snapmart ͷӡӦ • ڌ: ຊ, , λΠ, γϯΨϙʔϧ, ϕτφϜ, ؖࠃ
https://pixta.jp ຊޠΛؚΉ6ݴޠͰల։த
ࠓ͢͜ͱ • എܠ • ࣮ࢪ༰ • ࠓޙͷ՝ • ·ͱΊ
എܠ
ૉࡐ͕ PIXTA Ͱൢച͞ΕΔ·Ͱ 1. Ξοϓϩʔυ 2. ਃʢૉࡐʹλΠτϧɾλάΛඥ͚ʣ 3. ৹ࠪʢૉࡐͷΫΦϦςΟΛஅʣ 4.
ൢച։࢝ʂ
ૉࡐ͕ PIXTA Ͱൢച͞ΕΔ·Ͱ 1. Ξοϓϩʔυ 2. ਃʢૉࡐʹλΠτϧɾλάΛඥ͚ʣ 3. ৹ࠪʢૉࡐͷΫΦϦςΟΛஅʣ 4.
ൢച։࢝ʂ
Ξοϓϩʔυ • ϚΠϖʔδܦ༝ͷΞοϓϩʔυ • গྔͷૉࡐΛ PIXTA Ͱൢച͍ͨ͠ࡍʹ༻ • FTPαʔόʔܦ༝ͷΞοϓϩʔυ •
େྔͷૉࡐΛ PIXTA Ͱൢച͍ͨ͠ࡍʹ༻
Ξοϓϩʔυ • ϚΠϖʔδܦ༝ͷΞοϓϩʔυ • গྔͷૉࡐΛ PIXTA Ͱൢച͍ͨ͠ࡍʹ༻ • FTPαʔόʔܦ༝ͷΞοϓϩʔυ •
େྔͷૉࡐΛ PIXTA Ͱൢച͍ͨ͠ࡍʹ༻
FTPαʔόʔܦ༝ͷΞοϓϩʔυ • ετοΫϑΥτۀքͰҰൠతͳํ๏ • େྔͷૉࡐΛอ͍࣋ͯ͠Δ ΫϦΤΠλʔ ͕ޮ Α͘ΞοϓϩʔυͰ͖ΔͨΊʹଘࡏ͢Δ FTP
Server ΫϦΤΠλʔ Ξοϓϩʔυ
چFTPΞοϓϩʔυγεςϜ PIXTA (Batch) S3 FTP Server ΫϦΤΠλʔ ᶃΞοϓϩʔυ PIXTA
(Admin) ϐΫελ ελοϑ ᶄ࿈བྷʢϚΠϖʔδ্ʣ ᶅFTP=>S3ಉظґཔ ᶅFTP=>S3ಉظґཔ ᶆS3ಉظ ᶇ݁ՌΛ௨ ᶈαϜωΠϧੜ ᶉૉࡐใΛอଘ Worker
چFTPΞοϓϩʔυγεςϜ PIXTA (Batch) S3 FTP Server ΫϦΤΠλʔ ᶃΞοϓϩʔυ PIXTA
(Admin) ϐΫελ ελοϑ ᶄ࿈བྷʢϚΠϖʔδ্ʣ ᶅFTP=>S3ಉظґཔ ᶅFTP=>S3ಉظґཔ ᶆS3ಉظ ᶇ݁ՌΛ௨ ᶈαϜωΠϧੜ ᶉૉࡐใΛอଘ Worker
Ξοϓϩʔυ݅ͷਪҠ , , , ,
,
چFTPΞοϓϩʔυγεςϜ PIXTA (Batch) S3 FTP Server ΫϦΤΠλʔ ᶃΞοϓϩʔυ PIXTA
(Admin) ϐΫελ ελοϑ ᶄ࿈བྷʢϚΠϖʔδ্ʣ ᶅFTP=>S3ಉظґཔ ᶅFTP=>S3ಉظґཔ ᶆS3ಉظ ᶇ݁ՌΛ௨ ᶈαϜωΠϧੜ ᶉૉࡐใΛอଘ Worker
• ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔ γεςϜͷεέʔϧԽ
࣮ࢪ༰
• ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔ γεςϜͷεέʔϧԽ
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
• ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔ γεςϜͷεέʔϧԽ
چFTPΞοϓϩʔυγεςϜ PIXTA (Batch) S3 FTP Server ΫϦΤΠλʔ ᶃΞοϓϩʔυ PIXTA
(Admin) ϐΫελ ελοϑ ᶄ࿈བྷʢϚΠϖʔδ্ʣ ᶅFTP=>S3ಉظґཔ ᶅFTP=>S3ಉظґཔ ᶆS3ಉظ ᶇ݁ՌΛ௨ ᶈαϜωΠϧੜ ᶉૉࡐใΛอଘ Worker
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
• ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔ γεςϜͷεέʔϧԽ
چFTPΞοϓϩʔυγεςϜ PIXTA (Batch) S3 FTP Server ΫϦΤΠλʔ ᶃΞοϓϩʔυ PIXTA
(Admin) ϐΫελ ελοϑ ᶄ࿈བྷʢϚΠϖʔδ্ʣ ᶅFTP=>S3ಉظґཔ ᶅFTP=>S3ಉظґཔ ᶆS3ಉظ ᶇ݁ՌΛ௨ ᶈαϜωΠϧੜ ᶉૉࡐใΛอଘ Worker
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
AWS Lambda ͱ
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
• Inotify + Ruby ͰϑΝΠϧγεςϜΛࢹ • S3ʹϑΝΠϧΛಉظ ᶄS3ʹಉظ
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
ᶅΠϕϯττϦΨ • ΠϕϯττϦΨʹ S3 ΛՃ • Suffix ʹରͱͳΔϑΝΠϧΛࢦఆ • ը૾ɺಈըͦΕͧΕͷ֦ுࢠ
• Event types ʹରͱͳΔΠϕϯτΛࢦఆ • ObjectCreatedͰΦϒδΣΫτ࡞Λର
৽FTPΞοϓϩʔυγεςϜ PIXTA (API) S3 FTP Server Lambda ΫϦΤΠλʔ ᶃΞοϓϩʔυ
ᶄS3ʹಉظ ᶅΠϕϯττϦΨ ᶆαϜωΠϧੜʢಈըʣ ᶆαϜωΠϧอଘʢը૾ʣ ᶆૉࡐใΛอଘ S3 Worker
ᶆLambda • ը૾ϑΝΠϧʹ͍ͭͯ Lambda ͰαϜω ΠϧΛੜͯ͠ɺS3 ʹอଘ • ಈըϑΝΠϧʹ͍ͭͯ αϜωΠϧੜΛ
SQSܦ༝Ͱґཔ • ૉࡐใΛ APIܦ༝Ͱอଘ
ᶆLambda(ը૾αϜωΠϧੜ) import GraphicsMagick from 'gm'; export default class JpgProcessor {
constructor({ awsRegion, srcBucket, srcKey }) { . this.gm = GraphicsMagick.subClass({ imageMagick: true }); . } processImage() { return this._resizeThumbnail(); } _resizeThumbnail() { return this.gm(this.imageDataBody) .resize(THUMBNAIL_SIZE, THUMBNAIL_SIZE) .toBuffer(this.imageType, (err, buffer) => { . . }; } }
݁Ռ • ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • ૉࡐΞοϓϩʔυΛτϦΨʹ͢Δ͜ͱͰɺॲཧϑϩʔ ΛҰํํʹͯ͠ෳࡶ͞Λͳͨ͘͠ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔγεςϜͷ εέʔϧԽ •
ϐΫελελοϑͷ࿈བྷΛͳ͘͠ɺLambdaΛ༻ ͢Δ͜ͱͰεέʔϧԽΛਤͬͨ
ࠓޙͷ՝
Amazon EBS ͷϚϯτ • ॳɺFTPαʔόʔ্Ͱ s3fs Λͬͯ s3 ΛϚ ϯτ͍͕ͯͨ͠ɺύϑΥʔϚϯε͕ग़ͳ͔ͬͨ
• FTPαʔόʔ Ͱɺ1000GBͷEBSΛϚϯτ ͍ͯ͠Δ • 5ಈ͍͍ͯͯίετ͕ 500$ ~ 1000$
Amazon EBS ͷϚϯτ
·ͱΊ
·ͱΊ • ॲཧϑϩʔͷෳࡶ͞ʹΑΔӨڹ • ૉࡐΞοϓϩʔυΛτϦΨʹ͢Δ͜ͱͰɺॲཧϑϩʔ ΛҰํํʹͯ͠ෳࡶ͞Λͳͨ͘͠ • Ξοϓϩʔυ݅૿ՃʹΑΔɺ͞ΒͳΔγεςϜͷ εέʔϧԽ •
ϐΫελελοϑͷ࿈བྷΛͳ͘͠ɺLambdaΛ༻ ͢Δ͜ͱͰεέʔϧԽΛਤͬͨ
We are hiring!
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ mits / 33114786