A Clean Read Replica Routing Pattern for ASP.NET Core

https://hackernoon.imgix.net/images/2jqChkrv03exBUgkLrDzIbfM99q2-oj0221r.jpeg

Every backend I have worked on eventually hits the same problem. There is one endpoint, usually a listing or a report, that reads a lot and returns a lot, and it slowly becomes the reason the database has a bad day. Someone opens the catalog page, the query goes through a few million rows, and every write happening at that moment waits in line behind it.

The textbook answer is boring and correct: send those reads to a replica. You probably already have one, or you can create one in a few minutes on any managed database. The primary handles writes, the replica handles the heavy reads.

The part the textbook skips is the annoying one: how do you route a specific request to the replica without passing a connection object through every method that might touch the database?

I got this wrong a few times before I got it...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more

https://www.techdirt.com/wp-content/uploads/2022/02/failures.jpg

SpaceX's earnings show X's Q2 ad revenue at $367M, down from $1.08B at Twitter in Q2 2022; Musk once said he would take its annual ad revenue to $12B in 2027

More: 404 Media, TechCrunch, The Information, The Verge, New York Magazine, Ars Technica, The Register, Washington Post, Globe and Mail, SiliconANGLE, NBC News, CBS News, Forbes, RuntimeWire, The Wrap, Bloomberg, Constellation Research, Futurism, Breitbart, CNN, ZeroHedge News, Variety, UPI, WeRSM, Fortune, Gizmodo, Caliber.az, The Post Millennial, Tech Times, Bitcoin