Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nitty Gritty Service Building
Search
Lauren Voswinkel
August 12, 2014
Programming
0
260
Nitty Gritty Service Building
Lauren Voswinkel
August 12, 2014
Tweet
Share
More Decks by Lauren Voswinkel
See All by Lauren Voswinkel
Advanced Javascript Basics
valarissa
1
230
Putting Off Persistence
valarissa
1
180
Other Decks in Programming
See All in Programming
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
460
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
tparseでgo testの出力を見やすくする
utgwkk
2
210
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
150
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
150
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.2k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
430
Integrating WordPress and Symfony
alexandresalome
0
150
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
460
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Agile that works and the tools we love
rasmusluckow
331
21k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Done Done
chrislema
186
16k
Practical Orchestrator
shlominoach
190
11k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Site-Speed That Sticks
csswizardry
13
1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
The World Runs on Bad Software
bkeepers
PRO
72
12k
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