Implementing Fan-Out Writing
Yes, our application may sound outdated, being a video store management system, but don’t think we are stuck in the 90s. We have implemented a social network on top of it! Our customers can follow each other, X-style. But wait, it gets even cooler than that: customers have a public timeline that shows the latest films rented by the people they follow! You can see it calling api/v1/customers/#{id}/timeline.
Unfortunately, the queries that our application needs to run to fetch the timeline aren’t pretty. Let’s call the endpoint and check the logs. We’ll take a look at Matz’s timeline: appropriately for the creator of Ruby, he is the customer with id 1. Hit api/v1/customers/1/timeline, and you will see this database ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access