maxpert / marmot

A distributed SQLite replicator built on top of NATS
https://maxpert.github.io/marmot/
MIT License
1.7k stars 42 forks source link

Adding A/AAAA DNS discovery for cluster peers #61

Closed maxpert closed 11 months ago

maxpert commented 11 months ago

Adding feature for DNS based peer discovery and NATS URL flattening. This will allow Marmot to function in a cluster environment where people won't have to write complicated scripts to discover DNS before moving forward. URL also supports query parameters min to set minimum number of routes before proceeding, interval_ms is the delay between query retries.

tigawanna commented 11 months ago

Am an absolute noob in networking, had a curious question. Does this mean we don't have to point every instance to all the possible instances explicitly in the config file?

maxpert commented 11 months ago

Am an absolute noob in networking, had a curious question. Does this mean we don't have to point every instance to all the possible instances explicitly in the config file?

Yes you can now use DNS addresses to resolve out IPs. Look at PocketBase on Fly.io that automatically uses DNS resolution to find first two peers. This should take away all of the overhead of getting IPs yourself and use service discovery mechanism via A/AAAA records to start cluster.

tigawanna commented 11 months ago

Nice