1

i was moving to alloyDB thinking that it'll be smart enough to separate my read and write to the database, so the load of my primary CPU will not be overloaded like i used to face when i was using postgreSQL CloudSQL. i was wondering what is the advantage of using read pool? was it just the same like replicas?

Alex chai
  • 21
  • 4

1 Answers1

2

Correct, it's a replica pool with a load balancer in front of it basically. So the idea is you create a read pool per workload you want to offload. Could be that you only need one and it'll be robust enough for all the read-workloads, but if not, you can create multiple read pools per cluster to separate your read workloads as well.

Gabe Weiss
  • 3,134
  • 1
  • 12
  • 15
  • 1
    alright now i understand what readpools are. thankyou Gabe! have a nice day – Alex chai Jul 18 '22 at 16:15
  • Do read pools incur costs? I understand in cloud SQL, the price for the primary instance is the same for its read pools, hence double costs, is AlloyDB the same? – Dalton Kim Jun 07 '23 at 12:01
  • Correct, yes they do. Each node you allocate to a read pool counts as a replica, so handle with care. :) – Gabe Weiss Jun 07 '23 at 23:50
  • @GabeWeiss could you explain how HA works with the primary and the read pool? If I have enabled HA for the primary and have more then 1 instance in the read pool, does it mean that both of them are load balanced. Assuming I would need 4CPU 32GB, with HA primary of 2CPU 16GB and 2 nodes in a read pool each 2CPU 16GB, would I achieve the same? Thank you! – lucbas Jun 16 '23 at 00:03
  • @lucbas The load balancing doesn't happen between the HA pairings. Your primary instance doesn't have any built-in load balancing. With HA, the data will be duplicated into the primary's backup instance, but there's no load balancing that happens there. On the read pool side, The load is balanced against all _primary_ nodes of the read pool. So if you have 2 nodes in the read pool, load is balanced between two read instances, regardless of HA or not HA. So if your workload need 4 CPU/32 GB RAM for the read load, then 2 nodes of 2 CPU/16 GB might be enough (it's not always 1:1 like that). – Gabe Weiss Jun 17 '23 at 03:38
  • @lucbas The only way to really tell how your workload is handled by the system is to test it with the production data and workload pattern. – Gabe Weiss Jun 17 '23 at 03:39