Scaling
Vertical scaling: monolithic architectures don’t need to be changed,less power/cooling in idc, but has limit and need downtime
Horizontal Scaling: scale easily and gradually, usually no downtime and easy to degradation, but may need change architecture and more cost in idc.

HA
NETWORK->server->application-database

Judge from business
business target –> resources requirement

DNS
Resource Record Name Description
SOA Start of Authority Provides information about the particular DNS server.
A Host Maps name to IPv4 address.
AAAA IPv6 Host Maps name to IPv6 address.
CNAME Canonical Name Maps name to name(It should only be used when there are no other records on that name).
PTR Pointer Record Maps IPv4 or IPv6 Hostname. For reverse mapping.
MX Mail Exchanger A hostname for a mail server in this domain.
NS Name Server Specifies a domain/subdomain and a name server authoritative for the domain/subdomain.
ALIAS ALIAS Maps name to name(target is a single ip)

  • Use an A record if you manage which IP addresses are assigned to a particular machine, or if the IP are fixed (this is the most common case).
  • Use a CNAME record if you want to alias one name to another name, and you don’t need other records (such as MX records for emails) for the same name.
  • Use an ALIAS record if you’re trying to alias the root domain (apex zone), or if you need other records for the same name.
  • Use the URL record if you want the name to redirect (change address) instead of resolving to a destination.

This is similar to the above approach, with the only difference is instead of an appliance, the load balancing is done at the DNS. The clients get different IP’s to connect when they query for the DNS records of the service. The DNS server has to do a health check, to know which servers are in a good state.

This approach alleviates the bottleneck of the load balancer solution. But require shorter TTL for the DNS records, so that problematic servers can be taken out of rotation quickly, which means, there will be far more DNS queries.

KeepAlived
VRRP(Virtual Router Redundancy Protocol)
/etc/keepalived/keepalived.conf
refer
keepalived brain split

LVS
LVS is a kernel feature, can use “ipvsadm” to change.
ipvsadm

Anycast
refer
img(°0°)

Load Balancer

  • single-arm mode:
  • two-arm mode:
    The load balancer can be deployed in single-arm mode, where the traffic to the VIP is redirected by the LB, and the return traffic from the server to the client is sent directly. The other option is the two-arm mode, where the return traffic is also passed through the LB.