SlideShare a Scribd company logo
1 of 26
Download to read offline
Puppies & Ecommerce as
       an Engine
            Steph Skardal




  All photos Copyright Steph Skardal
Outline

● Traditional
  Monolithic
  Ecommerce
● Ecommerce
  as an Engine
● Rails Goodness
● Example Code
● Piggybak
● Cute puppies

                   I'm cute!
TME: Traditional Monolithic
Ecommerce:
Assumptions made:
● shopping cart & checkout
● products, product attributes
● product navigation
● product features: cross-sell, upsell, reviews
● admin: various features
● access control: admin, users
Problems with TME:
● Heavy on assumptions can make it difficult
  to customize
● Add-on features are not always maintained
● Heavily dependent on direction of platform




         Feeling Trapped?
TME Positives:
● Can get a site up and running quickly
● For a simple site with minimal customization,
  assumptions made by TME may be
  acceptable




      It's not
      all bad.
How do we make things easier?
● Ecommerce as an Engine



  But what does
  that mean?
What are Rails Engines?
● Rails 3 introduced a major rewrite in
  Engines, allowing mountability of mini-
  applications.
                              Engine #1

    Rails application         Engine #2

                              Engine #3


● A Rails engine contains models, views,
  controllers, modules, and routes that plug-in
  to the main application
Why is Rails a good fit?
● And Rails also now has some powerful
  Admin tools (RailsAdmin, ActiveAdmin)
  comparable to Django's core.

● Generally, Rails is a good framework to be
  doing efficient development on (as are other
  MVC frameworks). "Mountability" may be a
  trickier thing to accomplish in Perl, but may
  be possible in catalyst.
Ecommerce as an Engine
● Assumptions of shopping cart and checkout
● Items are added to the cart, which contain a
  quantity, description, subtotal
● Standard order and line item data model
No Product Model

There is no product model. This is important.
Why is there no product model?
● mountability: turn existing models into products
● TMEs tend to overengineer and bloat
  assumptions built around the product model
● In custom sites, products tend to be piled on
  with custom attributes that don't apply to all
  products, adding cruft
Variants Table


● variants table: with polymorphism
 id   item_id item_type               qty   ...
 1    1       Book                    10
 2    1       CompactDisc             4

● Variant.find(1).item = Book.find(1)
● Variant.find(2).item = CompactDisc.find(1)
The "Guts"

class Book < ActiveRecord::Base
 acts_as_variant
end

acts_as_variant does two things:
● has_one :variant, :as => "item", :class_name
   => "::Piggybak::Variant"
● accepts_nested_attributes_for :variant, :
   allow_destroy => true
The "Guts"

class CompactDisc < ActiveRecord::Base
 acts_as_variant
end
The "Guts"
Cart Form and Cart
● included as Rails partial view (include)




● passes variant id and quantity to cart
Line Item Structure
● Order has many line_items:
  id qty variant_id description price total
  1   1    1          Book Title   3.00 3.00
  2   2    2          CD Title     3.00 6.00

● Line item copies description and price at the
  time order is created to preserve product
  information at the time of purchase
● Cart and order logic exercises inventory
  management if specified per variant
Photo Break

 Stop! Tell me it's Almost Over!!
Checkout

● Checkout doesn't care what item types are in
  the cart
● Shipping, Tax, and Payments have common
  APIs for calculating to cover cost of line
  items
Authorize.NET
class AuthorizeNet
 KEYS = ["login", "password"]
 KLASS = ::ActiveMerchant::Billing::AuthorizeNetGateway
end

ActiveMerchant: A popular open-source gem released by
Shopify.com that includes Payment gateway support for
40+ popular payment gateways.

Integration: Payment method directly integrates with
ActiveMerchant, but specifies required payment gateway
key value pairs that are stored in a table that maps to
payment method.
USPS Shipping
class Usps Shipping
 KEYS = ["login", "password", "service_name"]
 def self.request_rates(method, order)
   #returns rate
 end
 def self.available?(method, order)
   #returns boolean
 end
 def self.rate(method, order)
   #returns rate for order
 end
end
USPS Shipping
What does this all mean?

● No assumptions made on:
  ○ product attributes, features
  ○ taxonomy
  ○ access control
● Works for:
  ○ highly customized sites in need of flexibility
  ○ sites with multiple product types, where the
     data model of the product types varies
● Doesn't work for:
  ○ any sites that can evaluate the assumptions
     of TME to be more valuable than custom
     development
Piggybak
● This "Ecommerce as an Engine" philosophy
  is the foundation of Piggybak

               ff on s!
              o ti
            ke mp
         ha su
       S s
           a
        se
    tho
Phunk says:
phunk: I might hit this high level idea a little
harder: "rails engines are pluggable modules of
functionality, and Piggybak is an engine, so that
allows someone to plug this in and easily add
the ecommerce part"

                              Engine #1

    Rails application          Piggybak

                              Engine #3
The Future

● More Piggybak work:
  ○ testing
  ○ implementation for more clients
  ○ line items rearchitecture (?)
     ■ treat everything as a line item
     ■ challenge with this is the admin interface
  ○ support for ActiveAdmin (?)
  ○ keep up with Rails "trends"


● Continue growing the Piggybak baby with
  testing, client implementation, minimal
  features.
Questions?




/me eyes
glaze over

More Related Content

Viewers also liked

Woldehanna Agri-food sector, education and occupation choice of young people ...
Woldehanna Agri-food sector, education and occupation choice of young people ...Woldehanna Agri-food sector, education and occupation choice of young people ...
Woldehanna Agri-food sector, education and occupation choice of young people ...futureagricultures
 
Take part in research to combat atherosclerosis
Take part in research to combat atherosclerosisTake part in research to combat atherosclerosis
Take part in research to combat atherosclerosisXplore Health
 
Pastoralism and livestock marketing at the margins
Pastoralism and livestock marketing at the marginsPastoralism and livestock marketing at the margins
Pastoralism and livestock marketing at the marginsfutureagricultures
 
The film industry
The film industryThe film industry
The film industryNShuttle
 
UNDP Round Table on Indigenous Trade and Development
UNDP Round Table on Indigenous Trade and DevelopmentUNDP Round Table on Indigenous Trade and Development
UNDP Round Table on Indigenous Trade and DevelopmentWayne Dunn
 
Lifestyle unit 6
Lifestyle unit 6Lifestyle unit 6
Lifestyle unit 6Les Davy
 
Social media strategy essentials
Social media strategy essentialsSocial media strategy essentials
Social media strategy essentialsRather Inventive
 

Viewers also liked (18)

C 6
C 6C 6
C 6
 
Woldehanna Agri-food sector, education and occupation choice of young people ...
Woldehanna Agri-food sector, education and occupation choice of young people ...Woldehanna Agri-food sector, education and occupation choice of young people ...
Woldehanna Agri-food sector, education and occupation choice of young people ...
 
Дживаноблисс
ДживаноблиссДживаноблисс
Дживаноблисс
 
Take part in research to combat atherosclerosis
Take part in research to combat atherosclerosisTake part in research to combat atherosclerosis
Take part in research to combat atherosclerosis
 
Purely practical data structures
Purely practical data structuresPurely practical data structures
Purely practical data structures
 
Tarea4
Tarea4Tarea4
Tarea4
 
04 03 wh_chris_walker
04 03 wh_chris_walker04 03 wh_chris_walker
04 03 wh_chris_walker
 
Question 3
Question 3Question 3
Question 3
 
Pastoralism and livestock marketing at the margins
Pastoralism and livestock marketing at the marginsPastoralism and livestock marketing at the margins
Pastoralism and livestock marketing at the margins
 
Question 1
Question 1Question 1
Question 1
 
The film industry
The film industryThe film industry
The film industry
 
UNDP Round Table on Indigenous Trade and Development
UNDP Round Table on Indigenous Trade and DevelopmentUNDP Round Table on Indigenous Trade and Development
UNDP Round Table on Indigenous Trade and Development
 
Education Project Brief
Education Project BriefEducation Project Brief
Education Project Brief
 
Бальямен
БальяменБальямен
Бальямен
 
Lifestyle unit 6
Lifestyle unit 6Lifestyle unit 6
Lifestyle unit 6
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Social media strategy essentials
Social media strategy essentialsSocial media strategy essentials
Social media strategy essentials
 
Gestão de Canais de Distribuição
Gestão de Canais de DistribuiçãoGestão de Canais de Distribuição
Gestão de Canais de Distribuição
 

Similar to Ecommerce as an Engine

26 story slicing techniques for any scrum team
26 story slicing techniques for any scrum team26 story slicing techniques for any scrum team
26 story slicing techniques for any scrum teamagilebin
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engineWO Community
 
Lizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17deLizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17devinaikopp
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauAmasty
 
Simplifi commerce oracle atg commerce & endeca training
Simplifi commerce   oracle atg commerce & endeca trainingSimplifi commerce   oracle atg commerce & endeca training
Simplifi commerce oracle atg commerce & endeca trainingLokesh Kumar
 
Simplifi commerce oracle atg commerce & endeca training - n
Simplifi commerce   oracle atg commerce & endeca training - nSimplifi commerce   oracle atg commerce & endeca training - n
Simplifi commerce oracle atg commerce & endeca training - nLokesh Kumar
 
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - N
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - NSimplifiCommerce - Oracle ATG Commerce & Endeca Training - N
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - NLokesh Kumar
 
Improving Performance on Magento 1*
Improving Performance on Magento 1*Improving Performance on Magento 1*
Improving Performance on Magento 1*David Z. Lerner
 
A differnt Type of Supermarket Delivery
A differnt Type of Supermarket DeliveryA differnt Type of Supermarket Delivery
A differnt Type of Supermarket DeliveryThoughtworks
 
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...Pavel Pratyush
 
openERP- How to connect OpenERP with external Systems, AkretionAkretion base...
openERP-  How to connect OpenERP with external Systems, AkretionAkretion base...openERP-  How to connect OpenERP with external Systems, AkretionAkretion base...
openERP- How to connect OpenERP with external Systems, AkretionAkretion base...Odoo
 
Magento live eCommerce demo tutorial for beginners by Magento Universe
Magento live eCommerce demo tutorial for beginners by Magento UniverseMagento live eCommerce demo tutorial for beginners by Magento Universe
Magento live eCommerce demo tutorial for beginners by Magento UniverseMagento Universe
 
Magento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento UniverseMagento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento UniversePuneet Parashar
 
Evolve13 cq-commerce-framework
Evolve13 cq-commerce-frameworkEvolve13 cq-commerce-framework
Evolve13 cq-commerce-frameworkPaolo Mottadelli
 
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...Amazon Web Services
 
Alexandr Vronskiy "Evolution of Ecommerce Application"
Alexandr Vronskiy "Evolution of Ecommerce Application"Alexandr Vronskiy "Evolution of Ecommerce Application"
Alexandr Vronskiy "Evolution of Ecommerce Application"Fwdays
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Parth Lawate
 
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017Iztok Smolic
 

Similar to Ecommerce as an Engine (20)

26 story slicing techniques for any scrum team
26 story slicing techniques for any scrum team26 story slicing techniques for any scrum team
26 story slicing techniques for any scrum team
 
Silverstripe Ecommerce
Silverstripe EcommerceSilverstripe Ecommerce
Silverstripe Ecommerce
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engine
 
Lizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17deLizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17de
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir Kalashnikau
 
Simplifi commerce oracle atg commerce & endeca training
Simplifi commerce   oracle atg commerce & endeca trainingSimplifi commerce   oracle atg commerce & endeca training
Simplifi commerce oracle atg commerce & endeca training
 
Simplifi commerce oracle atg commerce & endeca training - n
Simplifi commerce   oracle atg commerce & endeca training - nSimplifi commerce   oracle atg commerce & endeca training - n
Simplifi commerce oracle atg commerce & endeca training - n
 
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - N
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - NSimplifiCommerce - Oracle ATG Commerce & Endeca Training - N
SimplifiCommerce - Oracle ATG Commerce & Endeca Training - N
 
Improving Performance on Magento 1*
Improving Performance on Magento 1*Improving Performance on Magento 1*
Improving Performance on Magento 1*
 
A differnt Type of Supermarket Delivery
A differnt Type of Supermarket DeliveryA differnt Type of Supermarket Delivery
A differnt Type of Supermarket Delivery
 
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...
Migration of a high-traffic E-commerce website from Legacy Monolith to Micros...
 
openERP- How to connect OpenERP with external Systems, AkretionAkretion base...
openERP-  How to connect OpenERP with external Systems, AkretionAkretion base...openERP-  How to connect OpenERP with external Systems, AkretionAkretion base...
openERP- How to connect OpenERP with external Systems, AkretionAkretion base...
 
Magento live eCommerce demo tutorial for beginners by Magento Universe
Magento live eCommerce demo tutorial for beginners by Magento UniverseMagento live eCommerce demo tutorial for beginners by Magento Universe
Magento live eCommerce demo tutorial for beginners by Magento Universe
 
Magento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento UniverseMagento Live eCommerce Demo Tutorial for Beginners » Magento Universe
Magento Live eCommerce Demo Tutorial for Beginners » Magento Universe
 
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo MottadelliEVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
EVOLVE'13 | Enhance | Ecommerce Framework | Paolo Mottadelli
 
Evolve13 cq-commerce-framework
Evolve13 cq-commerce-frameworkEvolve13 cq-commerce-framework
Evolve13 cq-commerce-framework
 
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
AWS re:Invent 2016: How Fulfillment by Amazon (FBA) and Scopely Improved Resu...
 
Alexandr Vronskiy "Evolution of Ecommerce Application"
Alexandr Vronskiy "Evolution of Ecommerce Application"Alexandr Vronskiy "Evolution of Ecommerce Application"
Alexandr Vronskiy "Evolution of Ecommerce Application"
 
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
Techjoomla Infrastructure Extensions - Adding an Enterprise Layer to Joomla!
 
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017
Drupal Commerce 2 for Drupal 8 - Drupal camp Antwerp 2017
 

Recently uploaded

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Ecommerce as an Engine

  • 1. Puppies & Ecommerce as an Engine Steph Skardal All photos Copyright Steph Skardal
  • 2. Outline ● Traditional Monolithic Ecommerce ● Ecommerce as an Engine ● Rails Goodness ● Example Code ● Piggybak ● Cute puppies I'm cute!
  • 3. TME: Traditional Monolithic Ecommerce: Assumptions made: ● shopping cart & checkout ● products, product attributes ● product navigation ● product features: cross-sell, upsell, reviews ● admin: various features ● access control: admin, users
  • 4. Problems with TME: ● Heavy on assumptions can make it difficult to customize ● Add-on features are not always maintained ● Heavily dependent on direction of platform Feeling Trapped?
  • 5. TME Positives: ● Can get a site up and running quickly ● For a simple site with minimal customization, assumptions made by TME may be acceptable It's not all bad.
  • 6. How do we make things easier? ● Ecommerce as an Engine But what does that mean?
  • 7. What are Rails Engines? ● Rails 3 introduced a major rewrite in Engines, allowing mountability of mini- applications. Engine #1 Rails application Engine #2 Engine #3 ● A Rails engine contains models, views, controllers, modules, and routes that plug-in to the main application
  • 8. Why is Rails a good fit? ● And Rails also now has some powerful Admin tools (RailsAdmin, ActiveAdmin) comparable to Django's core. ● Generally, Rails is a good framework to be doing efficient development on (as are other MVC frameworks). "Mountability" may be a trickier thing to accomplish in Perl, but may be possible in catalyst.
  • 9. Ecommerce as an Engine ● Assumptions of shopping cart and checkout ● Items are added to the cart, which contain a quantity, description, subtotal ● Standard order and line item data model
  • 10. No Product Model There is no product model. This is important. Why is there no product model? ● mountability: turn existing models into products ● TMEs tend to overengineer and bloat assumptions built around the product model ● In custom sites, products tend to be piled on with custom attributes that don't apply to all products, adding cruft
  • 11. Variants Table ● variants table: with polymorphism id item_id item_type qty ... 1 1 Book 10 2 1 CompactDisc 4 ● Variant.find(1).item = Book.find(1) ● Variant.find(2).item = CompactDisc.find(1)
  • 12. The "Guts" class Book < ActiveRecord::Base acts_as_variant end acts_as_variant does two things: ● has_one :variant, :as => "item", :class_name => "::Piggybak::Variant" ● accepts_nested_attributes_for :variant, : allow_destroy => true
  • 13. The "Guts" class CompactDisc < ActiveRecord::Base acts_as_variant end
  • 15. Cart Form and Cart ● included as Rails partial view (include) ● passes variant id and quantity to cart
  • 16. Line Item Structure ● Order has many line_items: id qty variant_id description price total 1 1 1 Book Title 3.00 3.00 2 2 2 CD Title 3.00 6.00 ● Line item copies description and price at the time order is created to preserve product information at the time of purchase ● Cart and order logic exercises inventory management if specified per variant
  • 17. Photo Break Stop! Tell me it's Almost Over!!
  • 18. Checkout ● Checkout doesn't care what item types are in the cart ● Shipping, Tax, and Payments have common APIs for calculating to cover cost of line items
  • 19. Authorize.NET class AuthorizeNet KEYS = ["login", "password"] KLASS = ::ActiveMerchant::Billing::AuthorizeNetGateway end ActiveMerchant: A popular open-source gem released by Shopify.com that includes Payment gateway support for 40+ popular payment gateways. Integration: Payment method directly integrates with ActiveMerchant, but specifies required payment gateway key value pairs that are stored in a table that maps to payment method.
  • 20. USPS Shipping class Usps Shipping KEYS = ["login", "password", "service_name"] def self.request_rates(method, order) #returns rate end def self.available?(method, order) #returns boolean end def self.rate(method, order) #returns rate for order end end
  • 22. What does this all mean? ● No assumptions made on: ○ product attributes, features ○ taxonomy ○ access control ● Works for: ○ highly customized sites in need of flexibility ○ sites with multiple product types, where the data model of the product types varies ● Doesn't work for: ○ any sites that can evaluate the assumptions of TME to be more valuable than custom development
  • 23. Piggybak ● This "Ecommerce as an Engine" philosophy is the foundation of Piggybak ff on s! o ti ke mp ha su S s a se tho
  • 24. Phunk says: phunk: I might hit this high level idea a little harder: "rails engines are pluggable modules of functionality, and Piggybak is an engine, so that allows someone to plug this in and easily add the ecommerce part" Engine #1 Rails application Piggybak Engine #3
  • 25. The Future ● More Piggybak work: ○ testing ○ implementation for more clients ○ line items rearchitecture (?) ■ treat everything as a line item ■ challenge with this is the admin interface ○ support for ActiveAdmin (?) ○ keep up with Rails "trends" ● Continue growing the Piggybak baby with testing, client implementation, minimal features.