Building Microservices @ Squarespace QCon New York 2017 INSERT - - PowerPoint PPT Presentation

building microservices squarespace
SMART_READER_LITE
LIVE PREVIEW

Building Microservices @ Squarespace QCon New York 2017 INSERT - - PowerPoint PPT Presentation

Franklin Angulo @feangulo Building Microservices @ Squarespace QCon New York 2017 INSERT IMAGE HERE AGENDA 01 Microservice Framework 02 Organizational Changes 03 New Opportunities & Challenges Service Contextual Healthchecks Discovery


slide-1
SLIDE 1

Building Microservices @ Squarespace

QCon New York 2017

Franklin Angulo @feangulo

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6

INSERT IMAGE HERE

slide-7
SLIDE 7

AGENDA

01 Microservice Framework 02 Organizational Changes 03 New Opportunities & Challenges

slide-8
SLIDE 8

SERVICE CORE

Microservice Framework

Healthchecks Service Discovery Contextual Information Structured Logging Metrics API Documentation Distributed Tracing Dynamic Configuration

slide-9
SLIDE 9

Healthchecks

service: name: taxation version: 1.0 server: port: 8080 management: port: 8081

slide-10
SLIDE 10

Healthchecks

http://taxation101.eqx.dal.prod.squarespace.net:8081/healthcheck { "status":"UP", "taxation-core":{ "healthy":true "message":"Service is running version TAX-459" } }

slide-11
SLIDE 11

Service Discovery & Registration

Service B Service A Service C Service Discovery Consul Zookeeper

slide-12
SLIDE 12

Service Discovery & Registration

slide-13
SLIDE 13

Contextual Information

Client v3.1 Taxation Service Billing Service Context Id Client Version Client Source Type JaOLrH2O

slide-14
SLIDE 14

Structured Logging

Taxation Service GC Logs Access Logs Application Logs

slide-15
SLIDE 15

Structured Logging

tail -f /data/logs/taxation-access.log 2017-03-22 07:24:45:026 GMT thread=jetty-846 contextId=JaOLrH2O contextSourceType=billing clientVersion=taxation-client-3.1 level=INFO class=AccessLog ip=10.100.101.205 method=GET uri=/api/1/taxation/rates queryString= httpVersion=HTTP/1.1 responseCode=200 responseTimeMs=39 responseSize=-1 logging.level: DEBUG logging: level:

  • rg.springframework: INFO

com.squarespace.metrics.Graphite: "OFF" directory: /data/logs extension: .log maxFileSize: 512MB totalSizeCap: 8GB maxHistory: 5

slide-16
SLIDE 16

Metrics

graphite: enabled: true enableConsole: false host: {{ graphite_host }} port: {{ graphite_port }}

slide-17
SLIDE 17

Metrics

http://taxation101.eqx.dal.prod.squarespace.net:8081/metrics { "mem":2210292, "mem.free":831939, "processors":2, "threads":89, "GET.api.1.taxation.tax-overrides.sourceTypes.admin.requests.snapshot.stdDev":0, "GET.api.1.taxation.exemptions.externalId.requests.snapshot.99thPercentile":90, "GET.api.1.taxation.exemptions.requests.oneMinuteRate":2.964393875E-314, "GET.api.1.taxation.exemptions.externalId.requests.meanRate":1.4890452464986816, "PUT.api.1.taxation.tax-overrides.id.decisions.requests.snapshot.98thPercentile":22, "GET.api.1.taxation.vat-countries.list-results.sourceTypes.billing.requests.snapshot.p75":0 }

slide-18
SLIDE 18

Metrics

slide-19
SLIDE 19

Distributed Tracing

slide-20
SLIDE 20

Dynamic Configuration

vars: tracing_sample_rate: prod: 0.2 stage: 1.0 qa1: 1.0

slide-21
SLIDE 21

Dynamic Configuration

slide-22
SLIDE 22

API Documentation

slide-23
SLIDE 23

SERVICE CLIENT

Microservice Framework

Client-Side Load Balancing Latency & Fault Tolerance Client-Side Caching Asynchronous Request Execution HTTP Request Builders

slide-24
SLIDE 24

Client-Side Load Balancing

Client Service X Service X Service X Service Discovery Application Container

slide-25
SLIDE 25

Latency & Fault Tolerance

Service B Service A Service C Service A Client Service B Client Service C Client User Request Application Container

slide-26
SLIDE 26

Latency & Fault Tolerance

Service B Service A Service C Service A Client 10 Threads Service B Client 5 Threads Service C Client 5 Threads User Request

Fail fast, fail silent, or fallback

Application Container

slide-27
SLIDE 27

Hystrix

slide-28
SLIDE 28

Client-Side Caching

Service X Service X Client User Request Application Container

slide-29
SLIDE 29

Asynchronous Request Execution

Client Service A Service Z Application Container Service B Service C Service D

slide-30
SLIDE 30

HTTP Request Builders

getCurrentProductOfferingTemplate = group .newTemplateBuilder(“getCurrentProductOffering”) .withMethod(HttpMethod.GET.name()) .withUriTemplate(RESOURCE_URL + “/offerings/countries/{country}/current”) .build();

slide-31
SLIDE 31

ORGANIZATIONAL CHANGES

slide-32
SLIDE 32

Squarespace Engineering @ 2013

Server Systems Product & Data

slide-33
SLIDE 33
slide-34
SLIDE 34

Squarespace Engineering @ 2014

Server TechOps SRE Core Svcs

slide-35
SLIDE 35

Location Taxation Billing Currency

The First Services

slide-36
SLIDE 36

Provisioning

Provisioning

  • Cobbler
  • IP Plan
  • DNS
  • LDAP
  • YUM
  • NTP
slide-37
SLIDE 37

Ansible & Configuration Management

slide-38
SLIDE 38

Release Engineering / Developer Productivity

Release Engineering & Developer Productivity Drone Helm

slide-39
SLIDE 39

Ansible & Configuration Management hello-service/deploy/deploy.yml:

slide-40
SLIDE 40

Ansible & Configuration Management hello-service/deploy/config.yml.j2:

slide-41
SLIDE 41

Build & Deploy Tooling

slide-42
SLIDE 42

Observability & Alerting

Observability & Alerting

slide-43
SLIDE 43

Observability & Alerting Tooling

slide-44
SLIDE 44

Observability & Alerting Tooling

slide-45
SLIDE 45

Observability & Alerting Tooling

slide-46
SLIDE 46

Observability & Alerting Tooling

slide-47
SLIDE 47

Observability & Alerting Tooling

slide-48
SLIDE 48

Service Dashboard

slide-49
SLIDE 49

NEW OPPORTUNITIES AND CHALLENGES

slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58

FUTURE WORK

Self-service provisioning Code generation Pull-based metrics Log collection improvements Distributed tracing improvements Alerting improvements

slide-59
SLIDE 59

Microservices Journey

2013: small (< 50 engineers) build product & grow customer base whatever works 2014: medium (< 100 engineers) we have a lot of customers now! whatever works doesn't work anymore 2016: large (100+ engineers) architect for scalability and reliability

  • rganizational structures

?: XL (200+ engineers)

slide-60
SLIDE 60

QUESTIONS

Thank you!

squarespace.com/careers Franklin Angulo @feangulo