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 Information SERVICE CORE Structured Distributed Metrics Logging Tracing Microservice Framework API Dynamic Documentation Configuration
Healthchecks service: name: taxation version: 1.0 server: port: 8080 management: port: 8081
Healthchecks http://taxation101.eqx.dal.prod.squarespace.net:8081/healthcheck { "status":"UP", "taxation-core":{ "healthy":true "message":"Service is running version TAX-459" } }
Service Discovery & Registration Service A Service B Service C Service Discovery Zookeeper Consul
Service Discovery & Registration
Contextual Information Client Source Client Version Context Id Type Billing Service JaOLrH2O Client Taxation Service v3.1
Structured Logging Taxation Service Application Logs Access Logs GC Logs
Structured Logging tail -f /data/logs/taxation-access.log 2017-03-22 07:24:45:026 GMT thread=jetty-846 logging.level: DEBUG contextId=JaOLrH2O logging: contextSourceType=billing level: clientVersion=taxation-client-3.1 org.springframework: INFO level=INFO com.squarespace.metrics.Graphite: "OFF" class=AccessLog directory: /data/logs ip=10.100.101.205 extension: .log method=GET maxFileSize: 512MB uri=/api/1/taxation/rates totalSizeCap: 8GB queryString= maxHistory: 5 httpVersion=HTTP/1.1 responseCode=200 responseTimeMs=39 responseSize=-1
Metrics graphite: enabled: true enableConsole: false host: {{ graphite_host }} port: {{ graphite_port }}
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 }
Metrics
Distributed Tracing
Dynamic Configuration vars: tracing_sample_rate: prod: 0.2 stage: 1.0 qa1: 1.0
Dynamic Configuration
API Documentation
Client-Side Load Latency & Fault Balancing Tolerance SERVICE CLIENT Asynchronous Client-Side Request Caching Execution Microservice Framework HTTP Request Builders
Client-Side Load Balancing Application Container Service X Client Service X Service X Service Discovery
Latency & Fault Tolerance Application Container Service A Service A Client User Service B Client Service B Request Service C Client Service C
Latency & Fault Tolerance Application Container Service A Service A Client 10 Threads User Service B Client Service B Request 5 Threads Service C Client 5 Threads Service C Fail fast, fail silent, or fallback
Hystrix
Client-Side Caching Application Container User Service X Client Service X Request
Asynchronous Request Execution Service B Application Container Service A Service C Service D Client Service Z
HTTP Request Builders getCurrentProductOfferingTemplate = group .newTemplateBuilder( “getCurrentProductOffering” ) .withMethod(HttpMethod. GET .name()) .withUriTemplate(RESOURCE_URL + “/offerings/countries/{country}/current” ) .build();
ORGANIZATIONAL CHANGES
Squarespace Engineering @ 2013 Server Systems Product & Data
Squarespace Engineering @ 2014 SRE Server Core Svcs TechOps
The First Services Taxation Location Billing Currency
Provisioning ● Cobbler IP Plan ● ● DNS Provisioning ● LDAP ● YUM NTP ●
Ansible & Configuration Management
Release Engineering & Developer Productivity Helm Drone Release Engineering / Developer Productivity
Ansible & Configuration Management hello-service/deploy/deploy.yml:
Ansible & Configuration Management hello-service/deploy/config.yml.j2:
Build & Deploy Tooling
Observability & Alerting Observability & Alerting
Observability & Alerting Tooling
Observability & Alerting Tooling
Observability & Alerting Tooling
Observability & Alerting Tooling
Observability & Alerting Tooling
Service Dashboard
NEW OPPORTUNITIES AND CHALLENGES
FUTURE WORK Self-service provisioning Code generation Pull-based metrics Log collection improvements Distributed tracing improvements Alerting improvements
Microservices Journey 2013: small (< 50 engineers) 2016: large (100+ engineers) build product & grow customer base architect for scalability and reliability whatever works organizational structures 2014: medium (< 100 engineers) ?: XL (200+ engineers) we have a lot of customers now! whatever works doesn't work anymore
QUESTIONS Thank you! Franklin Angulo @feangulo squarespace.com/careers
Recommend
More recommend