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
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
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
450
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
230
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
20
11k
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.5k
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
100
Namespace and Its Future
tagomoris
6
700
Navigating Dependency Injection with Metro
zacsweers
3
260
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
120
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
testingを眺める
matumoto
1
140
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
440
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
300
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
How STYLIGHT went responsive
nonsquared
100
5.8k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Typedesign – Prime Four
hannesfritz
42
2.8k
Faster Mobile Websites
deanohume
309
31k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Optimizing for Happiness
mojombo
379
70k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
We Have a Design System, Now What?
morganepeng
53
7.8k
Making Projects Easy
brettharned
117
6.4k
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