Survival of the fittest

Be faster than your competitors

How can we increase sales?

Mike Tyson

Everyone has a plan until they get punched in the face.

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());
    }

    ...

}

What have we done?

How does it work?

Disadvantages that we had with the way we develop software

  • Development:
    • Long feature development cycles
    • Long feedback times
    • Long build time
    • Strange behavior after changes
    • Application scalability
  • Product Management:
    • Long time to market
    • A/B testing difficult to achieve
    • Scalability of workload

How can we build software smarter?

Microservice

  • fits in one brain,
  • designed for replaceability,
  • autonomy (organisation & technology)

Microservice Taxonomy

Online Shop - Use cases

Online Shop - Migration

Flexibility

Improve feedback times

Scalability

Challenges

Microservice - Communication

Adrian Cockcroft

if every service has to be updated at the same time it’s not loosely coupled

Postel’s Law (1980)

RFC 761 (Transmission Control Protocol)

be conservative in what you do, be liberal in what you accept from others

Postel’s Law

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

Postel’s Law

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

Postel’s Law

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

Postel’s Law

{
        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”

How we can deliver faster?

Multi Deployment Pipeline

Improve Build Times

Deployments get more complex

How can we package and describe our application?

Docker

Build, Ship, Run

Docker-Workflow

bz@cc $ docker build -t zutherb/product-service .
bz@cc $ docker push zutherb/product-service
bz@cc $ docker pull zutherb/product-service
bz@cc $ docker run zutherb/product-service
bz@cc $ docker ps
CONTAINER ID        IMAGE                               COMMAND                CREATED
87bb5524067d        zutherb/product-service:latest      "/product-0.6/bin/pr   14 seconds

Canary Release

Distributed System

Mesos

Vamp (Very Awesome Microservices Platform)

How can we keep the zoo clean?

Log-Aggregator

Correlation Id

Mapped Diagnostic Context

MDC.put("correlationId", "A8FFA290");
Logger logger = LoggerFactory.getLogger(SimpleMDC.class);
logger.info("Create Order");
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  <layout>
   <Pattern>[%X{correlationId}] - %m%n</Pattern>
  </layout>
</appender>

Summary

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

<Thank You!>

Get Out of the Building

This talk is based on two real projects.

The demo application contains the techology stack and all concepts which were learned in these projects.

https://github.com/zutherb/AppStash/

Fork me on GitHub

Links

Links

Links

Images

Images