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
710
コンテナ起動への道
xorphitus
0
150
型システムを学ぼうとした結果
xorphitus
0
65
M-x doctor
xorphitus
0
140
型で数を表そう
xorphitus
0
93
AOT と direct linking
xorphitus
0
76
CFS入門
xorphitus
0
75
HyperLogLog
xorphitus
0
95
immutable database
xorphitus
0
290
Other Decks in Programming
See All in Programming
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
12
7.2k
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
fossamagna
2
100
Introduce Hono CLI
yusukebe
6
3.1k
AkarengaLT vol.38
hashimoto_kei
1
130
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.6k
Webサーバーサイド言語としてのRustについて
kouyuume
1
5k
CSC305 Lecture 11
javiergs
PRO
0
310
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.2k
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
1.8k
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.7k
NIKKEI Tech Talk#38
cipepser
0
300
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
120
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
890
Side Projects
sachag
455
43k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
620
The World Runs on Bad Software
bkeepers
PRO
72
11k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
Designing for Performance
lara
610
69k
Navigating Team Friction
lara
190
15k
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-テンプレ名 (以降、公式と同じ手順)
ご清聴 ありがとう ございました!