Segment provides a service used by businesses to collect customer data in a single hub for later use in analytics, marketing, and for other purposes. The San Francisco–based firm has a broad customer base, ranging from startups to enterprises, including brand names such as Nokia, Angie’s List, Conde Nast, The Motley Fool, and Salesforce Foundation.
Company originally ran every application, including API backends, data ingestion, and others, on instances alone.
Provisioning applications was manually intensive, requiring running startup scripts and manual installs; instances wound up being out of sync because configuration settings were all different.
Moved to Docker for a better configuration management. Applications can be defined with Docker Compose for consistency and remain stateless.
Wanted to move their new Docker-based architecture into production, but needed a way to manage and schedule containers at scale.
Evaluated many open source options, but had been using other AWS products, and wanted a solution that was simple and would integrate with the AWS ecosystem.
Started using Amazon EC2 Container Service (Amazon ECS) as a way to offload cluster management and container orchestration to a service.
Different services such as API, CDN, and App are deployed on different Amazon ECS clusters. Each service is defined by a task definition indicating which version of the container to run, which cluster to choose, and how many containers should be deployed.
Uses Elastic Load Balancing and Amazon Route 53 for service discovery. Each service registers to an ELB and Amazon Route 53 points a local entry at each ELB. Services can communicate with each other through DNS.
Segment uses Datadog, an AWS Advanced Technology Partner, to provide metrics and visualizations on usage and latency.
Amazon ECS manages placement of containers on different Amazon EC2 instances across multiple Availability Zones, providing the Segment service with better availability.
Running new services is easy and streamlined. It involves adding a Dockerfile, creating a task definition, and associating it with a cluster.
Amazon ECS manages the complexity of launching containers and making sure the containers are continually running. This allows developers to focus on developing without worrying about deployment downtimes and overall application availability.
“Switching to Amazon ECS has greatly simplified running a service without needing to worry about provisioning or availability.”
Calvin French-Owen, Cofounder and Chief Technology Officer