SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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 » 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
 
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
 
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
 

Ähnlich wie 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 » 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
 
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
 
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
 

Kürzlich hochgeladen

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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.