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
マイクロサービスを作ろう
Search
xorphitus
September 16, 2016
Programming
0
150
マイクロサービスを作ろう
マイクロサービスに関するネタプレゼンです。
Haskell, Clojure
xorphitus
September 16, 2016
Tweet
Share
More Decks by xorphitus
See All by xorphitus
オリジナリティのあるGitLabを標準に近づける
xorphitus
1
750
コンテナ起動への道
xorphitus
0
160
型システムを学ぼうとした結果
xorphitus
0
67
M-x doctor
xorphitus
0
160
型で数を表そう
xorphitus
0
97
AOT と direct linking
xorphitus
0
77
CFS入門
xorphitus
0
76
HyperLogLog
xorphitus
0
110
immutable database
xorphitus
0
310
Other Decks in Programming
See All in Programming
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.5k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
CSC307 Lecture 08
javiergs
PRO
0
670
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
600
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
200
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
980
Patterns of Patterns
denyspoltorak
0
1.4k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
720
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
110
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Crafting Experiences
bethany
1
49
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
330
Ruling the World: When Life Gets Gamed
codingconduct
0
140
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
78
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
69
Transcript
マイクロサービスを作ろう @xorphitus (2016-09-16)
マイクロサービス がバズワード化 して久しい昨今
どんな構成が 望ましいのか?
数年前から言われてること • フロントは動的な言語で手早く作れるように • バックは静的な言語で手堅く作れるように なんかよく聞く話
つまり… どういうこと だってばよ?
こうですか!?分かりません>< Dynamic Front Static Back Interaction via HTTP
よし これで行こう
通信データフォーマットは? 汎用的なものが良い つまり、定番のアレだな
こうですか!?分かりません>< Dynamic Front Static Back Interaction via HTTP (S式)
すべてが になる (S)
しかしここで 問題発生
HaskellにはS式型がない 想定外の事態に直面し、プロジェクトは難航
S式型 なければ作ろう エンジニア ヘテロジニアスで可変長なデータ構造になるので、完全なタイプセーフは無理 とりあえず値は内部的にはByteStringで保持することになった https://github.com/xorphitus/yesod-sexp-server/blob/master/main.hs#L19 あとはYesodを使ってHTTP通信できるようにすればOK
フロントはClojureScript がちフロントのところだけ https://github.com/xorphitus/yesod-sexp-client Quilで見栄えをよくしておく https://github.com/quil/quil 最近更新されてないけど大丈夫か…
動作デモ
コードはこちら(再掲) • https://github.com/xorphitus/yesod-sexp-server • https://github.com/xorphitus/yesod-sexp-client
こうして無事に マイクロサービスが 作れた
想定問答
EDNじゃダメなんですか? Q. フロントがClojureで構築されるなら データ形式はS式よりもEDNの方が楽なのでは? ※Clojureは純粋なS式ではなくEDNである
EDNじゃダメなんですか? A. ダメです フロントがもしEmacsだったらどうするのでしょうか Emacs〜Haskellサーバ間のRPCも考慮に入れた結果です
こうですか!?分かりません>< Dynamic Fronts Static Back Interaction via HTTP (S式)
Arch LinuxでYesodするには? この場の多くの人がやると思うのでアドバイス: libtinfo周りで躓きます $ yaourt -S haskell-stack libtinfo $
sudo ln -s /lib64/libtinfo.so.6 /lib64/libtinfo.so.5 (ちょっとヤダ…) その後 yesod 導入 $ stack new アプリ名 yesod-テンプレ名 (以降、公式と同じ手順)
ご清聴 ありがとう ございました!