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
CloudSearch nanapi use case
Search
violetyk
October 17, 2014
Technology
3
2k
CloudSearch nanapi use case
violetyk
October 17, 2014
Tweet
Share
More Decks by violetyk
See All by violetyk
Graid
violetyk
2
6.8k
Other Decks in Technology
See All in Technology
Taming you application's environments
salaboy
0
180
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
170
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
290
強いチームと開発生産性
onk
PRO
33
11k
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.3k
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
43
13k
Fireside Chat
paigeccino
34
3k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Teambox: Starting and Learning
jrom
133
8.8k
Rails Girls Zürich Keynote
gr2m
94
13k
Building an army of robots
kneath
302
43k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Transcript
CloudSearch nanapiͷࣄྫհ גࣜձࣾnanapiɹՃլ୩ ༞ฏ
ࣗݾհ • Ճլ୩ ༞ฏɹ • גࣜձࣾnanapi • nanapi.jpνʔϜɹαʔόαΠυΤϯδχΞ • Vim͕͖
violetyk @yuhei_kagaya
αʔϏεհɹnanapi • ੜ׆ͷܙ͕ू·ΔαΠτ • http://nanapi.jp • ༷ʑͳϋπʔΛఏڙ͢Δ αʔϏε • ݄ؒ2500ສUU
• 10ສهࣄ
αʔϏεհɹnanapiϫʔΫε • ʮnanapiʯϥΠλʔͷҝ ͷϥΠςΟϯάελδΦ • https://works.nanapi.jp
αʔϏεհɹanswer • ଈϨείϛϡχέʔγϣϯΞ ϓϦ • http://answer.jp • 5Ҏͷίϝϯτ͕84%Ҏ্ • 140ສίϝϯτ
• iOS൛ 201312݄ϦϦʔε • Android൛20145݄ϦϦʔε
αʔϏεհɹIGNITION • ίϯηϓτʮຊͱੈ քΛܨ͙ʯϝσΟΞ • http://ignition.co • ຊͷάϩʔόϧԽΛՃ ͢ΔͨΊʹɺຊͷ ใΛӳޠͰੈքʹൃ৴
• Χϧνϟʔ͔ΒϏδωε ·Ͱ෯͘հ
nanapiͰ CloudSearchΛ͍ͬͯ·͢
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
AWSͷҠߦ • 20147݄ɹΠϯϑϥΛAWSશͯҠߦ • ը૾ΦϦδϯαʔόɹˠɹS3 • MemcacheɺRedis ɹˠɹElastiCache • MySQLɹɹɹɹɹ
ɹˠɹRDS • શจݕࡧɹɹɹɹ ɹˠɹCloudSearch
nanapiͷݕࡧγεςϜ Senna ↓ mroonga ↓ CloudSearch
CloudSearchͷӡ༻ • 100,000 υΩϡϝϯτ • 1υϝΠϯ • search.m1.small
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
nanapiͷهࣄݕࡧ
ʮӡಈձʯ×ʮྉཧϨγϐʯ
ʮӡಈձʯ×ʮΧϝϥɾࣸਅʯ
ʮӡಈձʯ×ʮεϙʔπɾΞτυΞʯ
ͱ͍͍ͯײ͡ʂ
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
CloudSearchೖΕΔσʔλ • ݕࡧ༻ • ιʔτ༻ • දࣔ༻
ݕࡧ༻ • هࣄͷλΠτϧɺຊจ • ΧςΰϦ໊ͷ֊ߏ
ιʔτ༻ • PV • هࣄͷࣥච࣌
දࣔ༻ • هࣄͷΞτϥΠϯ • ஶऀใ • هࣄͷΩϟονը૾ͷURL
σʔλͷܕ
֤ςʔϒϧߋ৽࣌ʹίʔϧόοΫ هࣄ ஶऀ ΧςΰϦ ݕࡧσʔλ afterSave()
CloudSearchอଘ هࣄ ஶऀ ΧςΰϦ ݕࡧσʔλ afterSave() CloudSearch
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
CakePHP + CloudSearch • CakePHP͔ΒCloudSearchΛૢ࡞͢ΔϓϥάΠϯ • https://github.com/nanapi/cakephp-cloud-search • AWS SDK
for PHPΛϥοϓͨ͠Datasource • CakePHPͷModelͱͯ͠ѻ͏͜ͱ͕Ͱ͖Δ • Modelͱಉ͡ϝιουɺfind() / save()
อଘ // save $save_data = $this->MyModel->create(); $save_data = [ 'id'
=> '123', 'fields' => [ 'subject' => 'ژͰͷ͓͢͢Ίͷ͓࢈' 'outline' => ['ژͷ͓࢈', '࣮ࡍʹങͬͨ͜ͱͷ͋Δ͓࢈', 'ژͷ͓࢈ʹ͍ͭͯ ͷΞυόΠε'] ] ]; $this->MyModel->save($save_data);
ܕUTC ! CakeTime::i18nFormat($created, "%FT%TZ", false, new DateTimeZone('UTC'));
ݕࡧ // find $result = $this->MyModel->find('all', [ 'conditions' => [
'query' => 'ژ' ], 'fields' => [ 'id', 'subject', '_score' ] ]);
আ // delete $this->MyModel->delete(123); ! $this->MyModel->deleteAll([ 'MyModel.id' => ['111', '222',
'333'], ]);
؆୯ɺγϯϓϧʂ
ࠓ͢͜ͱ ̍ɽCloudSearchಋೖͷ͖͔͚ͬ ̎ɽݕࡧ͍ͯ͠Δͷ ̏ɽݕࡧσʔλͷͭ͘Γ͔ͨ ̐ɽݕࡧͷ͔ͨ͠ ̑ɽCloudSearchͷϝϦοτ
CloudSearchͷϝϦοτ • σϑΥϧτͷ··Ͱ͍͍ײ͡ʹݕࡧͰ͖Δ • ؆୯ʹຊޠશจݕࡧγεςϜΛ࡞ΕΔ • ͱʹָ͔͘
CloudSearchͰΒ͘Β͘ݕࡧʂ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠