michael tucker, godaddy_how godaddy used spree to build their online store product @ open commerce...

36
Powered by

Upload: spark-solutions

Post on 12-Apr-2017

2.666 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Powered by

Page 2: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Me llamo MiguelI do this

Page 3: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016
Page 4: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

My Team

Page 5: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

“Mermaid Tucker”

Page 6: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016
Page 7: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

#[email protected] @mtazva

Page 8: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Online StoreThe Pit of Success

[Powered by

Spree]

Page 9: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Why Spree?

● Easily Customizable

● Fully Featured

● Existing API

● Highly Extensible

● Great Community!

Page 10: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

by developersfor developers

Page 11: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Simplifying the Experience● Grid-based options building● Simple customization via themes engine● Automatic PayPal activation● Automatic domain management● Automatic SSL management● Automatic label printing● Hiding the dirty details

Page 12: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Magnifying the Impact● Automatic email marketing integration● Simple and automatic Facebook store● One-click product reviews engine

Page 13: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

SaaS-ification● Multi-tenancy● Themes engine● Internal integrations (single sign-on, domains, others)● GoDaddy branding

Page 14: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016
Page 15: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

We are the 1%

Page 16: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Making the SaleGet Published

Page 17: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Making the SaleGet Social!

Page 18: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Scaling Spree - Tech Stack● CentOS 6● Ruby 2.2● Ceph (internal cloud storage)● Github / GHE● Jenkins for CI/CD● Puppet● Hadoop● StatsD and Graphite● NewRelic● SumoLogic● Honeybadger

● Apache Traffic Server 5.3● HAProxy 1.5● Apache 2.2● Unicorn 4.9● Rails 4.1 [https://github.com/spree/spree/pull/7192]

● Spree 2.2● Bootstrap 3● React 0.14● Delayed Job● Memcached● MySql 5.5● Akamai CDN

Page 19: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Scaling Spree - ArchitectureA10

CommonDB

API(4)

App(6)

MerchantDB

ATS

HAProxy

ATS

HAProxy

ATS

HAProxy

ATS

HAProxy

SSL Termination

Redundancy

Horizontal Scaling

Context-specific dataGlobal metadata

Job(4)

Memcached(4)

Page 20: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Scaling Spree - Performance● 10s of thousands of unique live storefronts● ~1.5M page views per day● Average page response time ~2.5s● Average server response ~300ms● Capable of ~400rps per app server before performance degrades● >99.99% uptime

Page 21: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

The ActiveRecord Callbacks Problem● Obscure business logic. Explicit => Implicit● Often have unintended side effects● Require deep understanding of AR internals● Can cause a chain reaction performance nightmare

Page 22: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

that!

Page 23: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

The AR Callbacks Problem

Option Type Product

Taxonomy

Taxon

Option Value1:1 1:M

1:M

1:M

Variant

1:M1:1

parent

Variant

Product

Taxonomy

Taxon

belongs_to :option_type,touch: trueafter_touch :touch_all_variants after_touch :touch_all_produ

cts

belongs_to :product, touch: true

after_save :run_touch_callbacksafter_touch :touch_taxons after_touch :touch_parent

Page 24: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Yo DawgI heard you like ActiveRecord Callbacks

So I added a callback that will call you backWhen your callback calls my callback

Page 25: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016
Page 26: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

The AR Callbacks Problem

A Stop Gap Solutionhttps://github.com/godaddy/activerecord-delay_touching

ActiveRecord::Base.delay_touching do # touch_all_the_thingsend

Page 27: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

The AR Callbacks ProblemWhat do we do?

Be more explicit with Service Objects

OptionValueUpdater.new(option_value).call

● Explicit, clear business logic● No hidden side effects● No magic to understand● Aggregation of bulk updates

Page 28: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

My time with Rails is up (Piotr Solnica)http://solnic.eu/2016/05/22/my-time-with-rails-is-up.html

“People are attracted by Rails because it gives you a false sense of simplicity, whereas what really happens is that complexity is being hidden by convenient interfaces. [...] ActiveRecord is just one, representative example, [...].”

All Things in Moderation

Rails has won: The Elephant in the Room (Fabio Akita)http://www.akitaonrails.com/2016/05/23/rails-has-won-the-elephant-in-the-room “[…] for all intents and purposes, Active Record still does much better than average. But if you're big, you should be careful. That's all.”

Page 29: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListImprove Order Consistency● Do not trigger order recalculation once complete (or at least be more

explicit)○ Some operations can cause completed orders to be recalculated

● Snapshot product details on orders○ Modifying product information is reflected in completed orders

TIME CHECK

Page 30: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListMaintain Clear Upgrade Paths● Semantic versioning ● Non-breaking data migrations● Upgrades without downtime

Page 31: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListPreview/Publish Mechanism● Allow site changes to be staged and viewed before making live

Page 32: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListSimplify Customization● Better hooks for overriding flows and replacing features

○ Dependency Injection○ Configurable Service Locators○ Integration Hooks in Service Objects

Page 33: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListSupport Automated Integrations● First class application marketplace

○ Engine to plugin extensions without development work○ Oauth-based activation and requirements-based authorization

■ Generates unique, role-based api users

Spree :)

Page 34: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

Spree Wish ListKeep on Being You!!● Retain a helpful and collaborative community● Share and learn from each other

Page 35: Michael Tucker, GoDaddy_How GoDaddy used Spree to build their Online Store product @ Open Commerce Conference 2016

[email protected]

At GoDaddywe're pulling for small business.Help us transform the global economy, one entrepreneur at a time.