SlideShare a Scribd company logo
Rails Model Engine
Framework
A framework for Rails applications
sharing a common data model engine
Rails Meetup May 20, 2014
Jonathan Kolyer
jonathan@paynearme.com
Framework
• Data Engine: Rails engine with namespaced data
model
• Web: Rails app for web views
• API: Rails app for API only
• Admin: Rails app for management
• Services: Backend, asynchronous services
• Env: Bash scripts for environment, deployment, etc.
Motivation
• Separation of Concerns
• Many > 1
• Framework for scaling the codebase
• Testing & Deployment considerations
Connect the Dots
• One github repo
• Engine oil: bash scripts
• Symlinks are your friend: database.yml,
initializers, configuration
• Gemfile sharing
Engine
Sample Model Structure:
module namespacing
• payments_engine
• account
• media
• notify
• Example: PaymentsEngine::Account::User,
PaymentsEngine::Media::Photo
Linking Apps
• /engine
• app/models/payments_engine
• /api
• config
• ../../payments_engine/config/database.yml
• Gemfile
• gem ‘payments_engine’, :path => ‘../payments_engine’
• eval(IO.read(“#{File.dirname(__FILE_)/../
payments_engine/Gemfile”), binding)
• Run migrations in the services rails app
Environment
• Bash scripts: navigation, deployment, shortcuts
• Load from $HOME/.bashrc
• env.bash: root script; sources other scripts
• rails.bash: open console; run server; rake tasks
• db.bash: db shell; run migrations
• env_{development, test, production}.bash
• services.bash: daemon mgmt; logging
Web / API
• Standard web-view / RESTful hosted app(s)
• Shares auth logic
• Differing performance characteristics
Admin
• Dedicated Rails app for administrative data
access
• ActiveAdmin gem
• Internal use only
Services
• Asynchronous back-end services
• cron jobs
• batch jobs
• Data migrations
• Rails or non-Rails

More Related Content

What's hot (20)

PDF
Single Page Apps
Gil Fink
 
PPTX
Prism Forms App
Rod Hemphill
 
PPTX
Building High-Performance applications with .NET 5 and Vue JS 3
Alexandre Malavasi
 
PPTX
Site templates, site life cycle management and Modern SharePoint
Albert-Jan Schot
 
PPTX
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
SPTechCon
 
PPTX
Building SharePoint Single Page Applications Using AngularJS
SharePointInstitute
 
KEY
Radiant CMS - Boston.rb 7/12
joliveira
 
PPTX
Xamarin tools
Kym Phillpotts
 
PDF
Building a Headless Shop
PascalKaufmann
 
PDF
Google app engine
Pawandeep Singh
 
PDF
Symfony demonstration
Stephen McAuley
 
PDF
Common iOS Architecture: From MVC to VIPER, with Redux
Nelson Tai
 
PPT
Web server
Namrata_Thakare
 
PDF
«The Grail: React based Isomorph apps framework»​
FDConf
 
PDF
PLAT-8 Spring Web Scripts and Spring Surf
Alfresco Software
 
PDF
Asp Technology
a71_barletta
 
PDF
«I knew there had to be a better way to build mobile app»​
FDConf
 
PDF
Google App Engine - September 17 2009
sullis
 
PPTX
Monolith to microservices - our journey
Giles Williams
 
PPTX
Serverless Computing with Azure Functions and Xamarin
Mark Arteaga
 
Single Page Apps
Gil Fink
 
Prism Forms App
Rod Hemphill
 
Building High-Performance applications with .NET 5 and Vue JS 3
Alexandre Malavasi
 
Site templates, site life cycle management and Modern SharePoint
Albert-Jan Schot
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
SPTechCon
 
Building SharePoint Single Page Applications Using AngularJS
SharePointInstitute
 
Radiant CMS - Boston.rb 7/12
joliveira
 
Xamarin tools
Kym Phillpotts
 
Building a Headless Shop
PascalKaufmann
 
Google app engine
Pawandeep Singh
 
Symfony demonstration
Stephen McAuley
 
Common iOS Architecture: From MVC to VIPER, with Redux
Nelson Tai
 
Web server
Namrata_Thakare
 
«The Grail: React based Isomorph apps framework»​
FDConf
 
PLAT-8 Spring Web Scripts and Spring Surf
Alfresco Software
 
Asp Technology
a71_barletta
 
«I knew there had to be a better way to build mobile app»​
FDConf
 
Google App Engine - September 17 2009
sullis
 
Monolith to microservices - our journey
Giles Williams
 
Serverless Computing with Azure Functions and Xamarin
Mark Arteaga
 

Viewers also liked (6)

PPT
WebSocket 实时推特流
shaokun
 
KEY
iOS 图片浏览器 DIY
shaokun
 
KEY
Rails web api 开发
shaokun
 
KEY
More to RoC weibo
shaokun
 
PPTX
Rails Engine | Modular application
mirrec
 
PPT
Git flow
shaokun
 
WebSocket 实时推特流
shaokun
 
iOS 图片浏览器 DIY
shaokun
 
Rails web api 开发
shaokun
 
More to RoC weibo
shaokun
 
Rails Engine | Modular application
mirrec
 
Git flow
shaokun
 
Ad

Similar to Rails Engines (20)

PPTX
Rails Engine :: modularize you app
Muntasim Ahmed
 
PPT
Rails engines
Josh Schramm
 
PDF
Rails engines
Ismael G Marín C
 
PDF
Rails Engines
Dimitrios Zorbas
 
PDF
Rails Engines - A presentation for the 22nd Athens Ruby Meetup
Skroutz S.A.
 
PDF
Ruby On Rails Basics
Amit Solanki
 
PPT
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Andy Maleh
 
PDF
APIs for mobile
Andrei Navarro
 
PPT
Ruby On Rails
Gautam Rege
 
PPTX
Rails Engine Patterns
Andy Maleh
 
PDF
Rails Engines as a way to Micro services
Lucas Alencar
 
KEY
Service Oriented Applications
Michael Bensoussan
 
KEY
Modern Webdevelopment With Ruby On Rails
Robert Glaser
 
PDF
Ruby on rails vs asp.net mvc
Umar Ali
 
KEY
Ruby On Rails
Eric Berry
 
PDF
Ruby On Rails
Balint Erdi
 
PPT
Ruby Software Architecture
Franck Verrot
 
PDF
Ecommerce as an Engine
stephskardal
 
PDF
RubyEnRails2007 - Dr Nic Williams - Keynote
Dr Nic Williams
 
PPT
Beautiful Models in PHP
brandonsavage
 
Rails Engine :: modularize you app
Muntasim Ahmed
 
Rails engines
Josh Schramm
 
Rails engines
Ismael G Marín C
 
Rails Engines
Dimitrios Zorbas
 
Rails Engines - A presentation for the 22nd Athens Ruby Meetup
Skroutz S.A.
 
Ruby On Rails Basics
Amit Solanki
 
Revised Rails Engine Patterns for Montreal.rb meetup Oct 16, 2012
Andy Maleh
 
APIs for mobile
Andrei Navarro
 
Ruby On Rails
Gautam Rege
 
Rails Engine Patterns
Andy Maleh
 
Rails Engines as a way to Micro services
Lucas Alencar
 
Service Oriented Applications
Michael Bensoussan
 
Modern Webdevelopment With Ruby On Rails
Robert Glaser
 
Ruby on rails vs asp.net mvc
Umar Ali
 
Ruby On Rails
Eric Berry
 
Ruby On Rails
Balint Erdi
 
Ruby Software Architecture
Franck Verrot
 
Ecommerce as an Engine
stephskardal
 
RubyEnRails2007 - Dr Nic Williams - Keynote
Dr Nic Williams
 
Beautiful Models in PHP
brandonsavage
 
Ad

Recently uploaded (20)

PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PPTX
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
Mechanical Design of shell and tube heat exchangers as per ASME Sec VIII Divi...
shahveer210504
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Hashing Introduction , hash functions and techniques
sailajam21
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 

Rails Engines

  • 1. Rails Model Engine Framework A framework for Rails applications sharing a common data model engine Rails Meetup May 20, 2014 Jonathan Kolyer [email protected]
  • 2. Framework • Data Engine: Rails engine with namespaced data model • Web: Rails app for web views • API: Rails app for API only • Admin: Rails app for management • Services: Backend, asynchronous services • Env: Bash scripts for environment, deployment, etc.
  • 3. Motivation • Separation of Concerns • Many > 1 • Framework for scaling the codebase • Testing & Deployment considerations
  • 4. Connect the Dots • One github repo • Engine oil: bash scripts • Symlinks are your friend: database.yml, initializers, configuration • Gemfile sharing
  • 5. Engine Sample Model Structure: module namespacing • payments_engine • account • media • notify • Example: PaymentsEngine::Account::User, PaymentsEngine::Media::Photo Linking Apps • /engine • app/models/payments_engine • /api • config • ../../payments_engine/config/database.yml • Gemfile • gem ‘payments_engine’, :path => ‘../payments_engine’ • eval(IO.read(“#{File.dirname(__FILE_)/../ payments_engine/Gemfile”), binding) • Run migrations in the services rails app
  • 6. Environment • Bash scripts: navigation, deployment, shortcuts • Load from $HOME/.bashrc • env.bash: root script; sources other scripts • rails.bash: open console; run server; rake tasks • db.bash: db shell; run migrations • env_{development, test, production}.bash • services.bash: daemon mgmt; logging
  • 7. Web / API • Standard web-view / RESTful hosted app(s) • Shares auth logic • Differing performance characteristics
  • 8. Admin • Dedicated Rails app for administrative data access • ActiveAdmin gem • Internal use only
  • 9. Services • Asynchronous back-end services • cron jobs • batch jobs • Data migrations • Rails or non-Rails