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
Rails Engines as a way to Micro Services
Search
Lucas André de Alencar
September 24, 2016
Programming
0
190
Rails Engines as a way to Micro Services
Talk presented at Rubyconf Brasil 2016
Lucas André de Alencar
September 24, 2016
Tweet
Share
More Decks by Lucas André de Alencar
See All by Lucas André de Alencar
Construindo aplicação Rails preparadas para uma arquitetura de Micro serviços
lucasandre
1
800
Melhorando a qualidade derrotando um mutante por vez
lucasandre
2
260
Fiz um seminário sobre produtividade e olha no que deu!
lucasandre
0
54
REST APIs on Rails (v2)
lucasandre
0
180
Devs dando pitacos - Trilha UX Design - TDC 2016
lucasandre
0
91
Email Authentication && The Hidden Email Battle
lucasandre
0
59
REST APIs on Rails
lucasandre
4
270
Other Decks in Programming
See All in Programming
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
400
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.4k
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
120
Haze - Real time background blurring
chrisbanes
1
500
CSC305 Lecture 25
javiergs
PRO
0
130
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
CSC305 Lecture 26
javiergs
PRO
0
130
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
320
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
760
AWS認定資格を勉強した先に何があったか
satoshi256kbyte
2
210
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Designing for Performance
lara
604
68k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
Visualization
eitanlees
145
15k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
1
160
Rails Girls Zürich Keynote
gr2m
94
13k
Fireside Chat
paigeccino
34
3.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Faster Mobile Websites
deanohume
305
30k
Producing Creativity
orderedlist
PRO
341
39k
Transcript
RAILS ENGINES MICRO SERVICES AS A WAY TO
LUCAS ALENCAR @lucasalencar @alencar.lucas.a @lucasandre
None
None
None
None
MONOLITHIC ARCHITECTURE
LEVEL OF ABSTRACTION WE ARE MAYBE MISSING A
CLASSES METHODS MODULES ????????
CLASSES METHODS MODULES SERVICES
MICRO SERVICES
I HATE DEVOPS!
I’M LAZY…
RAILS ENGINES
MICRO SERVICES STARTS AT CODE
DECOUPLING STARTS AT CODE
RAILS ENGINES ARE NOT MICRO SERVICES
RAILS ENGINES ARE NOT MICRO SERVICES (YET)
IMPROVED Communication Collaboration Creation Maintenance Comprehension
RD STATION EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS MARKETING
BI LEADS MANAGEMENT SEGMENTATION
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
EMAIL MARKETING LANDING PAGES SOCIAL MEDIA POSTS LEADS MANAGEMENT SEGMENTATION
LEADS IMPORT MARKETING AUTOMATION EMAILS CUSTOM FIELDS SOCIAL MEDIAS DASHBOARD
ARE FREE* RAILS ENGINES * Sort of…
HOW CAN I DO IT?
~/code rails plugin new engines/engineX --mountable create create README.rdoc create
Rakefile create engine_x.gemspec create MIT-LICENSE create .gitignore create Gemfile create app create app/controllers/engine_x/application_controller.rb create app/helpers/engine_x/application_helper.rb create app/mailers create app/models create app/views/layouts/engine_x/application.html.erb create app/assets/images/engine_x create app/assets/images/engine_x/.keep create config/routes.rb create lib/engine_x.rb create lib/tasks/engine_x_tasks.rake
SINGLE REPOSITORY MULTIPLE REPOSITORIES
. ├── app ├── bin ├── config ├── db ├──
engines │ ├── engineX │ ├── engineY │ └── engineZ ├── lib ├── public ├── test └── tmp
1 source 'https://rubygems.org' 2 3 path './engines' do 4 gem
'engineX' 5 gem 'engineY' 6 gem 'engineZ' 7 end 8 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL Gemfile
WHY NOT USE OUR GOOD OLD GEMS?
. ├── app ├── config └── engines └── engineX ├──
app │ ├── controllers │ ├── helpers │ ├── models │ └── views ├── config │ └── routes.rb ├── Gemfile └── engine_x.gemspec
WHAT GOES INSIDE AN ENGINE? CODE TESTS DUMMY APP FOR
TESTS (AUTOMATED AND MANUAL) DATA MIGRATIONS ROUTES
1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace
EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace
EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace
EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
1 module EngineX 2 class Engine < ::Rails::Engine 3 isolate_namespace
EngineX 4 end 5 end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ NORMAL lib/engine_x/engine.rb
AVOID CIRCULAR DEPENDENCIES
MAIN APP ENGINE
MAIN APP ENGINE
MICRO SERVICE? HOW A RAILS ENGINE CAN BECOME A
RD STATION DB EMAIL MARKETING LANDING PAGES
RD STATION DB EMAIL MARKETING LANDING PAGES email_marketing_* landing_pages_*
RD STATION EMAIL MARKETING DB EMAIL MARKETING LANDING PAGES email_marketing_*
landing_pages_* LANDING PAGES DB
WHY SHOULD I USE RAILS ENGINES INSTEAD OF GOING ALL
THE WAY TO MICRO SERVICES ?
WHY SHOULD I USE RAILS ENGINES INSTEAD OF GOING ALL
THE WAY TO MICRO SERVICES ?
RAILS ENGINES MICRO SERVICES AS A WAY TO
Thanks LUCAS ALENCAR we’re hiring! bit.ly/2dofWZj
[email protected]
shipit.resultadosdigitais.com.br