Chapter 2. Introduction to Consul

Today we announce Consul, a solution for service discovery and configuration. Consul is completely distributed, highly available, and scales to thousands of nodes and services across multiple datacenters.

Armon Dadgar (HashiCorp cofounder), April 2014

I remember when Consul first burst onto the scene in 2014. Cloud computing and service-oriented architectures (the precursor to microservices) were becoming mainstream, and every company was starting to grapple with the problem of how to route to services and handle failure in a distributed system.

Consul was a revolutionary technology because it combined DNS-based service discovery with a robust failure detection system. A service would register into Consul and other services could use its Consul DNS entry to route to it. For example, the frontend service would be available at frontend.service.consul. Consul also detected failure by using a gossip algorithm called Serf (covered later in this chapter) and health checking. If a node or service went down, Consul would quickly notice and remove it from DNS.

Consul was open source, free to use, and it elegantly solved a problem experienced by thousands of companies. The industry quickly adopted it.

Over time, service-oriented architectures grew larger and turned into microservices architectures with smaller and smaller services. This led to the rise of Docker and container orchestrators like Kubernetes. The microservices movement and Kubernetes changed ...

Get Consul: Up and Running now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.