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
Nitty Gritty Service Building
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Lauren Voswinkel
August 12, 2014
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nitty Gritty Service Building
Lauren Voswinkel
August 12, 2014
More Decks by Lauren Voswinkel
See All by Lauren Voswinkel
Advanced Javascript Basics
valarissa
1
230
Putting Off Persistence
valarissa
1
190
Other Decks in Programming
See All in Programming
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
760
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.1k
Claspは野良GASの夢をみるか
takter00
0
170
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
170
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
1.5k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
620
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
500
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
320
Lessons from Spec-Driven Development
simas
PRO
0
140
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
830
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
150
Featured
See All Featured
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
Documentation Writing (for coders)
carmenintech
77
5.4k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
960
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Into the Great Unknown - MozCon
thekraken
41
2.5k
Embracing the Ebb and Flow
colly
88
5.1k
How GitHub (no longer) Works
holman
316
150k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
220
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
430
Amusing Abliteration
ianozsvald
1
200
Transcript
Nitty Gritty Service Building Lauren Voswinkel @laurenvoswinkel Github: valarissa
None
Service! Oriented! Architecture
Service?
Unassociated
Loosely Coupled
Self- Contained
Unit of Functionality
Singularly! Focused! Application
Benefits
Benefits • Asynchronous*
Benefits • Asynchronous* • Parallelize-able
Benefits • Asynchronous* • Parallelize-able • Loose Coupling
Benefits • Asynchronous* • Parallelize-able • Loose Coupling • Faster
Tests*
Benefits • Asynchronous* • Parallelize-able • Loose Coupling • Faster
Tests* • Easier to Extend/Change
Benefits • Asynchronous* • Parallelize-able • Loose Coupling • Faster
Tests* • Easier to Extend/Change • Increased Velocity
None
HOW?!
None
So many services!
New API,! New Possibilities
Dog Food! Client
Let’s Get! Started
Building a Service 1. Determine what the service will do
Services should do one thing well
Services should do ONE thing well
Building a Service 1. Determine what the Service Does 2.
Create Endpoints for Service
What are the endpoints of your service?
Build Controllers
Determine Request Options
Filters for Response?
Multiple Objects Per Request?
ActiveModel ::Serializers! ! https://github.com/rails-api/active_model_serializers
ActiveModel::Serializers
Write Tests
Write Tests
Contract Your Service Fulfills
Building a Service 1. Determine what the Service Does 2.
Create Endpoints for Service 3. Create Client Models
Don’t Use Plain Responses
WARNING: Evil Magic
None
None
None
CAUTION:! Great For Rapid- Prototyping…! ! Terrible For! Everything Else
Write Tests
Proof That Service Hasn’t Changed
SonJay! https://github.com/stevecj/son_jay
SonJay
SonJay
Building a Service 1. Determine what the Service Does 2.
Create Endpoints for Service 3. Create Client Models 4. Create Communication Layer
Find a gem
Typhoeus! https://github.com/typhoeus/typhoeus
Concurrent Requests
WRAP THE GEM
WRAP.! THE.! GEM.
ActiveRecord! 2.3 -> 3.x
BONUS STEP!
Client Models
+
Communication! Layer
=
None
Errr…
None
Building a Service 1. Determine what the Service Does 2.
Create Endpoints for Service 3. Create Client Models 4. Create Communication Layer 5. Sever Dependencies
Replace DB Calls With Service Calls
Create the Gap
None
CAUTION:! Multi-Request! Server Needed
WEBrick- Wall
Building a Service 1. Determine what the Service Does 2.
Create Endpoints for Service 3. Create Client Models 4. Create Communication Layer 5. Sever Dependencies 6. Improve Service Performance
Round-Trip > DB Call
Tools
StackProf! https://github.com/tmm1/stackprof! ! (Ruby 2.1+)
PerfTools.rb! https://github.com/tmm1/perftools.rb! ! (All Other Rubies)
PerfTools
PerfTools
PerfTools
PerfTools
Building a Service 1. Determine what the service will do
2. Create Endpoints for Service 3. Create Client Models 4. Create Communication Layer 5. Sever Dependencies 6. Improve Performance 7. Transfer Client and/or Service
Extract! From Original Codebase
Extract Tables/ Database
Figure Out How To Keep Multiple Databases In Sync
…
Please?
I have no clue how to do that part…
Give a talk on that maybe?
Thanks!
Lauren Voswinkel @laurenvoswinkel