How we can increase sells?

A/B Testing

Conversion

  • act of converting site visitors into paying customers
  • proportion of visits to a website which take action to go beyond a website visit

FeatureToggle

public class TopSellerRecommendationPanel extends AbstractShopBasePanel {

    @SpringBean
    private FeatureToogleBean featureToogleBean;

    ...

    @Override
    protected void onConfigure() {
      super.onConfigure();
      setVisible(featureToogleBean.isTopSellerFeatureEnabled());
    }

    ...

}

Checkout - Variant A

Checkout - Variant B

Project Setup

  • Scrum + 98% forecast (commitment) guarantee
  • regular deployment 1 x 2 weeks
  • hot fix/feature deployments 2-4 per sprint
  • around 1 1/2 h to get in production
    • 35min per build
    • 40min per ITIL stuff:
      • calls
      • ticket
      • etc.
    • 20min per manual deployment

How we can deliver faster?

What have we done?

How does it works?

Disadvantage of a Monolith

  • Reduction of development speed
  • Increase of turnaround times
  • Increase of build time
  • Strange behavior after changes
  • Increase of time to market
  • A/B testing of process changes nearly impossible
  • Scalability (e.g. application and teams)

How can we build software smarter?

Functionality / Data

Microservice Architecture

Unix Pipeline (1973)

vagrant@app-server-node-4:~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  29640  4300 ?        Ss   08:38   0:02 /sbin/init
root         2  0.0  0.0      0     0 ?        S    08:38   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    08:38   0:02 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   08:38   0:00 [kworker/0:0H]
...
vagrant@app-server-node-4:~$ ps aux | grep java
root      1827  1.4  7.2 2458576 149452 ?      Sl   08:39   8:26 java -classpath
/usr/share/shop/product/lib/product-microservice-0.5.5.jar:/usr/share/shop/produ
ct/lib/scala-library-2.10.3.jar:/usr/share/shop/product/lib/akka-actor_2.10-2.2.
4.jar:/usr/share/shop/product/lib/spray-can-1.2.1.jar:/usr/share/shop/product/li
...
vagrant@app-server-node-4:~$ ps aux | grep java | wc -l
6

Service-Oriented Architecture (SOA / 1996)

  • SOA is an architectural style that supports service-orientation.
  • Service-orientation is a way of thinking in terms of services.
  • A service:
    • Is a logical representation of a repeatable business activity
      (e.g., submit order)
    • Is self-contained
    • May be composed of other services
    • Is a “black box” to consumers of the service

SOA taxonomy

Differences to SOA

  • Lightweight infrastructure and protocols (e.g. REST)
  • Greater flexibility of architecture (e.g. can contain GUI)
  • Managed as products, with their own lifecycle and delivery
  • Deployed as processes (Unix packages or Container)

Online Shop - Use cases

Online Shop - Migration

Challenges of Microservices

  • Require integration.
  • Require a multi deployment pipeline.
  • Require automation of deployment and configuration.
  • Require logging and monitoring.

Leavitt - Communication Structure

Type Star Chain Circle Complete Structure
 
centralization high medium low very low
communication low medium much very much
controllability much medium low very low

Conway's Law

Rest Communication

{
        firstname: "Bernd",
        lastname: "Zuther",
        street: "Elsenheimerstraße 55a",
        city: "München",
        zip: 80687
}

Rest Communication

{
        firstname: "Bernd",
        lastname: "Zuther",
        birthday: "1983/08/15",
        street: "Elsenheimerstraße 55a",
        city: "München",
        zip: 80687
}

Rest Communication

{
        firstname: "Bernd",
        lastname: "Zuther",
        birthday: "1983/08/15",
        addresses : [{
          street: "Elsenheimerstraße 55a",
          city: "München",
          zip: 80687,
          type: "WORK"
        }]
}

Golden Rules of Continuous Delivery

  • Don’t break your Customer
  • Don’t break the Code Base, Builds, Tests, and Production
  • Don’t break the Delivery Flow

Versionless Rest Communication

{
        firstname: "Bernd",
        lastname: "Zuther",
        birthday: "1983/08/15",
        street: "Elsenheimerstraße 55a",
        city: "München",
        zip: 80687,
        addresses : [{
          street: "Elsenheimerstraße 55a",
          city: "München",
          zip: 80687,
          type: "WORK"
        }]
}

Alternatives

  • URL:
    • simply whack the API version into the URL, e.g. https://shop/api/v2/cart/all
  • Custom request header:
    • same URL as before but add a header “api-version: 2”
  • Accept header:
    • modify accept header to specify the version, e.g. “Accept: application/vnd.cart.v2+json”

Multi Deployment Pipeline

Deployment

Unix Package Repository

How can we describe infrastructure and products?

Processes

www-data  1699  0.5  7.7 2453320 158076 ?      Sl   10:49   0:26 java -cp cart.jar
www-data  1834  0.3  5.0 2435400 102684 ?      Sl   10:49   0:17 java -cp navigation.jar
www-data  1972  0.0  0.1  90792  3124 ?        Ss   10:49   0:00 nginx: master process
www-data  1973  0.0  0.1  91148  3820 ?        S    10:49   0:00 nginx: worker process
www-data  1974  0.0  0.1  91148  3820 ?        S    10:49   0:00 nginx: worker process
www-data  1975  0.0  0.1  91148  3820 ?        S    10:49   0:00 nginx: worker process
www-data  1976  0.0  0.1  91148  3820 ?        S    10:49   0:00 nginx: worker process
www-data  1980  1.5  7.0 2456532 143688 ?      Sl   10:49   1:20 java -cpa product.jar

Compose - Product Construction Kit

redis:
  image: dockerfile/redis
  ports:
    - "6379"
cart:
  image: eshop/cart-service
  ports:
    - "18100"
  links:
    - redis
catalog:
  image: eshop/catalog-frontend
  ports:
    - "80:80"
  links:
    - product
    - cart

Docker Environment

Kubernetes - Cluster Management

Pod

{ "id": "mongodb",
  "kind": "Pod",
  "apiVersion": "v1beta1",
  "desiredState": {
    "manifest": {
      "containers": [ {
          "name": "mongodb",
          "image": "dockerfile/mongodb",
          "ports": [
            {
              "containerPort": 27017,
              "hostPort": 27017
} } } ] } ] }
      

Replication Controller

{ "id": "product",
  "kind": "ReplicationController",
  "apiVersion": "v1beta1",
  "desiredState": {
    "replicas": 2,
    "podTemplate": {
      "desiredState": {
        "manifest": {
          "containers": [
            {
              "name": "product",
              "image": "zutherb/product-service",
              "cpu": 100,
              "memory": 50000000,
              "ports": [ { "containerPort": 18080, "hostPort": 18080} ] },
          "labels": { "name": "product", "uses": "mongodb" } } } } } }
      

Service

{ "id": "product",
  "kind": "Service",
  "apiVersion": "v1beta1",
  "port": 18080,
  "containerPort": 18080,
  "selector": { "name": "product" },
  "labels": { "name": "product" } }
      
PRODUCT_PORT_18080_TCP=tcp://10.0.0.11:18080
PRODUCT_PORT_18080_TCP_PROTO=tcp
PRODUCT_PORT_18080_TCP_PORT=18080
PRODUCT_PORT_18080_TCP_ADDR=10.0.0.11
      

Alternatives

  • Mesos - abstracts CPU, memory, storage
  • Marathon - REST API for starting, stopping, and scaling applications
  • HAProxy - load balancing and proxying for TCP and HTTP-based applications
  • Bamboo - configures HAProxy for web services deployed on Apache Mesos and Marathon

Learn from your customers

Summary

Pro Needs
better A/B testing monitoring
effective technologies centralised logging
solution orientation fully automated deployment pipeline
incremental migration cluster management
Microservices do not guarantee more conversion!
You need to run experiments with our customers!

<Thank You!>

Links

Links

Images