The Architecture of Open Source Applications has some great lessens learned. It's also free: https://aosabook.org/en/ .
I don't think there are lots of examples of the distributed systems discussion though, since most of the writing is about how to structure the source code of a single program. That's not unrelated, since most of what you're asking about is how different interfaces or modules should interact. In a distributed system, that happens over RPCs, but it can just as easily happen within a program with separate threads.
Note: they've added some other books, which show up at the top of the page, but I've only read select chapters from AOSA Volume 1.