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
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
290
From Translations to Multi Dimension Entities
alexanderschranz
2
130
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.3k
Jakarta EE meets AI
ivargrimstad
0
260
Go の GC の不得意な部分を克服したい
taiyow
3
790
命名をリントする
chiroruxx
1
410
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
260
たのしいparse.y
ydah
3
120
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
0
130
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Featured
See All Featured
Site-Speed That Sticks
csswizardry
2
190
Thoughts on Productivity
jonyablonski
67
4.4k
Optimizing for Happiness
mojombo
376
70k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Statistics for Hackers
jakevdp
796
220k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
How STYLIGHT went responsive
nonsquared
95
5.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Building an army of robots
kneath
302
44k
Documentation Writing (for coders)
carmenintech
66
4.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
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