<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by ThinkFromSoul on Medium]]></title>
        <description><![CDATA[Stories by ThinkFromSoul on Medium]]></description>
        <link>https://medium.com/@payalswami?source=rss-5e94f743e51f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Gm71IPMK5elMfyb3nd5Enw.jpeg</url>
            <title>Stories by ThinkFromSoul on Medium</title>
            <link>https://medium.com/@payalswami?source=rss-5e94f743e51f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 23:18:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@payalswami/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Product-Market Fit Isn’t a Milestone: It’s a Moving Target]]></title>
            <link>https://medium.com/@payalswami/product-market-fit-isnt-a-milestone-it-s-a-moving-target-f7ab621d378f?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7ab621d378f</guid>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[product-manager]]></category>
            <category><![CDATA[product-management-skills]]></category>
            <category><![CDATA[product-market-fit]]></category>
            <category><![CDATA[product-development]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 15:57:45 GMT</pubDate>
            <atom:updated>2026-08-10T15:57:45.758Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfj3xIu42okjoEXrETWJLA.png" /></figure><p>I’ve been thinking a lot lately about what “product-market fit” actually means in practice, beyond the way it gets used as a buzzword in pitch decks and strategy decks alike.</p><p>The term gets credited to Marc Andreessen, who described it simply as being in a good market with a product that can satisfy that market. Sean Ellis later offered a more testable version of the idea: survey your users, and if at least 40% say they’d be “very disappointed” without your product, you’re probably onto something real.</p><p>But the more I sit with it, the more I think the interesting part isn’t the definition. It’s what product-market fit is not. It’s not a launch date. It’s not a feature list. It’s not even a strong quarter of adoption numbers. It’s the state where a market’s real, specific need and your product’s real, specific answer to that need line up so well that growth stops requiring force.</p><p>Customers pull the product toward them instead of you pushing it at them. Usage compounds through word of mouth instead of persuasion. Retention holds instead of leaking.</p><p>And crucially, fit is rarely uniform. A product can have strong fit in one segment, one region, or one use case, and weak or no fit in another — because “the market” is never really one market. It’s a collection of very different people with very different problems, wearing the same label.</p><p>That’s the part I find most relevant to how we build things in commercial real estate technology. A workflow that feels indispensable to a facilities team in one region can feel like noise to a similar team somewhere else, not because the underlying problem is different, but because the shape of the problem, the vendors involved, the approval chains, the currencies, the regulatory quirks, the way spend gets tracked and reported, is different.</p><p>Product-market fit has to be pursued region by region and workflow by workflow, not assumed to travel automatically just because something worked well somewhere else. A feature that already has fit in one market doesn’t arrive with fit anywhere else. It has to earn it again, against the realities of local vendor ecosystems, local reporting expectations, and local ways of working.</p><p>If there’s one thing I’d want other product and CRE teams to take from this, it’s that product-market fit is less a box you check once and more a discipline you keep practicing; market by market, segment by segment, as the ground underneath your users keeps shifting. The moment you treat it as “done,” it usually isn’t.</p><p>What has your experience been with finding fit across different markets or regions? I’d genuinely like to hear how others have approached it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7ab621d378f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Product Leader’s Guide to Token Economics]]></title>
            <link>https://medium.com/@payalswami/the-product-leaders-guide-to-token-economics-0e10511f7ed3?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e10511f7ed3</guid>
            <category><![CDATA[ai-product-management]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[product-strategy]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[productmanagment]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 03:02:38 GMT</pubDate>
            <atom:updated>2026-08-04T03:02:38.763Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="AI_Tokens" src="https://cdn-images-1.medium.com/max/1024/1*-PyEYyYwMXZ2Aeeng-baaA.png" /><figcaption>AI_Tokens</figcaption></figure><h3>What I Keep in Mind About Token Usage as a Product Leader</h3><p>A few years ago, I didn’t need to think about tokens. Now, every AI feature I ship has a hidden line item running underneath it — cost, latency, and quality all tied to how many tokens flow in and out. I’ve learned that if I don’t own this as a product decision, it gets made for me by default, usually in a way I don’t like.</p><p>Here’s what I actually keep top of mind.</p><h3>I treat tokens as currency, not a technical detail</h3><p>A token is roughly three-quarters of a word. Every prompt I send, every document retrieved, every turn of conversation history, every tool call and its result — all of it gets counted, and I pay for what goes in and what comes out.</p><p>I’ve stopped thinking of this as an engineering concern. It’s directly tied to three things I’m accountable for:</p><p><strong>Cost.</strong> My AI feature doesn’t have one cost-per-use, it has a distribution. A user who pastes in a ten-page document costs me 50x more than one who types a one-line question. If my pricing doesn’t account for that variance, I’m quietly subsidizing my heaviest users.</p><p><strong>Latency.</strong> More tokens in, more tokens out, more time waiting. A feature that feels instant at 200 tokens can feel broken at 2,000. I treat latency as a design decision, not just an infra metric — it’s how much context and output quality I’m willing to trade for speed.</p><p><strong>Quality ceiling.</strong> Context windows are finite. If a feature needs to reason over a long document, a chat history, and tool results at once, I can hit real limits on what the model attends to well, not just what technically fits.</p><h3>I set token budgets the same way I set any other spec</h3><p>I don’t leave this to engineering to figure out downstream. I treat it as a product requirement from day one.</p><ul><li><strong>I set a token budget per user action</strong>, the same way I’d set a latency SLA. If a “summarize this” feature is burning 8,000 tokens a call, I want to know if that’s intentional or scope creep before it ships.</li><li><strong>I track cost per active user, not just cost per API call.</strong> A power user hitting the feature 200 times a day looks nothing like an occasional user, and my pricing tiers need to reflect that or my margins erode silently.</li><li><strong>I ask for token usage to be instrumented like any other metric</strong> — tokens in, tokens out, cost per session, latency by token count. If I can’t see it on a dashboard, I find out there’s a problem when the bill lands, not before.</li></ul><h3>The levers I actually weigh</h3><p>Every one of these is a real tradeoff, and part of my job is deciding which side of it I want.</p><ul><li><strong>Model tiering.</strong> Not every task needs the flagship model. I push teams to route simple classification or extraction to a smaller, cheaper model and reserve the expensive one for tasks that genuinely need the reasoning. This is often the single biggest cost lever available.</li><li><strong>Context management.</strong> Do we send the full conversation history every call, or summarize older turns? Retrieve the whole document or just the relevant chunk? I treat this as product design, because it directly shapes what the AI “remembers” and how it behaves — not just what it costs.</li><li><strong>Prompt caching.</strong> If a system prompt or reference document gets reused across calls, caching it can meaningfully cut cost and latency. I ask engineering directly whether this is in play before assuming it is.</li><li><strong>Streaming vs. batching.</strong> Streaming a response token-by-token makes a slow response feel fast, even when total token count hasn’t changed. It’s often close to free to implement and it changes perceived quality more than almost anything else I can do.</li><li><strong>Output constraints.</strong> Asking for a structured, bounded response instead of an open-ended one is one of the simplest ways I control cost and latency at once — and it usually improves quality, because the model isn’t padding.</li></ul><h3>Why I put this on the roadmap, not just in eng standups</h3><p>The uncomfortable truth I’ve had to sit with: a lot of AI features ship with no real token strategy, and it works fine until usage scales. Then cost-per-user quietly outpaces revenue-per-user, or a “premium” feature turns out to be a loss leader I priced wrong. By the time that shows up in a P&amp;L review, it’s a much harder conversation than it would have been at the design stage.</p><p>So the questions I try to ask early, every time:</p><ul><li>What does this cost at 10x usage, not just at launch volume?</li><li>What’s our latency budget, and what are we trading to hit it?</li><li>Is this feature’s value proportional to its token cost, or are we burning budget on context the model doesn’t even need?</li></ul><p>Tokens aren’t just an infrastructure detail to me anymore. They’re a product constraint, a pricing lever, and increasingly, a place where the leaders who understand this well enough to design around it are going to outrun the ones who just react to the invoice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e10511f7ed3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Architecture of Starbucks]]></title>
            <link>https://medium.com/@payalswami/serverless-architecture-of-starbucks-468b921c9de9?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/468b921c9de9</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[starbucks]]></category>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Mon, 25 Dec 2023 22:37:41 GMT</pubDate>
            <atom:updated>2023-12-25T22:37:41.919Z</atom:updated>
            <content:encoded><![CDATA[<p>Starbucks, where families and friend meet and make countless memories on a cup of coffee. From ordering a hot cup of mocha to reach it to your hand, it is quite a process. We’ll see in this article how Starbucks, the coffee giant, may have embraced serverless architecture to enhance its scalability, agility, and cost-efficiency. Let’s delve into this approach through the lens of key system design concepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1i6PS_XXPPteL3q3aYiNg.jpeg" /><figcaption>Photo credit: Peter Kambey</figcaption></figure><h3>What is serverless architecture?</h3><p>Serverless architecture does not mean that there is no server. Serverless architecture is a cloud computing model where developers write and deploy code in response to specific events, without having to manage the underlying infrastructure. The cloud provider (AWS, Azure, Google Cloud) spins up resources to run the code on demand, then scales them down or shuts them off when the function finishes. User only pay for the resources used, not for idle servers.</p><p>Here we are taking an example of Starbucks ordering process and trying to explain from the lenses of serverless architecture. All services used in this architecture will be considered deployed on AWS lambda functions. Each service will be using its own database as a microservices pattern.</p><h3>Starbucks order process</h3><p>Here’s a breakdown of how a Starbucks order might be implemented using serverless architecture:</p><ul><li><strong>Mobile app or website</strong>: The customer places an order through the Starbucks application on mobile or website.</li><li><strong>API Gateway:</strong> This serverless component receives the order request and routes it to the order service.</li><li><strong>Order Service</strong>: This lambda function validates the order details. It communicates with inventory service to checks inventory levels and put the order in queue service.</li><li><strong>Inventory Service: </strong>This lambda function checks inventory levels in system that we have enough product and ingredients to make this order.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fyWH9mwgXgbcOlXXE_yq_w.gif" /><figcaption>Starbucks order processing</figcaption></figure><ul><li><strong>Payment Service</strong>: This lambda function handles payment authorization and interact with third-party PSPs (Payment Service Providers) like PayPal, Visa etc. to finalize the transaction.</li><li><strong>Notification Service</strong>: Payment function talks to notification service and customer receives notifications through the app or via text message.</li><li><strong>Analytical Platform</strong>: The payment function sends transaction details to the analytics platform.</li></ul><p>At Starbucks, cashier takes your order and process payment. Then he writes the customer’s name on a coffee cup to pass it to barista to prepare coffee. Barista picks up the cup and makes coffee. Customers get their coffee at the counter.</p><p>The cashier takes the order and does not wait for the first order for completion. It takes another order and put all the orders in queue. Similarly, barista put the completed coffee on the counter and prepare the next order.</p><p>All these steps work in asynchronous manner and operates independently. Message queue plays an important role over here. Here is updated process flow diagram with queue service.</p><figure><img alt="Queue service in Starbucks order processing" src="https://cdn-images-1.medium.com/max/1024/1*5k2x8Ow13Mv9oodLB1UK0A.gif" /><figcaption>Queue Service in Starbucks order processing</figcaption></figure><h3>Pros of Serverless Architecture:</h3><p>Here are some of the major advantages of using serverless architecture.</p><ol><li><strong>Faster Development and Deployment: </strong>With serverless architecture there is no need to manage servers or infrastructure. It gives more time to focus on writing code and building features. Deploy changes and updates on the fly, without worrying about server downtime or maintenance.</li><li><strong>Scalability and Cost Efficiency: </strong>Resources automatically scale up or down based on demand, ensuring optimal performance without paying for idle servers. You only pay for the resources your lambda functions use, leading to significant cost savings. You do not need to invest in and maintain your own servers or hardware.</li><li><strong>Increased Productivity</strong>: Developer can focus more on code logic and business functionality, in spite of thinking about server management. Develop and test new features quickly and easily without worrying about complex infrastructure dependencies.</li><li><strong>Enhanced Reliability and Security</strong>: Cloud providers manage the underlying infrastructure, ensuring high availability and resilience. Developers can concentrate on securing their code logic without managing server security configurations.</li></ol><h3>Cons of Serverless Architecture</h3><p>Serverless architecture isn’t perfect for every situation. There are various drawbacks also with this.</p><p>1.<strong> Cold Starts: </strong>The first time a function is invoked after a period of inactivity, it can experience a delay due to the time needed to spin up resources. This can impact performance-sensitive applications.</p><p>2. <strong>Database Issues: </strong>Some databases have connection limits, and opening a new connection for each Lambda invocation may lead to reaching these limits quickly.</p><p>3. <strong>Potential Cost Overruns: </strong>While cost-efficient for many use cases, unpredictable or high-volume usage can lead to unexpected costs.</p><p>4. <strong>Limited Control and Customization: </strong>Developers have less control over the underlying infrastructure and runtime environment, which can limit customization options.</p><p>5. <strong>State Management: </strong>Serverless lambda functions are often stateless, meaning they don’t maintain data between invocations.</p><p>6. <strong>Long-Running Processes: </strong>Serverless lambda functions typically have timeout limits, making them less suitable for tasks that require extended execution times.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=468b921c9de9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design of Telegram]]></title>
            <link>https://medium.com/@payalswami/system-design-of-telegram-d5fc1fcbb16a?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5fc1fcbb16a</guid>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Fri, 08 Dec 2023 02:10:14 GMT</pubDate>
            <atom:updated>2023-12-13T18:00:19.198Z</atom:updated>
            <content:encoded><![CDATA[<p>There are numerous cloud-based instant messaging applications available, each with its own unique features and target audience. Examples of these applications are Telegram, WhatsApp, Slack, Skype, Discord, Signal, Microsoft teams and Facebook messenger. Here we will take Telegram for system design prospective. You can explain other applications in similar manner like Telegram.</p><figure><img alt="Picture of various instant messaging applications logos" src="https://cdn-images-1.medium.com/max/381/1*PKBfmytgvn8fMCz9hqooow.png" /><figcaption>Various instant messaging applications</figcaption></figure><h3>Functional Requirements:</h3><ol><li><strong>Application type</strong>: What type of application Telegram is? (Telegram is available on mobile devices, desktops, laptops and web browser)</li><li><strong>Content Type:</strong></li></ol><ul><li>What type of content user share on Telegram? (Telegram is used for instant text messaging between two users of Telegram.)</li><li>Can user share other content as well on Telegram? If yes, then what is the limit if the size of the files? (Telegram enables users to share a wide range of files, including documents, photos, videos, and audio, with up to 2GB file size per message.)</li><li>Can multiple users chat on Telegram? (Yes, Telegram supports large group chat and can accommodate up to 200,000 members. This feature makes it ideal for communities, organizations, and large-scale discussions.)</li><li>Can user broadcast the message to bigger audience? (Telegram’s channels serve as one-to-many broadcast platforms, allowing users to disseminate messages to a large audience of subscribers.)</li></ul><p>3. <strong>Notification status: </strong>Does user get the notification of sending, receiving and delivering the messages? (Yes, Telegram messages shows it by ticks which can explain below)</p><ul><li><strong>One Tick</strong>: A single tick next to your message indicates that the message has been successfully delivered to Telegram’s servers. This means that the message has been sent to the cloud and is ready to be delivered to the recipient’s device. However, it doesn’t necessarily mean that the recipient has seen the message.</li><li><strong>Two Ticks</strong>: Two ticks next to your message indicate that the message has been delivered to the recipient’s device and recipient has opened the chat containing the message. This means that the message has been displayed on the recipient’s screen, but it doesn’t necessarily mean that the recipient has read the message.</li><li><strong>No Ticks:</strong> If there are no ticks next to your message, it means that the message is still pending. This could be because the recipient’s device is offline, they have network connectivity issues, or they have blocked you.</li></ul><p>4. <strong>Audio and video calls: </strong>Can user make audio and video calls on Telegram? (Telegram offers high-quality voice and video calling capabilities, allowing users to engage in real-time conversations with individuals or groups.)</p><p>5. <strong>Privacy of messages:</strong> Does Telegram self-destructs the messages for privacy? (Telegram’s Secret Chats feature incorporates self-destructing messages, enabling users to set a timer for messages to automatically disappear after a specified duration.)</p><h3>Non-Functional Requirements:</h3><ol><li><strong>Performance: </strong>Telegram should be fast. There should be minimal latency when user send and receive the messages.</li><li><strong>Scalability: </strong>Application should accommodate if user base is increasing. The performance of the application should not degrade with increased number of users or traffic.</li><li><strong>Reliability: </strong>Application should be reliable and should deliver the messages with full security and privacy.</li><li><strong>Security</strong>: Telegram should prioritize user security, safeguarding user data and protecting against unauthorized access or data breaches. Strong encryption and robust security measures should be implemented.</li><li><strong>Usability: </strong>Telegram application should be user friendly and easy to use.</li><li><strong>Internationalization</strong>: Telegram should support multiple languages and cater to users worldwide. It should be localized and adapted to different cultures and regions.</li><li><strong>Update and Maintenance: </strong>Application should be easy to maintain and update, allowing developers to fix bugs, implement new features, and address security vulnerabilities without disrupting user experience.</li></ol><h3>Scale of application:</h3><ol><li><strong>Total Users: </strong>Telegram has 250 million daily active users (DAU) as of 2023.</li><li><strong>Message Volume: </strong>Telegram process over 1 billion messages per day.</li><li><strong>Data Usage:</strong> Telegram’s data usage is estimated to be around 50 petabytes per month.</li><li><strong>Geographic Reach:</strong> Telegram has a global presence with users in over 200 countries and territories.</li></ol><h3>Use cases of Telegram:</h3><p>Here we are taking two use cases of Telegram. First use case is chat between two users and second use case is group chatting.</p><p><strong>One to one user:</strong> Telegram has multiple users and they registered in Telegram with their phone number. A user sends the message to the other recipient user. As soon as message goes, it shows one tick which means the message has been successfully delivered to Telegram server. If the recipient user is offline, then it will not deliver the message to that user. It will stay in the queue service and will wait for that recipient user to be available. We can see the last seen time stamp on the recipient user information. As soon as the recipient user will be available, then that message will be delivered on the recipient user’s device. On first user application, now the single tick will change to the double tick which means that message has been delivered to the recipient’s device and recipient has opened the chat containing the message.</p><p><strong>Group Chat between multiple users:</strong> Telegram facilitate communication and collaboration among a vast number of participants by group chat functionality. User can engage with lots of members in real time by group chat.</p><h3>High Level System Design of Telegram:</h3><p>There are multiple components which make Telegram works. These components are:</p><ol><li>Devices for Telegram</li><li>Load balancer</li><li>Services which play an important role in Telegram functionality</li></ol><ul><li><strong>User Service</strong>: This service stores user information and updates</li><li><strong>Session Service:</strong> This service contains the session information about the users.</li><li><strong>Group Service</strong>: This service stores information about the group chat users.</li><li><strong>Last Seen Service</strong>: This service stores information about the status of the user whether user is online or offline.</li><li><strong>Message Queue Service</strong>: It contains all the messages which user sends and stores it until the recipient user is online.</li><li><strong>Push Notification Service</strong>: As soon as user get online, this service push notification on recipient device.</li><li><strong>Chat Service</strong>: It stores all the messages which user share on Telegram. it contains the text messages, audio and video files.</li></ul><p>4. <strong>Database to store information: </strong>Here we are taking microservices approach where each service has its own respective database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*epTxxhA2RNzPt4zNHNaoeg.gif" /><figcaption>High Level Diagram of Telegram</figcaption></figure><p>Telegram can be accessed on browser and phone devices. It goes through CDN layer where, it can handle large spikes in traffic, guaranteeing that Telegram remains responsive and reliable even during large chat volume. Traffic distributes through load balancer to the Telegram server. The microservices take the input and reach to the respective database to return the message back. It&#39;s a very high-level diagram and we are not explaining the queue service functionality in detail here.</p><h3>Sequence Diagram of Telegram:</h3><p>You can see the detailed flow diagram that can explain that how the message flows from server to the other user device.</p><p><em>Please zoom the diagram to understand the flow.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TBFVuRVOykghBYa0hUe8fg.png" /><figcaption>Sequence Diagram of Telegram</figcaption></figure><p>In conclusion Telegram’s system design is a well-designed and scalable solution for a high-volume messaging platform. Its focus on security, privacy, and user experience has contributed significantly to its success. Overall instant messages applications like WhatsApp and Telegram have become an essential part of our digital lives, transforming the way we communicate, share information, and connect with others and evolving continuously.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5fc1fcbb16a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[System Design of Spotify]]></title>
            <link>https://medium.com/@payalswami/system-design-of-spotify-17b1c828b7bf?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/17b1c828b7bf</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[spotify-architecture]]></category>
            <category><![CDATA[spotify]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 04:32:24 GMT</pubDate>
            <atom:updated>2023-12-13T18:08:50.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Spotify logo" src="https://cdn-images-1.medium.com/max/1024/1*DzANpcOwzOBxjbFZA0L27g.jpeg" /><figcaption>Spotify logo</figcaption></figure><p>Spotify is a digital music streaming service that provides access to a vast library of songs, podcasts, and other audio content. Users can listen to music from various artists and genres on demand, create playlists, and discover new music through personalized recommendations. Let&#39;s discuss the system design for Spotify.</p><h3>Finding the requirements from the stakeholders.</h3><h4><strong>Functional Requirements:</strong></h4><ol><li><strong>Application Type</strong>: What type of application this is? (Available on various devices and platform such as phone, laptop, smart watch, tablet and smart speaker)</li><li><strong>Content Type:</strong> What content this application has? (Spotify has millions of songs/audio files)</li><li><strong>Capability:</strong></li></ol><ul><li>Can we download music from this? (Yes, Limit is 10,000 songs up to 5 different devices. All devices should have same account login.)</li><li>Can user search his desired music? (Yes, User can search the desired song, desired artist, desired podcast, desired genre of music)</li><li>Can user control the music? (Yes, User can skip, play, pause, repeat and shuffle the music.)</li><li>What other categories Spotify has? (Spotify has users, artists, playlists, podcasts, and radio.)</li><li>Can user create a playlist of his favorite content? (Yes, User can edit/create/delete a playlist.</li><li>Can we share the music on social platform? (Yes, User can integrate music with social media platform as well.)</li><li>Do we get notifications for any new content? (Yes, User get push notification for new releases, recommendations and new update.)</li><li>Can we get the lyrics of the song as well? (Yes, Spotify has the capability of displaying the lyrics of the song, which user is listening.)</li></ul><h4><strong>Nonfunctional Requirements:</strong></h4><ol><li><strong>Availability: </strong>As soon as user will search the music, the music should play immediately. System should be highly available with minimum latency.</li><li><strong>Throughput: </strong>Throughput should be higher. System should be capable of handling large number of users and their streaming requests without degradation in performance.</li><li><strong>Usability: </strong>User interface should be intuitive, easy to navigate and visually appealing.</li><li><strong>Scalability: </strong>The system should be able to handle an increasing number of users, songs, and playlists without a significant degradation in performance.</li><li><strong>Compatibility: </strong>The application should be compatible with a wide range of devices, operating systems, and web browsers.</li><li><strong>Offline mode performance:</strong> When in offline mode, the system should efficiently manage downloaded content, ensuring smooth playback and minimal storage requirements.</li><li><strong>Internationalization and Localization: </strong>The application should support multiple languages and cultural preferences to cater to a diverse user base.</li><li><strong>Error Handling: </strong>The system should provide clear and helpful error messages, guiding users in case of issues.</li><li><strong>Update and Maintenance: </strong>The process of updating the application should be seamless for users, and maintenance activities should not disrupt the user experience.</li></ol><h4><strong>Scale of application:</strong></h4><ol><li><strong>Total Users:</strong> Spotify has 551 million monthly active users as of third quarter of 2023.</li><li><strong>Total Data:</strong> Spotify’s music library consists of over 82 million songs. If each song is around 3–5 MB in size, then total music data is likely in the range of 246–410 terabytes (TB). Other than that Spotify saves user data (User’s history, playlist and preferences which can be in range of tens of petabytes) and artist data (Artist’s biography, photos and tour dates which can be in range of hundreds of terabytes).</li></ol><p>Overall, it is estimated that Spotify stores over 500 PB of data. This is a massive amount of data, and it is growing rapidly as Spotify continues to add new songs, users, and artists.</p><p>This is the detailed functional and nonfunctional requirements of Spotify. For system design we will consider the high-level design that how a user search music on the application and play that music. <em>If you are explaining this concept in any interview, then try to constrain the problem so that you can explain in limited time.</em></p><h3><strong>High Level System Design of Music application like Spotify:</strong></h3><p>First, we will discuss the high-level system design of Spotify. In real case Spotify must be using different services but we are explaining it in general by taking example of AWS services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*7qrwMH4lbQP20rRFSQ9N5A.gif" /><figcaption>System Design Spotify. Pic copyright and credit: Payal Swami</figcaption></figure><p><strong>Component 1: Devices to access Spotify</strong></p><p>Spotify can be accessed on multiple devices. It can be accessed on desktops, phones, tablets, smart TVs, smart speakers, wearables like smart watches, gaming consoles and car systems. Users can search for the desired music on any of these devices.</p><p><strong>Component 2: Content delivery network (CDN)</strong></p><p>In the second component we explain the CDN layer for Spotify. Spotify uses a combination of its own CDN infrastructure and third party CDN’s such as Fastly and Akamai. Here we are taking an example of the CloudFront CDN which is from the AWS family.</p><p>CDN infrastructure is responsible for caching and delivering the static content. This content can be images, CSS and JavaScript files. It helps in reducing the latency and improving the user experience as these edge servers are strategically located around the world.</p><p>Spotify localizes the content so people can easily find Bollywood music in India, K-pop in Korea and sertanejo in Brazil. Playlists can share a theme but feature different songs in different parts of the world, so Taiwan’s hits are not the same as those in the United States.</p><p>See below for how Spotify presents a “Happy Hits” playlist in the United States, India, Taiwan and Turkey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CddfWg1ZKkVgzhy0" /><figcaption>credit <a href="https://medium.com/u/60a317bb70e4">Spotify</a></figcaption></figure><p>At the CloudFront layer we can seamlessly handle spikes in traffic and demand, guaranteeing that Spotify streaming application remains responsive and reliable even during peak usage periods. CloudFront integrates with AWS security services like AWS Shield and AWS Web Application Firewall (WAF), providing robust protection against cyberattacks and unauthorized access. This safeguards the streaming content and user data.</p><p>CDN layer supports HLS (HTTP Live Streaming), a widely used protocol for streaming media content. This enables efficient delivery of adaptive bitrate streams, ensuring optimal playback quality on various devices and network conditions.</p><p>CDN layer provides real-time monitoring tools that enable you to track streaming performance, identify potential issues, and optimize delivery.</p><p><strong>Component 3: Load balancer</strong></p><p>Spotify has a huge user base and it receives millions of requests at the same time from users. It uses a load balancing system to effectively distribute incoming requests across a network of backend servers, ensuring optimal performance, reliability, and scalability for its massive user base.</p><p>Spotify’s load balancing system dynamically scales up or down the number of backend servers based on real-time traffic patterns. This ensures that the system can handle spikes in demand without performance degradation. The load balancing system continuously monitors server health and performance metrics, generating alerts when potential issues arise. This allows Spotify to proactively address any problems before they impact users.</p><p>To improve performance and reduce latency, Spotify employs caching mechanisms. Caching involves storing frequently accessed content on the web server or edge servers closer to the user, reducing the need to retrieve it from the origin server each time. Spotify’s web servers implement various security measures to protect user data and prevent cyberattacks. These measures may include encryption protocols, authentication mechanisms, and vulnerability management practices.</p><p><strong>Component 4: Spotify Web Server</strong></p><p>When a user creates a request to search a track it goes to the spotify web server. It follows the below steps.</p><ul><li>The user’s device contacts a Domain Name System (DNS) server to translate the Spotify website URL into the actual IP address of the web server.</li><li>This device establishes a TCP (Transmission Control Protocol) connection with Spotify’s web server. This connection serves as a dedicated channel for communication between the user and the server.</li><li>The user’s device sends an HTTP (Hypertext Transfer Protocol) request to Spotify’s web server. This request contains information about the specific page or resource the user is trying to access, such as the homepage, login page, or a specific playlist.</li><li>Spotify’s web server receives the HTTP request, processes it, and generates an HTTP response. The response contains the requested content, such as HTML code, CSS stylesheets, JavaScript files, and images.</li><li>The user’s web browser receives the HTTP response from Spotify’s web server and begins rendering the content. User start listening to the desired track.</li></ul><p><strong>Component 5: Relational database (RDS) to save metadata.</strong></p><p>RDS is a highly optimized and efficient database service that can handle large volumes of data quickly and reliably. This is important for Spotify, which needs to be able to store and retrieve metadata for its millions of songs, artists, and playlists.</p><p>It is a scalable database service, which means that it can be easily expanded to accommodate more data. RDS is a reliable database service, which means that it is unlikely to crash or lose data. This is important for Spotify, which needs to be able to access its metadata 24/7.</p><p>Here are some specific examples of how Spotify uses RDS to store and manage metadata.</p><ul><li><strong>Song metadata:</strong> Spotify stores information about its songs, such as the song title, artist, album, and release date. This metadata is used to search for songs, create playlists, and recommend songs to users.</li><li><strong>Artist metadata</strong>: Spotify stores information about its artists, such as the artist’s name, biography, and genre. This metadata is used to create artist pages, display artist information on songs, and recommend artists to users.</li><li><strong>Playlist metadata</strong>: Spotify stores information about its playlists, such as the playlist name, creator, and tracks. This metadata is used to display playlists, play playlists, and recommend playlists to users.</li></ul><p><strong>Component 6: Storage Service (Amazon S3)</strong></p><p>Spotify contains millions of music tracks which need to be saved somewhere. Spotify does not directly store MP3 files on its servers. Instead, it encoded the music in a proprietary format called Ogg Vorbis that is optimized for streaming. It uses many third-party tools which convert these proprietary formats to MP3 format on the fly. Here to explain a simple music file saving, we are taking the storage service S3 for example where we will store the audio files MP3 in that. When a user makes a request for a song then first it presents the metadata related to that track and then plays the specific track from S3 bucket and serves it on the user’s device.</p><p>Spotify’s storage service works by using a combination of caching and streaming.</p><p>Caching is the process of storing data temporarily in a location where it can be accessed quickly. Spotify caches songs on your device so that they can be played without having to be downloaded again each time you listen to them. This makes playback faster and smoother, especially when you’re offline.</p><p>Streaming is the process of downloading data from a server as you need it. Spotify streams songs from its servers to your device so that you can listen to them without having to download them all at once. This is useful for listening to new music or for when you don’t have enough storage space on your device.</p><p>Spotify uses a hybrid approach to storage, which means that it uses both caching and streaming to deliver the best possible listening experience. When you first listen to a song, Spotify caches it on your device. This means that you can listen to the song again without having to download it from the server. If you listen to the song again later, Spotify may check to see if there is a newer version of the song available on the server. If there is, Spotify will download the newer version and replace the cached version.</p><p>Spotify also uses streaming to deliver music that is not cached on your device. When you stream a song, Spotify downloads it from the server in small chunks as you listen to it. This means that you can start listening to a song almost immediately, even if you don’t have a lot of storage space on your device.</p><p>This is how a simple use case of searching the music on Spotify and playing that can explain through high level system design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17b1c828b7bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How pandemic effect differently around the world]]></title>
            <link>https://medium.com/@payalswami/how-pandemic-effect-differently-around-the-world-c5c3ab51b4fc?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5c3ab51b4fc</guid>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[covid-19-crisis]]></category>
            <category><![CDATA[corona]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[covid-diaries]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Mon, 05 Oct 2020 18:46:54 GMT</pubDate>
            <atom:updated>2020-10-05T18:46:54.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ucudchZrGclV90kLuasWiw.jpeg" /><figcaption><a href="http://Photo by Polina Tankilevitch from Pexels">Credit @polina tankilevich</a></figcaption></figure><p>Pandemic. As soon as we hear this word it gives us a weird feeling. We used to watch this only in movies when the whole town get affected by a wide spread disease and scientist used to find the cure during those 90 minutes of that movie. I wish it was as simple as they generally portray in the movies. Life was going normal and we were busy in our regular life and then this disaster came and whole world get stopped.</p><p>In starting everyone was talking about a specific country who effected with this but later it reached not only to different countries but all continents. I still remember the day when in January I was in office and was chatting with my teammates about the mortality rate and effect of corona. Next day we got to know that we lost one of our office mate in this fight and our offices are now closing for the indefinite time. Now it has been 7 months and we all are used to this new norm of life where we do work from home and kids attend the remote classes.</p><p>During this situation I saw the <strong>3D</strong> effect of Corona. Here <strong>3D</strong> is not the three dimensional effect but it is that how people get effected differently in this situation and I divided them in three categories.</p><p>First category people were who utilized this time in improving their skills, learning new things, exploring new hobbies. Luckily those were the people who did not get impacted by this awful disease or loss of employment. Some did the soul searching during this time and figured it out that what they can do better when it comes to their work or life. On the other hand there were some people who had the other challenges to overcome like surviving in the low economy without job. There were few people in this category who were trying to neglect the seriousness of this wide spread because fortunately they were not facing it. If you are not facing this luckily, then please respect those people who are going through this.</p><p>Second category people were who faced this disease in their family. It shook them completely because it is not easy when you go through something like this. There were people who were praying to God that they can do anything to over come this disease. Few were regretting that why they took it so lightly and did not bother that how this deadly virus will gonna effect their body. They survived this storm and came back to the normal life but they will never forget these days throughout their life when they saw life and death hand in hand.</p><p>Third category people were who lost their dear ones in battling this pandemic. This was like a nightmare for them as no one thought that this type of horrendous time will come and it will take away so many lives. There were people who said final good bye to their family members on phones and family members saw this helplessly. During this time hats off to all the front line fighters who took care of everyone with full empathy but we cannot fill the void space in those families who lost their loved one.</p><p>“<strong><em>The life of the dead is placed in the memory of the living.” : </em></strong><a href="https://www.brainyquote.com/authors/marcus-tullius-cicero-quotes"><strong><em>Marcus Tullius Cicero</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6dp2cWof81vpcwER0-yTqQ.jpeg" /><figcaption>credit: <a href="https://www.pexels.com/@thepaintedsquare?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Jessica Lewis</a> from <a href="https://www.pexels.com/photo/christian-cross-surrounded-by-daffodils-4102259/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>Exercise: Just sit back and look around you that what you have. If you are working from home, then follow the routine and along with that cherish the moments with your kids and watch them growing. Think about those people who are suffering from this disease and call them so that they will not feel alone. You can not physically support them but at least emotionally you can make them strong. Showing empathy is nothing but capacity to place oneself in another’s position. By helping each other we will overcome this situation and will come back to normal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5c3ab51b4fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is satisfaction]]></title>
            <link>https://medium.com/@payalswami/what-is-satisfaction-76987f0e6c8d?source=rss-5e94f743e51f------2</link>
            <guid isPermaLink="false">https://medium.com/p/76987f0e6c8d</guid>
            <category><![CDATA[contentment]]></category>
            <category><![CDATA[satisfaction]]></category>
            <category><![CDATA[inner-journey]]></category>
            <category><![CDATA[inner-peace]]></category>
            <dc:creator><![CDATA[ThinkFromSoul]]></dc:creator>
            <pubDate>Thu, 17 Sep 2020 20:43:44 GMT</pubDate>
            <atom:updated>2020-09-17T20:43:44.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Image of divine Buddha" src="https://cdn-images-1.medium.com/max/1024/1*996DRkUGWpoGG7Q5rf71dg.jpeg" /><figcaption>Credit: <a href="https://www.pexels.com/@mkvisuals?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Kaushal Moradiya</a>/Pexels</figcaption></figure><p>I think in our life a moment comes when we sit back and think that when this race will be over. Race of gaining name and fame, earning money or running behind our desires. We are not Buddha means “Awakened one” who can raise from the sleep of ignorance and start looking the true world around us. We are a normal human beings who always get busy in setting new future goals and keep chasing these goals one after another. We forget that what satisfaction taste like or feel like.</p><p>Felling satisfy does not mean that now you are not ambitious. It does not mean that you become passive and you are lacking the fire to achieve something. Contentment is very paradoxical. In current time we have not taken the contentment and happiness in the right context. Both goes hand in hand. Contentment comes naturally when you feel happiness from inside.</p><p>Setting goal and work towards it, is not wrong. Wrong is, that if you stop enjoying the moment in which you are living. In the end when you will fulfill your goal then may be that happiness will last for a while. You will feel happy that you achieved something and you are on top of the world. But soon after you will keep setting some bigger goal and keep pushing your self to achieve that. Now if you give yourself a halt and think deeply then you will realize that in process of running behind these goals, you missed so many precious moments or events. Now a then it is good to pause in our pursuit of happiness and just be happy. Time is a universally changing dimension. It always go forward. Even though we feel many time that we could have gone back to the old time and rectify so many things in our life, but it is not possible.</p><p>Human never feel satisfy. To gain the satisfaction you have to work towards it. You have to train your mind and follow few things in your life which are</p><p><strong>Stop comparing your life with others : </strong>The easiest way to achieve the satisfaction and happiness is to stop comparing your life with other people. Human always look for the people who are more famous than themself or more richer than them. If you are considering them a positive enforcement then its fine but if you are comparing your life with them and getting depressed then you will never achieve happiness. Everyone has the different journey in the life so results can vary. There are people who are happy with less than what you have in life.</p><p><strong>Make realistic goals: </strong>Setting goals are not wrong but one should set the realistic goals which can be achievable. When you will achieve that goal, you must have enjoyed the journey behind that because the process and journey which you spend to achieve that goal is the real one which gives you the most important experience of the life. Happiest people may not have the best of everything but they know how to make best of everything.</p><p><strong>Appreciate the things which you have: </strong>Our life is like a deck of card and it has what life give us. You should always appreciate the things which you have because there must be so many people in this world which have lesser than what you have. We generally forget what we got in life and keep cribbing about the things which we don’t have. Appreciate people and show gratitude because it gives an immense happiness to you and the other person.</p><p><strong><em>“ There are only two ways to live the life. One is as though nothing is a miracle. The other is as though everything is a miracle.”: Albert Einstein</em></strong></p><figure><img alt="Woman feeling freedom" src="https://cdn-images-1.medium.com/max/1024/1*CFue5vdWKeSbY0d5aXTobw.jpeg" /></figure><p><strong>A small exercise : </strong>Maintain a diary in which you write three most important things which you want in a year. On the last day of that year come back and check that what you get out of those three things which you thought were the most important things in your life at that moment. When you will check that you will realize that there are more things than those desirable three things which you wrote in your diary. By this you will realize that you should appreciate God for millions of other things and happiness which He provided to you. I follow this every year with my kids and family. I hope you all will also do this and enjoy your life with immense feeling of contentment and happiness.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76987f0e6c8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>