All Projects → rafaeljusto → dnsdisco

rafaeljusto / dnsdisco

Licence: MIT license
DNS service discovery library

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dnsdisco

Golb
🐙 Yet another load balancer
Stars: ✭ 315 (+1160%)
Mutual labels:  service-discovery, load-balancer
Marathon Lb
Marathon-lb is a service discovery & load balancing tool for DC/OS
Stars: ✭ 449 (+1696%)
Mutual labels:  service-discovery, load-balancer
Steeltoe
Steeltoe .NET Core Components: CircuitBreaker, Configuration, Connectors, Discovery, Logging, Management, and Security
Stars: ✭ 612 (+2348%)
Mutual labels:  service-discovery, load-balancer
go-bmi
Body Mass Index(BMI) application developed by go-chassis microservice framwork
Stars: ✭ 14 (-44%)
Mutual labels:  service-discovery
juno-agent
juno-agent
Stars: ✭ 46 (+84%)
Mutual labels:  service-discovery
Uragano
Uragano, A simple, high performance RPC library. Support load balancing, circuit breaker, fallback, caching, intercepting.
Stars: ✭ 28 (+12%)
Mutual labels:  service-discovery
blogr-pve
Puppet provisioning of HA failover/cluster environment implemented in Proxmox Virtual Environment and Linux boxes.
Stars: ✭ 28 (+12%)
Mutual labels:  service-discovery
check netapp ontap
🍀 Check NetApp Ontap 🍀
Stars: ✭ 38 (+52%)
Mutual labels:  health-check
Architeuthis
MITM HTTP(S) proxy with integrated load-balancing, rate-limiting and error handling. Built for automated web scraping.
Stars: ✭ 35 (+40%)
Mutual labels:  load-balancer
styx
Programmable, asynchronous, event-based reverse proxy for JVM.
Stars: ✭ 250 (+900%)
Mutual labels:  load-balancer
microservice-graph-explorer
Navigate and explore all of the microservices in your application in real time using the real application connections.
Stars: ✭ 71 (+184%)
Mutual labels:  health-check
Samples
Sample applications using App.Metrics
Stars: ✭ 19 (-24%)
Mutual labels:  health-check
docker-compose-scale-example
Example of Docker Compose scale and load balancing features
Stars: ✭ 18 (-28%)
Mutual labels:  load-balancer
sample-kotlin-ktor-microservices
sample microservices written in Kotlin that demonstrates usage of Ktor framework woth Consul server
Stars: ✭ 37 (+48%)
Mutual labels:  service-discovery
express-actuator
Express middleware with endpoints to help you monitor and manage applications
Stars: ✭ 71 (+184%)
Mutual labels:  health-check
opsbro
Ops Best friend
Stars: ✭ 37 (+48%)
Mutual labels:  service-discovery
hydra-router
A service aware router for Hydra Services. Implements an API Gateway and can route web socket messages.
Stars: ✭ 59 (+136%)
Mutual labels:  service-discovery
microservices4vaadin
Sample application to show the secured integration of microservices and vaadin
Stars: ✭ 30 (+20%)
Mutual labels:  service-discovery
sample-envoy-proxy
custom implementation of service discovery with envoy and inter-service communication for spring-boot applications
Stars: ✭ 29 (+16%)
Mutual labels:  service-discovery
statoo
`statoo` is a super simple http GET tool for checking site health
Stars: ✭ 28 (+12%)
Mutual labels:  health-check

dnsdisco

GoDoc license Build Status Coverage Status Go Report Card codebeat badge

DNS service discovery library for Go programming language.

dnsdisco

Motivation

So you have more than one service (or microservice) and you need to integrate them? Great! I can think on some options to store/retrieve the services address to allow this integration:

  • Configuration file
  • Centralized configuration system (etcd, etc.)
  • Load balancer device ($$$) or software
  • DNS

Wait? What? DNS? Yep! You can use the SRV records to announce your service addresses. And with a small TTL (cache) you could also make fast transitions to increase/decrease the number of instances.

This SRV records contains priority and weight, so you can determinate which servers (of the same name) receives more requests than others. The only problem was that with the DNS solution we didn't have the health check feature of a load balancer. And that's where this library jumps in! It will choose for you the best server looking the priority, weight and the health check result. And as each service has it's particular way of health checking, this library is flexible so you can implement the best health check algorithm that fits for you.

And doesn't stop there. If you don't want to use the default resolver for retrieving the SRV records, you can change it! If you want a more efficient load balancer algorithm (please send a PR 😄), you can also implement it.

This library follows the Go language philosophy:

"Less is more" (Ludwig Mies van der Rohe)

Features

  • Servers are retrieved from a DNS SRV request (using your default resolver)
  • Each server is verified with a health check (simple connection test)
  • Load balancer choose the best server to send the request (RFC 2782 algorithm)
  • Library is flexible so you could change any part with your own implementation
  • Has only standard library dependencies (except for tests)
  • Go routine safe

Install

go get -u github.com/rafaeljusto/dnsdisco

Example

A basic use would be:

package main

import (
  "fmt"

  "github.com/rafaeljusto/dnsdisco"
)

func main() {
  target, port, err := dnsdisco.Discover("jabber", "tcp", "registro.br")
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Printf("Target: %s\nPort: %d\n", target, port)
}

For this example we imagine that the domain registro.br. is configured as the following:

registro.br.    172800 IN SOA a.dns.br. hostmaster.registro.br. (
                        2016021101 ; serial
                        86400      ; refresh (1 day)
                        3600       ; retry (1 hour)
                        604800     ; expire (1 week)
                        86400      ; minimum (1 day)
                        )

registro.br.    172800 IN NS a.dns.br.
registro.br.    172800 IN NS b.dns.br.
registro.br.    172800 IN NS c.dns.br.
registro.br.    172800 IN NS d.dns.br.
registro.br.    172800 IN NS e.dns.br.

_jabber._tcp.registro.br. 172800 IN SRV	1 65534 5269 jabber.registro.br.

Check the documentation for more examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].