Skip to content

Latest commit

 

History

History
290 lines (207 loc) · 4.68 KB

session_03_deckset.md

File metadata and controls

290 lines (207 loc) · 4.68 KB

slidenumbers: true

[fit] Cloud

[fit] Native

[fit] Application Architecture

[fit] Workshop


[fit] Session

[fit] Three


[fit] Testing

[fit] and Delivering

[fit] Cloud Native Applications


[fit] Bounded

[fit] Contexts


[fit] CONWAY'S

[fit] LAW


Conway's Law

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure. -- Melvyn Conway, 1967


The Inverse Conway Manuever

inline fit


[fit] Decentralized

[fit] Autonomous

[fit] Capability

[fit] Teams / Services


[fit] TESTING


[fit] Consumer

[fit] Driven

[fit] Contracts


Bounded Contexts

  • Crossing Boundaries ➡️ Increased Complexity
  • Interfaces to Other Contexts
  • Availability of Other Services

[fit] THIS

[fit] IS

[fit] HARD


[fit] Consumer to Component =

[fit] CONTRACT


[fit] Contracts

  • Input/Output Data Structure Expectations
  • Side Effects
  • Performance Characteristics
  • Concurrency Characteristics

[fit] MULTIPLE CONSUMERS

[fit] =

[fit] MULTIPLE CONTRACTS


[fit] Contracts

[fit] Must Be Met Over ⏰


[fit] API =

[fit] Contract


Consumer-Driven Contract

I capture my expectations of your service as a suite of automated tests that I provide to you.

You run them in your continuous integration pipeline.


[fit] Remember

[fit] Decentralized

[fit] Autonomous

[fit] Capability

[fit] Teams/Services?


[fit] Consumer-Driven Contracts

👍


[fit] PACT

https://github.com/realestate-com-au/pact


[fit] PACT JVM

https://github.com/DiUS/pact-jvm


Consumer PactFragment

@Pact(state = "FortuneState", provider = "FortuneService", consumer = "FortuneUi")
public PactFragment createFragment(ConsumerPactBuilder.PactDslWithProvider.PactDslWithState builder) {
    Map<String, String> headers = new HashMap<>();
    headers.put("Content-Type", "application/json;charset=UTF-8");

    PactDslJsonBody responseBody = new PactDslJsonBody()
            .numberType("id")
            .stringType("text");

    return builder.uponReceiving("a request for a random fortune")
            .path("/random")
            .method("GET")
            .willRespondWith()
            .headers(headers)
            .status(200)
            .body(responseBody).toFragment();
}

{
  "provider" : {
    "name" : "FortuneService"
  },
  "consumer" : {
    "name" : "FortuneUi"
  },
  "interactions" : [ {
    "providerState" : "FortuneState",
    "description" : "a request for a random fortune",
    "request" : {
      "method" : "GET",
      "path" : "/random"
    },
    "response" : {
      "status" : 200,
      "headers" : {
        "Content-Type" : "application/json;charset=UTF-8"
      },
      "body" : {
        "id" : 8440038105,
        "text" : "JaizxIwBpBfLDObNbYRu"
      },
      "responseMatchingRules" : {
        "$.body.id" : {
          "match" : "type"
        },
        "$.body.text" : {
          "match" : "type"
        }
      }
    }
  } ],
  "metadata" : {
    "pact-specification" : {
      "version" : "2.0.0"
    },
    "pact-jvm" : {
      "version" : "2.1.13"
    }
  }
}

Producer Pact Verification

<plugin>
	<groupId>au.com.dius</groupId>
	<artifactId>pact-jvm-provider-maven_2.11</artifactId>
	<version>2.1.13</version>
	<configuration>
		<serviceProviders>
			<serviceProvider>
				<name>FortuneService</name>
				<consumers>
					<consumer>
						<name>FortuneUi</name>
						<pactFile>../fortune-teller-ui/target/pacts/FortuneUi-FortuneService.json</pactFile>
					</consumer>
				</consumers>
			</serviceProvider>
		</serviceProviders>
	</configuration>
</plugin>

[fit] PACT

[fit] Broker

https://github.com/bethesque/pact_broker


original fit


original fit


original fit


270%

Testing in Production


[fit] Blue

[fit] Green

[fit] Deploys


original fit


[fit] Canary

[fit] Releases


original fit


[fit] MTBF

[fit] vs.

[fit] MTTR

^ Mean Time Between Failures

^ Mean Time To Recovery


Monitor the snot out of production and staging! -- Elisabeth Hendrickson


[fit] TO THE

[fit] LABS!