Back

Domain-Driven Design: Identifying Domains and Subdomains: A Spotify Case Study

July 15, 2024

Let's continue with the series of posts about Domain-Driven Design.

In the previous post, we talked about domains and the different types of subdomains in a company. Today, I bring you an exercise to try to clarify and have a better understanding of the concepts.

Let’s start with a company description we all know: Spotify.

Spotify is a music streaming platform offering personalized experiences to millions of users globally. It provides access to a vast library of music, podcasts, and audio content, enabling playlist creation, artist following, and music discovery through tailored recommendations. 🎧

Now that we know the company, we can start to identify domains and subdomains. In a real scenario, we should work very closely with the domain experts. These are subject matter experts who know all the intricacies of the business that we are going to model and implement in code. They are neither the analysts gathering the requirements nor the engineers designing the system. They are the people who identified the business problem in the first place and from whom all business knowledge originates.

What is Spotify's business domain? Pretty clear: Music streaming. 🎶

Now, we have to go deeper with the analysis to identify subdomains. If you remember yesterday's post, there are three types of subdomains: core, generic, and supporting.

Let’s start with the most important ones: the core subdomains.

  • Personalization & Recommendation algorithm: Analyzes and adjusts to user behavior, offering customized playlists and maintaining user engagement.
  • Content management and delivery: The ingestion, organization, and delivery of millions of tracks and podcasts.
  • UX/UI: The interface design contributes directly to user retention and satisfaction.

Remember, these are the subdomains that give the company a competitive advantage, and the company's profits depend on them. The organization’s most skilled talent should be assigned to work on this. 🥇

Now, let’s move to the generic subdomains. These are solved problems. There is no room or need for innovation here; it’s more cost-effective to use existing solutions.

  • Payment processing and subscriptions: Managing payments and handling billing.
  • Ad management and delivery: Integration with third-party ad providers for targeted advertisements.
  • Content licensing and compliance: Managing legal contracts and licensing agreements with record labels and content creators.

Finally, the supporting subdomains: These are problems with obvious solutions.

  • Social features: Features like sharing songs, collaborative playlists, or following.
  • Customer support and community management: Support through chatbots, help centers, and social media monitoring.
  • Promotions and offers: Managing campaigns for discounts on premium subscriptions or special offers for new users.

Hope you liked the post, stay tuned for more content! 💡