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
270
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
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
290
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
410
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
170
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.3k
快速入門可觀測性
blueswen
0
490
情報漏洩させないための設計
kubotak
5
1.3k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
620
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
230
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
920
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
350
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
170
Featured
See All Featured
For a Future-Friendly Web
brad_frost
176
9.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
172
50k
GraphQLとの向き合い方2022年版
quramy
44
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Code Review Best Practice
trishagee
65
17k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Designing Experiences People Love
moore
139
23k
A Philosophy of Restraint
colly
203
16k
The Language of Interfaces
destraynor
155
24k
4 Signs Your Business is Dying
shpigford
182
22k
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