Just built a SQL connection pool in Go from scratch ⚡
The connection pool seems overwhelming at first, but when you start implementing you realize it is just a thread-safe blocking queue, and you can write a performant pool in less than 70 lines of code.
Attached is the snippet of the put function; and you can see how self-explanatory is code is.
🔥 Pro tip to become a better engineer: create prototypes of every single concept you come across. Would highly recommend you try it out on your own and understand the nuances; because system design is not about drawing boxes.
⚡ If you want to learn System Design the right way, consider joining the waitlist for my December cohort.
arpitbhayani.me/course