<?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 Ankit Sobti on Medium]]></title>
        <description><![CDATA[Stories by Ankit Sobti on Medium]]></description>
        <link>https://medium.com/@sobtiankit?source=rss-830241514cd3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Zisot5iKdgLXIDxbod8mDQ.jpeg</url>
            <title>Stories by Ankit Sobti on Medium</title>
            <link>https://medium.com/@sobtiankit?source=rss-830241514cd3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:33:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sobtiankit/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[Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 3)]]></title>
            <link>https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-3-f1506e59dcb8?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1506e59dcb8</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Mon, 17 Dec 2018 07:31:37 GMT</pubDate>
            <atom:updated>2019-02-13T08:13:58.064Z</atom:updated>
            <content:encoded><![CDATA[<h3>Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 3)</h3><p><em>In this series (</em><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-1-introduction-a1ae019bb934"><em>Part 1</em></a><em>, </em><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-2-7c825d576947"><em>Part 2</em></a><em>), I have so far talked about the challenges we faced with building a microservices stack for Postman and how we put processes in place to overcome those. In this third and final part of the series, I will share how we evolved our practices to a growth framework for developers and maturity model for APIs that act as guidelines to how we work now as a team.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ipEojUx8UuIv3i-B" /><figcaption>Photo by <a href="https://unsplash.com/@olav_ahrens?utm_source=medium&amp;utm_medium=referral">Olav Ahrens Røtne</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Adopting principles for growth and maturity</h3><p>Building towards a maturity model and adopting a growth framework needed us to build and practice some key principles of microservices architecture.</p><blockquote>Postman largely runs on Postman.</blockquote><h4>Pursuit of automation</h4><p>Automation is one of the cornerstones of engineering at Postman. Postman itself was built to automate the tasks around API development. As we take it further, we have kept a constant emphasis on building an engineering culture centered around automation. We encourage new hires to build a collection and demo it in our demo days. A large part of our security operations and devops use collections, often mounted on Monitors. Postman largely runs on Postman.</p><p>Manual provisioning and manual deployments work at a small scale. If you are starting up or have a small team who manage a reasonably small number of software applications, you will not face much problem. But this does not scale. Especially, when you are serving over 5 million developers globally, spanned across more than 100K organizations.</p><p>Growing from there requires some investment and planning. It can be difficult to predict the places where a new organization needs to automate. These points became clearer as we grew. Having all of the background, that I have shared in the last two articles in this series, we worked towards building tooling to will help us practice our automation goals. We divided the tooling into three groups:</p><ul><li>Infrastructure automation</li><li>Testing automation</li><li>Continuous delivery</li></ul><h4>Towards decentralization</h4><p>Microservice as an architectural pattern highlights autonomy. Autonomy in this context stands for two major ideas:</p><ul><li>Freedom: Giving people as much flexibility as possible to do the job at hand.</li><li>Self-service: Empowering teams and individuals to do their job on their own without waiting for someone else to do it for them.</li></ul><p>Consider this, if I have to provision a machine to deploy my service, do I need to raise a ticket and wait for someone else to do it for me, or do I have the right access and tools to do it myself? Having the right infrastructure in place ensures teams can operate without friction and manage the lifecycle of a service on their own.</p><p>Building a low friction infrastructure requires keeping the plumbing simple, but the endpoints smart. Services require a messaging platform to orchestrate and exchange data. Such a messaging platform should focus on plumbing data and not start taking smart decisions. All the smarts should be present in the services. Not outside them.</p><p>In this way, developers interact with other services in the infrastructure through their APIs. Each service taking its own decisions on how to do their jobs best. The transport/plumbing layers simply focus on making sure the connectivity exists as required.</p><h4>Isolating failures</h4><p>With more services come more complexity, and with more complexity come more chances of failures. As the list of services grow, so do the number of machines and the number of network connections. The surface area for failures grow significantly. Machines can fail or network can fail. If a system is not designed with these contingencies in mind, it would invariably lead to more failure as the infrastructure grows.</p><p>Isolating failures across microservices becomes significantly important. To catch these failures in time, we decided to set up a distributed tracing system (DTS). The key points we focused on for this were:</p><ul><li>There should be debug calls through the entire stack trace. So, developers will be able to figure out where in the chain of services did an error occur.</li><li>IDs should flow downstream to all microservices. This helps keep track of resources and entities without adding ambiguity as a resource flows downstream and eventually out to the world.</li><li>Keep all databases separate. No database should be shared across services. The data persistence boundaries should not spill across services. Instead, all access to data should be exposed through APIs.</li></ul><p>These points are non-trivial to add into an architecture later on. They have to be planned and implemented upfront. Well-documented architectures with a live view into of the state of the system can be game changers.</p><h3>How Postman functions today</h3><p>With all the context set so far, let us look at how we work together. I have previously mentioned that we created high level teams to focus on different functions of the Postman ecosystems. Here is how they look in the end of 2018.</p><p>Under the new work-in-progress organization structure, we decided to bucket responsibilities for implementing the Principles of Microservices Design under the Services and Platforms teams as this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*sXqs0OQ-XrDwylkn52hMNQ@2x.png" /><figcaption>Principles of Microservices Design as owned by Services and Platforms teams</figcaption></figure><p>This led us to set the service expectations from these two broad teams.</p><h4>Service expectations from Platform</h4><p>The Platform team is responsible for recommending and enabling systems on which the rest of Postman is built and run. The systems that Platform builds need to allow others to deploy application code, across redundant instances. These need to be rolling deployments with support for application restarts. There can be multiple version of an API live at a given time. Platform achieves these goals today with a mix of automated and semi-automated processes.</p><p>Platform then needs to monitor the uptime, response time, performance metrics and error rates of the services that run on the infrastructure they have built. In case of any anomaly, the systems built by Platform alert the service owners — this can be due to a downtime, slow response times and high error rates beyond acceptable thresholds.</p><p>All of these actions are logged. Any event is logged and sent to a common logging infrastructure. Any error is sent to a common error-reporting infrastructure. Analytics events are sent to a common analytics infrastructure. These logs provide live and historical views of service health and maturity and are priceless when it comes to debugging issues and identifying bottlenecks that can be improved.</p><p>Platform harnesses these information and publishes build status and live health status of the whole system. As an additional dimension, we get code quality metrics of each service through lints and unit tests.</p><p>Beyond these, Platform handles provisioning and manages AWS and other resources in a self-serve way. Platform is also responsible for monitoring resource metrics and know how to react to any abnormalities. They publish cost metrics that result from our usage of AWS and other resources.</p><h4>Service expectations from consumers</h4><p>All consumers in the Postman infrastructure are expected to conform to a few set guidelines to ensure standard practices:</p><ul><li>All services should conform to a cross-service tracing standards while making API calls to other services.</li><li>They all make themselves discoverable through a common mechanism to other services.</li><li>They build contract tests for the services they are consuming.</li></ul><h3>Growth framework — Leveling up</h3><p>In Postman’s culture, “Leveling Up” is the most important thing that everyone has to do. We use a modified version of Medium’s <a href="https://medium.com/s/engineering-growth-framework">Engineering Growth Framework</a> to measure this.</p><p>The Products-Services-Platforms organization design allowed us to define the Growth Framework for everyone within Engineering. Everyone within the team has a clearly communicated ownership, accountability and a growth path. This helped us identify the roles and skillsets we will need for the members of these teams.</p><p>We created two roles within Services team: Service Owner and Service Contributor.</p><p><strong>The responsibilities of a Service Owner include:</strong></p><ol><li>Confirm and file JIRA issues for tasks</li><li>Code reviews</li><li>Architectural diagram for the service (including dependencies)</li><li>Manage Mocks, Docs, Monitors, Tests using Postman</li><li>Pushing patch fixes</li><li>Deploy and monitor versions, retire older versions</li><li>Administrate the database</li><li>Interface with Engineering Managers+ Product Manager + Platform</li><li>On-board, mentor and off-board developers within the service</li><li>Maintain SLAs for the service</li></ol><p>The list further includes:</p><ol><li>Interface with Support for user tickets</li><li>Interface with the Quality team</li><li>Interface with Security team</li><li>Interface with Platform team</li><li>Metrics: bugs, regressions, uptime, unit test coverage.</li></ol><p><strong>The responsibilities of a Service Contributor include:</strong></p><ol><li>Pick up/be allocated JIRA tasks as defined in the Product Specs</li><li>Peer code reviews</li><li>Write code, build mocks and monitors, prepare docs, write unit and integration tests</li><li>Address support tickets and bugs reported by Support and Quality teams.</li></ol><h3>Service Maturity Model</h3><p>These aforementioned helped us in establishing a measurable evolution pattern for the services. In the context of our microservices, we define an SLA to be a <em>commitment between the team providing the (micro)service to the products and services teams consuming that service</em>. Internally, we quantify the SLAs as a <em>maturity model</em> for those services.</p><p>There are six pillars of the maturity model:</p><ol><li>Quality — derives from the end-user experience and measures the quality impact of the service towards it</li><li>Performance — an index that measures the actual performance of the service against satisfactory and tolerable user experience</li><li>Availability — uptime of the service globally and with respect to its dependent services and products</li><li>Resilience — how resilient is the service to the (non) availability of each of its dependencies</li><li>Security — how secure is the service</li><li>Agility — a yardstick for the service owners, evaluating on planning, completion rates and eventual impact</li></ol><h3>The Outcome</h3><p>Back to the present, I see all of our efforts since 2014 bear fruits as how much we have evolved as an organization. Today, all of our teams operate autonomously with their own, independent roadmaps. We have managed to make decision making distributed. Everyone gets as much flexibility as they need for their work, but everyone is accountable for their actions and deliverables.</p><p>The original 10% of the team, including me, is now free to focus on newer, more impactful ideas. We have streamlined our hiring process and onboarding for the engineering team. Students joining us straight out of college ship their code to production in 2 months!</p><p>We have clearly defined SLA metrics between all our three main functions — Products, Services and Platforms. Platforms have grown to have a clear abstraction and plan for longer term stability, scalability and security.</p><p>The best outcome of all, with all these efforts, we now <em>ship quality software faster!</em></p><h3>In this series:</h3><ul><li><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-1-introduction-a1ae019bb934"><em>Conquering the Microservices Dependency Hell at Postman, with Postman (Part 1 — Introduction)</em></a></li><li><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-2-7c825d576947"><em>Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 2)</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1506e59dcb8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-3-f1506e59dcb8">Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 3)</a> was originally published in <a href="https://medium.com/better-practices">Better Practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 2)]]></title>
            <link>https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-2-7c825d576947?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c825d576947</guid>
            <category><![CDATA[team-building]]></category>
            <category><![CDATA[company-culture]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[organization]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 14:49:06 GMT</pubDate>
            <atom:updated>2019-03-05T15:57:07.633Z</atom:updated>
            <content:encoded><![CDATA[<h3>Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 2)</h3><p><em>In the </em><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-1-introduction-a1ae019bb934"><em>first article in this series</em></a><em> on Microservices at Postman, I talked about the situation we found ourselves in early 2018. I highlighted the challenges from technology as well as an organization perspective. In this article, I will discuss organizational practices we put in place that helped us overcome microservice dependency hell.</em></p><h3><strong>Dependency Hell</strong></h3><p>In the book <a href="https://books.google.com/books?id=cNGbObmg6IwC"><em>Linux Annoyances for Geeks</em></a>, author Michael Jang writes:</p><p><em>“Dependency hell is a colloquial term for the frustration of some software users who have installed software packages which have dependencies on specific versions of other software packages.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*khtlgHer0bG2G_cf" /><figcaption>Photo by <a href="https://unsplash.com/@olav_ahrens?utm_source=medium&amp;utm_medium=referral">Olav Ahrens Røtne</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sharing commonly-used code in the form of libraries is one of the key aspects of software development. We see it everywhere; in all popular programming languages. Ease of sharing code libraries combined with easy discovery build ecosystems out of programming language communities. NodeJS’s npm, Rust’s crates, Python’s PyPI are the perfect examples of such ecosystems.</p><p>However, as a package or module or library increases in adoption, they get bundled in more and more packages. While this is a nice thing to have, the flip side is that we see multiple levels of dependencies build up as these packages are in turn used by others and those by others. We soon end up with a spaghetti of dependencies if we are not careful.</p><p>A similar situation manifests in the world of microservices. If you build or maintain a sufficiently large list of services, be it as microservices or any other flavor of service-oriented architecture, chances are you are familiar with such multi-level dependency chains across services in your product.</p><p>If npm dependencies looked difficult, consider that microservice dependencies bring in all the challenges of distributed computing. Abstracted from the software package dependency world, the idea of dependency hell can be catastrophic when coupled with the <a href="http://www.rgoarchitects.com/Files/fallacies.pdf">costs of distributed computing</a>.</p><h4>Not stepping on the traps</h4><p>While I was reading up about building reliable and scalable microservices stack at Postman, I came across the term, “dependency hell” from this great talk from Michael Bryzek, co-founder and ex-CTO of Gilt, titled “<a href="https://www.infoq.com/presentations/microservices-dependencies"><em>Microservices and the Art of Taming the Dependency Hell Monster</em></a>”. Bryzek talks of how they build processes to ensure that Gilt can be free of unwanted costs while accommodating operations at scale.</p><p>Since then I have talked extensively about microservice practices at our internal tech-talks, at different conference panels and in customer conversations.</p><p>A recurring theme I have seen companies new to microservices face is the propensity to have strong coupling among services. This is something that we faced as well, as I mentioned in the first part of the series. This can be either as services sharing common data stores, or services strongly depending on some core/central service, or, the more elusive variant, domain logic spilling over service boundaries.</p><p>Ben Christensen aptly termed it a “<a href="https://www.youtube.com/watch?v=-czp0Y4Z36Y">distributed monolith</a>”. When built without careful considerations about bounded contexts, clearly defined service boundaries or isolated data stores, a microservice-based system emulates all the characteristics of a monolith; except now it also has added costs of distributed computing.</p><p>Microservices don’t have any industry consensus and as Sam Newman puts it, it is just an opinionated way of building a service-oriented architecture. Given all these challenges that come with building a reasonable sized microservices stack, I am often asked why we chose to take this route with Postman at all and how did we manage to do it.</p><h3>Microservices at Postman</h3><p>We started building out our backend services back in 2014. There were four of us at that time — 3 of the co-founders of Postman and our VP of Engineering. Postman was already popular enough at that time. We had 650K users, across almost every country in the world.</p><p>Microservices were the blockchain of 2014. Everyone was doing it. We wanted to build out a stack that can support the growing demand of this growing community. Despite the pitfalls that we understood at that point, we decided to adopt the microservices model. There were enough literature and case-studies available for us to have enough research materials to base our decision on.</p><h4>Benefits and cost</h4><blockquote>“The complexity of system design shifted to the complexity of managing interconnection between services.”</blockquote><p>The benefits of microservices appealed to the engineers in us who loved abstractions and forward thinking architectures. My understanding of the benefits of choosing microservices was strongly influenced by Martin Fowler’s document on “<a href="https://martinfowler.com/articles/microservice-trade-offs.html"><em>Microservice Trade-Offs</em></a><em>”. </em>The three benefits that the document talks about resonated strongly with our situation:</p><ul><li><strong>Strong modular boundaries:</strong> The practice and ability to modularly group logic by functions into services meant we could build software where modules could be decoupled from each other. The service boundaries would also ensure that engineers did not need to have a detailed idea of the whole system. They can focus only on the parts of the system that they have expertise in. We saw this an essential aspect to ensure our teams can grow and still work in cohesion.</li><li><strong>Independent deployments: </strong>We wanted to implement high-quality continuous delivery practices. Compared to complex monoliths, simple and autonomous services make it easier to build delivery automation pipelines. These services, if architected properly, can be deployed independently of each other. This helps in reducing the time taken to fix critical bugs.</li><li><strong>Technological diversity:</strong> Independent services allow us to mix and match and use programming languages, tools, and frameworks that best suit each service, leading to a richer, polyglot technology stack.</li></ul><p>As we started building with these benefits in mind, we soon saw the costs creep in; the same costs that are mentioned in Microservice Trade-Offs:</p><ul><li><strong>Distribution:</strong> Orchestration of other services was now being done by certain “core” services, they pretty much became “core” because they existed before the other services, not because it should have been their responsibility.</li><li><strong>Eventual Consistency:</strong> Microservices introduced eventual consistency issues because of the insistence on decentralized data management. This showed up when multiple resources needed to update for a single business action to take place and everyone had to be consistently aware of resource transactions across services. This fed into the problem of context and hiring, only people with more context (which could be attained literally by having been there) were able to further build the systems and debug problems.</li><li><strong>Operational Complexity:</strong> Over time, we had built 20+ services with 5 primary developers and no developer operations. Each developer had to be aware of the existence of other services and be very careful of deployments at a particular time in the day or the week. The complexity of system design shifted to the complexity of managing interconnection between services.</li></ul><h3>The Decision Quagmire</h3><p>Post Workspaces, I thought more about this quagmire of dependency hell we found ourselves in, I realized a part of the problem boiled down to the many decisions that we needed to make in a microservices architecture.</p><blockquote>“I created a (rather-long) list of all the key decisions we were making for each microservice and kept it on my desk.”</blockquote><p>Here is the thing about humans when it comes to making decisions: We are simply <a href="https://www.quantamagazine.org/the-neuroscience-behind-bad-decisions-20160823/">not good at decision making</a> without a proper guide to drive those decisions. In the absence of a consistent framework, decisions made even by the same people in the same situation over time may be slight, if not distinctly, different.</p><p>These challenges are less prominent when building a monolithic system. You would usually make one or two major choices in a year. You would have one technology stack with, maybe, one type of persistence store.</p><p>But, when it comes to microservices, we have to make every decision from scratch, for each microservice, which can be very exhausting for a team, as we had soon realized. Over a period of time, we would end up with different decisions in similar situations, which brought in a whole lot of inconsistencies.</p><p>To handle the decision-making process, I created a (rather long) list of all the key decisions we were making for each microservice and kept it on my desk. The following chart is a subset of that decision tree, in no particular order:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4NNv_uJ1-jNCKz4BOzI8A@2x.png" /><figcaption>Decisions taken for each microservice.</figcaption></figure><h3>Organizational restructuring</h3><blockquote>“Given the way our organization was structured, we cannot achieve a sustainable technical architecture without isomorphically considering and fixing the organizational structure around it.”</blockquote><p>Our developer advocate, Paul, has previously written about <a href="https://medium.com/postman-engineering/how-to-dissolve-communication-barriers-in-your-api-development-organization-3347179b4ecc">Conway’s Law and Inverse Conway Maneuver</a>. That article draws direct influence from how the Postman team dealt with the organization challenges of building the microservices stack.</p><p>Looking through that lens, we soon realized that given the way our organization was structured back then, we cannot achieve a sustainable technical architecture without isomorphically considering and fixing the organizational structure around it. So, we sat down to rethink how we can do things better.</p><p>After much deliberation, keeping in mind our current constraints and how we got there, we came up with the following:</p><h4>Product — Service — Platform</h4><ul><li><strong>Products</strong>, by definition, are what our end-consumers directly interact with.</li><li>Products are built on <strong>Services</strong>.</li><li>Services interface with the Products and with each other.</li><li>Services are built on <strong>Platform</strong> components that are created and administered by the Platforms team.</li></ul><h4>Modified organizational structure</h4><p><strong>Product:</strong></p><ul><li><strong>Core:</strong> Improving the performance, stability and long-term roadmap of the app — core request sending flow.</li><li><strong>Cloud:</strong> Focused on executing Cloud features.</li><li><strong>Enterprise:</strong> Focused on features for Enterprise users.</li><li><strong>Growth:</strong> Focused on Growth, designed for quick iteration, A/B testing, fail fast, learn and iterate.</li><li><strong>Ops:</strong> Focused on building systems that help the rest of the product team build and iterate quickly.</li></ul><p><strong>Platforms:</strong></p><ul><li><strong>Infrastructure</strong></li><li><strong>Data</strong></li><li><strong>Security</strong></li></ul><p><strong>Services:</strong></p><ul><li><strong>Core Services</strong></li><li><strong>Cloud Services</strong></li></ul><h3>Leveling Up as an Organization</h3><p>With these in place, we identified the following goals for the Engineering function to adapt to <a href="https://talkery.io/talks/-PXi_7Ld5kU">Level Up</a>:</p><ol><li>Define the processes that allow products and services to become efficient, autonomous and of a high quality.</li><li>Through Platforms, create a shared infrastructure that supports microservice developers and outlines clear guidelines for introducing new services.</li><li>Use tools like SLAs (more on that later) to be explicit about the expectation of the producers and consumers of these services will allow each team to move forward independently.</li><li>Align individual growth and company goals through clear ownership and accountability.</li></ol><p>With the Inverse Conway Maneuver in our heads and thoughts of an organization design brewing, I dusted off my old copy of <em>“</em><a href="https://samnewman.io/books/building_microservices/"><em>Building Microservices</em></a><em>”. </em>The Principles of Microservices that Sam Newman lays down in the book has served as a guiding principle for all the decisions we made to get out of the aforementioned Dependency Hell.</p><p>Under this new work-in-progress org structure, we decided to bucket responsibilities for each of the above under the Services and Platforms teams.</p><p><strong>Services:</strong></p><ol><li>Modeled around Business Domain</li><li>Hide Implementation Details</li><li>Deploying Independently</li></ol><p><strong>Platforms:</strong></p><ol><li>Culture of Automation</li><li>Decentralize all the Things</li><li>Isolate Failure</li><li>Highly Observable</li></ol><h4>Consumer Driven Contracts at Postman</h4><p>As part of implementing everything that Principles of Microservices talks about, we found that consumer-driven contracts were one of the biggest drivers in conquering our dependency hell. I recommend reading the article on doing <a href="https://medium.com/postman-engineering/consumer-driven-contract-testing-using-postman-f3580dba5370">Consumer-driven contract testing using Postman</a> to get more idea on that topic.</p><p>I think of Consumer-driven contracts as the representation of the consumer’s understanding of your API and a mapping of their consumption behavior. Once the designed API is shared with the consumers, the consumers define their contracts. These contracts are reviewed by the API designer and upon approval added to the list of contracts to be executed.</p><p>We execute contracts in 3 scenarios:</p><ol><li>Execution of a CI/CD pipeline: Newman and Docker Container</li><li>Deployment event: On beta and staging environments. This includes serverless setups and Postman Monitors along with cloud APIs</li><li>Periodic monitors: Running contract tests on monitors once a day to test for contract breakage over time.</li></ol><p>This is how we built our whole strategy on conquering microservice dependency hell. I talked about the decision components that we put into action. In the next and final installment of this series, I will discuss how we work as a team right now and how we are implementing a growth framework and climbing up the ladder of service maturity model.</p><p>In the end, conquering dependency hell is as much about the people as it is about the software they build.</p><h4>Notes</h4><ul><li>We use NodeJS heavily at Postman — in our services and in our apps. The way our engineering team manages package dependencies and ensures no vulnerabilities creep in, deserves a long technical piece of its own.\</li></ul><h3>In this series:</h3><ul><li><a href="http://Conquering the Microservices Dependency Hell at Postman, with Postman (Part 1 — Introduction)"><em>“Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 1 — Introduction)”</em></a></li><li><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-3-f1506e59dcb8"><em>“Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 3)”</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c825d576947" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-2-7c825d576947">Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 2)</a> was originally published in <a href="https://medium.com/better-practices">Better Practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conquering the Microservices Dependency Hell at Postman, with Postman (Part 1 — Introduction)]]></title>
            <link>https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-1-introduction-a1ae019bb934?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1ae019bb934</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[company-culture]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Thu, 11 Oct 2018 16:54:08 GMT</pubDate>
            <atom:updated>2019-02-13T08:11:27.197Z</atom:updated>
            <content:encoded><![CDATA[<h3>Conquering the Microservices Dependency Hell at Postman, with Postman (Part 1 — Introduction)</h3><p>At Postman, we have been scaling our teams to meet the requirements of building and managing services for more than 5 million developers worldwide. Postman has grown rapidly as a product and as an organisation since the company was founded in 2014. Today Postman is a <a href="https://medium.com/postman-engineering/api-first-software-development-for-modern-organizations-fdbfba9a66d3">complete API Development Environment</a> with tools for every stage of the API Lifecycle. Our efforts have been focused on helping teams build better software together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0kXbO8WMKCH387YA" /><figcaption>Photo by <a href="https://unsplash.com/@alvaroreyes?utm_source=medium&amp;utm_medium=referral">Alvaro Reyes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Through a series of articles, I’ll talk about how we chose a microservices architecture when we started developing a backend system to complement our rather popular app. This introduction piece sets the stage by describing the technical and organizational challenges we faced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPODkXnBYlLGARaqz1iP1A.png" /><figcaption>Real-world microservices end up having multiple levels of dependencies.</figcaption></figure><h4><strong>Early 2018: Workspaces release</strong></h4><p>We shipped <a href="https://learning.getpostman.com/docs/postman/workspaces/intro_to_workspaces/">Workspaces</a> earlier this year with Postman 6.0. Workspaces form the base of collaboration in Postman. They are the logical blocks that hold collections, environments, monitors, mock servers and integrations that can be shared with others. Shipping workspaces was a big achievement from an organisational perspective. We managed to release it in a record time of 3 months. It was a feature that touched all of our products as well as about 20 micro-services that we ran internally at the time. It was a mammoth effort.</p><blockquote>It was amazing to see the whole team come together and be that passionate and invested about the product.</blockquote><p>During the development of workspaces, we started making heavy use of <a href="http://www.martinfowler.com/articles/consumerDrivenContracts.html">consumer-driven contracts</a>, which I will talk in detail in the next installment of this series. Along with that, we used <a href="https://medium.com/postman-engineering/https-medium-com-postman-engineering-fake-it-till-you-make-it-mocks-for-agile-development-f4d050cad694">Mock Servers to parallelize development</a> which helped our teams to make progress without blocking each other.</p><p>It was amazing to see the whole team come together and be that passionate and invested about the product. The Postman community responded warmly about workspaces. We received much constructive feedback on our <a href="https://community.getpostman.com/">community forum</a> and <a href="https://github.com/postmanlabs/postman-app-support/issues">GitHub issue queue</a> which helped us to continuously improve the feature.</p><p>Though we were all thrilled with the adrenaline rush from delivering workspaces to production, it had its burnouts. The early team, those responsible for driving the product direction, which includes me, spent a good amount of planning and executing every small detail of this feature. We wanted to make sure that we did not leave any part of the workflow undecided. It had to be as perfect as possible. Our engineers and designers worked through the holidays to push for the release. While things looked good on the product front, there was a reasonable amount of frustration from the resulting overwork.</p><p>In retrospect, this affected us both technically and organizationally.</p><h4><strong>Technical challenges</strong></h4><p>There were strong coupling between the services that we built. We had some core services on which other services depended heavily. Any downtime in one of these core services would bring down the entire infrastructure.</p><blockquote>Without a proper guideline in place, developers would follow their own styles to define APIs</blockquote><p>We had to take extra precaution to ensure these services had as much uptime as possible. This meant 3 AM fixes to the infrastructure and weekend struggles to resume broken services. We could not deploy services independently. All the services with dependencies had to be tested together on beta. If the tests passed, we had to deploy them together to production. Addressing issues often involved applying fixes across more than one service.</p><p>The coupling affected roadmaps of these services. Roadmap items had intertwined dependencies across services. This tied the evolution of one service to the progress of the ones it depended upon. We had database schemas that were shared across services, making it difficult to build something in one service without impacting the service it depended upon. Abstractions were not always clearly defined and leaked across service boundaries.</p><p>Though we ensured that our internal APIs had similar structures, some inconsistencies still crept in. Without a proper guideline in place, developers would follow their own styles to define APIs, leading to minor but nagging differences in request and response data structures.</p><p>One of the main reasons for this was <em>the lack of clearly defined service boundaries</em>. Our dev team would build out new services arbitrarily whenever there was an addition or change to business requirements. On one hand, this led to more new services than what we probably needed. On the other hand, a developer familiar with a specific code repository would add core functionalities directly in an existing service, which otherwise should have been a separate service entirely.</p><h4><strong>Organisational challenges</strong></h4><p>The organisational challenges reflected the technical challenges. Most of our early hires and the founding team, who were roughly 20% of the total team size, would end up doing about 80% of the work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*gLxgCth6qoPSE4-ff6N60w.png" /><figcaption>Organizational structure and knowledge-sharing practices till early this year had resulted in big discrepancy in the amount of work shipped by older members vs new hires.</figcaption></figure><p>This was just by virtue of them having the context of how the team worked and how the systems were built. The knowledge base was in their heads. Newer hires would not have full context into how all the systems fit together back then and would focus more on the non-core elements, or would take a long ramp-up time to contribute more effectively.</p><p>This led us to have misleading expectations from candidates when it came to hiring. Ignoring the cost, we struggled to find candidates who could join such a team and be capable of pushing microservices to production. We expected them to create new services, manage existing ones and improve the velocity at which those services were deployed. Not realising that anyone coming in may not have such a breadth of experience and depth of understanding about how Postman works, we were not able to add any new member to our backend team in the second half of 2017, even though we were actively hiring.</p><p>Development cycles kept getting slower around that time owing to these gaps in requirements, team capability and organisation structure. The reason we managed to pull off workspace release was that it was a concerted, top-down, organisation wide initiative. Having a committed team who were passionate about delivering a high-quality product helped the case. Yet, developers had to put in extra effort in subsequent release cycles to make sure they catch any bugs from previous release cycles. Our teams continued to work in the ad-hoc manner that they had done till then. This slowed down releases and reduced code quality.</p><p>This situation may be familiar to you if you have built software together in lean environments. We hear a lot around the challenges startups face in the tech industry when it comes to making architectural decisions about their products. We found that we had to do changes in our internal tech practices as well as rethink our organization structure to mitigate these issues.</p><p>Over the next articles in this series, I’ll touch upon the position of “Dependency Hell” in microservices that we found ourselves in at the beginning of the year, and the steps we took to claw our way out it.</p><p>Stay tuned!</p><h3>In this series:</h3><ul><li><em>“</em><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-2-7c825d576947"><em>Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 2)</em></a><em>”</em></li><li><a href="https://medium.com/postman-engineering/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-3-f1506e59dcb8"><em>“Conquering the Microservices Dependency Hell at Postman, with Postman — (Part 3)”</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1ae019bb934" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-practices/conquering-the-microservices-dependency-hell-at-postman-with-postman-part-1-introduction-a1ae019bb934">Conquering the Microservices Dependency Hell at Postman, with Postman (Part 1 — Introduction)</a> was originally published in <a href="https://medium.com/better-practices">Better Practices</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Daily Mix” with Postman Monitors and Spotify]]></title>
            <link>https://medium.com/the-restful-web/daily-mix-with-postman-monitors-and-spotify-3a020185ffec?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a020185ffec</guid>
            <category><![CDATA[spotify]]></category>
            <category><![CDATA[collection]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Wed, 29 Mar 2017 13:10:04 GMT</pubDate>
            <atom:updated>2017-03-29T15:28:08.729Z</atom:updated>
            <content:encoded><![CDATA[<p>This continues from my previous post, <a href="http://blog.getpostman.com/2016/11/09/generate-spotify-playlists-using-a-postman-collection/">Music Discovery with Spotify and Postman</a> and concludes the series <a href="http://blog.getpostman.com/2016/03/23/conditional-workflows-in-postman/">Conditional Workflows in Postman</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypijdzmFs4YsZvQv_ZHhlw.png" /></figure><p>We last learnt how to make a collection that generates a playlist with music from your favorite artists using the Spotify API. We then ran the collection in the <a href="http://getpostman.com/apps">Postman App</a> and <a href="https://www.npmjs.org/package/newman">Newman</a>.</p><p>Today, we’re going to take this one step forward and emulate 2 awesome Spotify features for music discovery — <a href="https://www.spotify.com/int/discoverweekly/">Discover Weekly</a> and <a href="https://news.spotify.com/us/2016/09/27/rediscover-your-favorite-music-with-daily-mix/">Daily Mix</a>. And we’ll use 2 new features in the <a href="https://blog.getpostman.com/2016/12/15/introducing-postman-pro/">Postman Pro</a> arsenal to do this — <a href="https://monitor.getpostman.com/">Postman Monitors</a> and the <a href="https://api.getpostman.com/">Postman Pro API</a>.</p><p><a href="https://monitor.getpostman.com/">Postman Monitors</a>, launched in January 2017, lets you check for the performance, uptime and correctness of your API. It’s built on <a href="https://www.getpostman.com/docs/collections">Postman Collections</a> running on the cloud on a specified schedule.</p><p>The <a href="https://api.getpostman.com/">Postman Pro API</a> exposes several endpoints to help you integrate Postman more deeply with your development toolchain. Using the API, you can create and update collections and environments, and run monitors, simultaneously syncing each action with your Postman app. All new features (e.g. <a href="https://blog.getpostman.com/2017/03/16/simulate-a-back-end-with-postmans-mock-service/">Postman Mock Service</a>) will be launched first via the API before making their way into the app.</p><p>As you would have guessed by now, we’ll use Postman Monitors to run our simple yet effective music discovery collections once a day (or week) on the cloud.</p><p>Quickly jotting down the workflow:</p><p>1. Add a new request to our collection which <a href="https://api.getpostman.com/#e0d6-3bc3-3da5-ab57-7a578a8504ce">updates the environment</a> at the end of the run using the Postman Pro API. This allows us to emulate the Persist Variables feature in the app.<br>2. Create a monitor with the updated collection and environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E91Sxq9KMjPRKyqFNEILLA.png" /><figcaption>This is what the updated workflow looks like</figcaption></figure><p>You can check out the documentation for the collection <a href="https://documenter.getpostman.com/view/583/spotify-playlist-generator-v2/2Mssx3">here</a> and download the collection <a href="https://app.getpostman.com/run-collection/6f54f4707924fc930d6e#?env%5BSpotifyGenV1.template%5D=W3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoiYXJ0aXN0cyIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6Ik4iLCJ2YWx1ZSI6IjUiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoidXNlcl9pZCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6ImNvdW50cnlfY29kZSIsInZhbHVlIjoiVVMiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X2lkIiwidmFsdWUiOiIiLCJ0eXBlIjoidGV4dCJ9LHsiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY2xpZW50X3NlY3JldCIsInZhbHVlIjoiIiwidHlwZSI6InRleHQifSx7ImVuYWJsZWQiOnRydWUsImtleSI6InJlZnJlc2hfdG9rZW4iLCJ2YWx1ZSI6IiIsInR5cGUiOiJ0ZXh0In1d">here</a></p><h3>Create the Monitor</h3><p>1. First, make sure you run the collection in the app with the new environment template. You’ll have to set up the environment as explained in the <a href="https://restful.io/music-discovery-with-spotify-and-postman-d230da418db7#.10724v4i0">previous post</a>.<br>2. Now head to <a href="https://monitor.getpostman.com/">Postman Monitors</a>. If you’re not already on Postman Pro, you can start a free trial.<br>3. Create a new monitor selecting the downloaded collection and environment template. In the screenshot, I’ve set it to run every morning at 9AM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K6GmqaMw1V84Y6IH1JBSeQ.png" /></figure><p>4. Go to the details view, and you’ll see this screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIX5XyO7FHDtmvV3Z1AL1g.png" /></figure><p>5. Click on the Run Now button (next to Edit Monitor) to check if everything works fine.<br>6. Finally, after a few manual or scheduled runs, your monitor results should look something like this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*asvySgFoZUa2B0H7MNudSA.png" /></figure><p>Since we’re using the Postman Pro API to update the environment in the final request, we constantly expand our list of artists as shown below. Personally, I have discovered entirely new and obscure genres using this monitor!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSyS9umY3N2AJM3fE3soZg.jpeg" /></figure><p><em>I hope you found this series to be useful and an insight into the hard work we’re putting into making Postman Pro the most comprehensive toolchain for API developers. Stay tuned for similarly fun use cases of the Postman ecosystem.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a020185ffec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-restful-web/daily-mix-with-postman-monitors-and-spotify-3a020185ffec">“Daily Mix” with Postman Monitors and Spotify</a> was originally published in <a href="https://medium.com/the-restful-web">The RESTful Web</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Music Discovery with Spotify and Postman]]></title>
            <link>https://medium.com/the-restful-web/music-discovery-with-spotify-and-postman-d230da418db7?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d230da418db7</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[spotify]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[oauth]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Sun, 04 Dec 2016 13:26:13 GMT</pubDate>
            <atom:updated>2016-12-04T13:26:13.895Z</atom:updated>
            <content:encoded><![CDATA[<p>This continues from my previous post in the series <a href="http://medium.com/@sobtiankit/conditional-workflows-in-postman-f79c05306671">Conditional Workflows in Postman</a>. We will continue to focus on Postman Collections and elaborate on <a href="http://blog.getpostman.com/2016/06/14/introducing-postman-runtime-more-power-better-control/">Postman Runtime</a>.</p><p>Today, we are going to create our own on-demand playlist using the <a href="https://developer.spotify.com/web-api/">Spotify API</a> and Postman Collections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ZKv0hmvTob7nfTMIqfe3A.png" /></figure><p>I love <a href="http://www.spotify.com/">Spotify</a>. Over the years it has helped me discover great music. Discover Weekly, in particular, has made me look forward to Monday mornings, with some amazing curated music delivered to the app. Usually, when I come across a great new artist, I look for their top songs and when a bit more adventurous, check out the related artists and repeat the process. Quickly jotting this down into a workflow:</p><p>1. Choose the artist(s) that you like.<br>2. Randomly choose one (let’s say The Who) from the list and GET the meta information using Spotify API<br>3. Get artists related to The Who and choose a random 5<br>4. Create a playlist named “The Who Mix”<br>5. GET the most popular songs from The Who, choose a random 5 and add to the playlist<br>6. For each related artist, do the same</p><p>And that’s it! We get a brand new playlist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8HfAvc-EXj6oNQsZ2SzKg.png" /></figure><p>Click the Run in Postman button below to get the Collection and Environment in your <a href="https://www.getpostman.com/apps">Postman app</a>.</p><p>You can check out the documentation for the collection <a href="https://documenter.getpostman.com/view/583/spotify-playlist-generator-v1/2MtDWP">here</a> and download the collection <a href="https://app.getpostman.com/run-collection/e0d1cf95318b625a6a6b#?env%5BSpotifyGenV1.template%5D=W3sidHlwZSI6InRleHQiLCJlbmFibGVkIjp0cnVlLCJrZXkiOiJhcnRpc3RzIiwidmFsdWUiOiIifSx7InR5cGUiOiJ0ZXh0IiwiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiTiIsInZhbHVlIjoiNSJ9LHsidHlwZSI6InRleHQiLCJlbmFibGVkIjp0cnVlLCJrZXkiOiJ1c2VyX2lkIiwidmFsdWUiOiIifSx7InR5cGUiOiJ0ZXh0IiwiZW5hYmxlZCI6dHJ1ZSwia2V5IjoiY291bnRyeV9jb2RlIiwidmFsdWUiOiJVUyJ9LHsidHlwZSI6InRleHQiLCJlbmFibGVkIjp0cnVlLCJrZXkiOiJjbGllbnRfaWQiLCJ2YWx1ZSI6IiJ9LHsidHlwZSI6InRleHQiLCJlbmFibGVkIjp0cnVlLCJrZXkiOiJjbGllbnRfc2VjcmV0IiwidmFsdWUiOiIifSx7InR5cGUiOiJ0ZXh0IiwiZW5hYmxlZCI6dHJ1ZSwia2V5IjoicmVmcmVzaF90b2tlbiIsInZhbHVlIjoiIn1d">here</a>:</p><h4><strong>Setup the Environment</strong></h4><ol><li><strong>Spotify</strong></li></ol><p>a. Head to <a href="https://developer.spotify.com/">Spotify Developer</a> and register, then create a new app in the My Applications section. Add the `client_id` and `client_secret` to your environment.<br>b. Under the newly created app config, add the following Redirect URI — “<a href="https://www.getpostman.com/oauth2/callback">https://www.getpostman.com/oauth2/callback</a>&quot;<br>c. We’ll use the <a href="https://developer.spotify.com/web-api/authorization-guide/#authorization-code-flow">Authorization Code Flow</a> to obtain the Refresh Token.<br>d. Open Postman, under a new request, click on the Authorization tab, select OAuth 2.0 and fill in these values:</p><blockquote>Token Name: can be anything<br>Auth URL: <a href="https://accounts.spotify.com/authorize">https://accounts.spotify.com/authorize</a><br>Access Token URL: <a href="https://accounts.spotify.com/api/token">https://accounts.spotify.com/api/token</a><br>Client ID: {{client_id}}<br>Client Secret: {{client_secret}}<br>Scope: playlist-read-private playlist-modify-private<br>Grant Type: Authorization Code<br>Request access token locally: Checked</blockquote><p>Click on Request Token, go through the OAuth flow, and add the <em>refresh_token</em> to your environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*fcl4gxs9BaGb9AkmuEdvAA.png" /></figure><p><strong>2. Environment Config</strong><br> <br>Set the following variables in your environment<br>a. <em>user_id</em>: your spotify username<br>b. <em>country_code</em>: in <a href="http://en.wikipedia.org/wiki/ISO3166-1alpha-2">ISO 3166–1</a> format<br>c. <em>N</em>: defaults to 5. Refer to the algorithm section for more details<br>d. <em>artists</em>: List of seed artists for the collection. You can find them as part of the Spotify artist link (Available in the app): e.g. for Oasis, the link looks something like <a href="https://open.spotify.com/artist/2DaxqgrOhkeH0fpeiQq2f4">https://open.spotify.com/artist/2DaxqgrOhkeH0fpeiQq2f4</a>, choose the last section. The artists variable needs to be set up as an array of strings, that is, with square brackets and double quotes. So it’ll look something like: [“2DaxqgrOhkeH0fpeiQq2f4”, “2ooIqOf4X2uz4mMptXCtie”]</p><p><strong>3. Run the Collection</strong></p><p>a. Now run the collection in the Postman app using the <a href="https://www.getpostman.com/docs/running_collections">Collection Runner</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*iZxTevv4KKGg6ZGHQ6HlpQ.png" /></figure><p>By keeping Persist Variables checked, the next time we run this collection, it will add the newly discovered Related Artists to the original seed and thus expanding the scope of discovery, each time we run this collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQpz6fb-FKpTQzII8qLyag.png" /></figure><p>b. The same collection executes in <a href="https://github.com/postmanlabs/newman">Newman</a> as well. Just export the Collection and Environment files and execute the following command</p><blockquote>newman -c SpotifyPLGen.json.postman_collection -e SpotifyPlGen.json.postman_environment</blockquote><p>In the final post of this series, we will schedule this collection to run every week for that true <em>Discover Weekly</em> experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d230da418db7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-restful-web/music-discovery-with-spotify-and-postman-d230da418db7">Music Discovery with Spotify and Postman</a> was originally published in <a href="https://medium.com/the-restful-web">The RESTful Web</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conditional Workflows in Postman]]></title>
            <link>https://medium.com/the-restful-web/conditional-workflows-in-postman-f79c05306671?source=rss-830241514cd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f79c05306671</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[postman]]></category>
            <dc:creator><![CDATA[Ankit Sobti]]></dc:creator>
            <pubDate>Tue, 22 Mar 2016 20:22:47 GMT</pubDate>
            <atom:updated>2016-03-22T23:58:24.111Z</atom:updated>
            <content:encoded><![CDATA[<p>There are some products available in the market to create and execute API workflows. However, most of them are limited by their linear, non-reactive execution. We knew we could create something much more effective and decided to add workflow support to Postman. Postman 4.0, in conjunction with <a href="https://www.npmjs.org/package/newman">Newman</a>, the command line companion, is now powerful enough to help you create and execute <a href="https://www.getpostman.com/docs/workflows">non-linear workflows in your Collections</a>!</p><p>This latest release builds upon our existing <a href="https://www.getpostman.com/docs/running_collections-1">Collection Runner</a>. It introduces a new function called <strong>postman.setNextRequest</strong>. As is evident from the name, you just need to specify the name of the subsequent request and the runner will take care of the rest. It has the following signature:</p><blockquote>postman.setNextRequest(“Request Name”);</blockquote><p>Let’s go over an example workflow so you can get a sense of how this works.</p><p>You might have met Postman’s <a href="https://www.getpostman.com/about-us">Chief Happiness Officer</a> earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BRoWIELn1ZidMI-grxKsVQ.jpeg" /></figure><p>This is Cooper. He’s one year old and eats three meals a day. He’s allowed to eat only six pre-approved food items. We store them in a database. Cooper is very picky. You can’t repeat an item on the same day unless you want to risk a tantrum. So I want to generate a random meal plan for him at the beginning of the week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*486RglVX9kPEfrSv2UOeug.png" /></figure><p><strong>The workflow:</strong></p><p>First makes the API call to GET the list of approved food for Cooper from the database.</p><p>Then it creates an entry for each day, 3 times a day, 7 days a week</p><p>All 3 meals in a single day have to be unique.</p><p>If the API call fails, poor Cooper goes hungry 😟</p><p>You can check out the documentation for the collection <a href="https://documenter.getpostman.com/view/583/coopers-meal-plan/4u2">here</a> and download the collection <a href="https://app.getpostman.com/run-collection/9be37cbbd4169d08573f#?env%5BCooper-Remote%5D=W3siZW5hYmxlZCI6dHJ1ZSwia2V5IjoidXJsIiwidHlwZSI6InRleHQiLCJ2YWx1ZSI6Imh0dHA6Ly8xNTkuMjAzLjIzMy4yMzc6MTMzNyJ9XQ==">here</a>:</p><p>In case you’re curious, I ran the collection and here’s what Cooper’s eating this week!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*Alhn3IUJDYwqfc4haVlteg.png" /></figure><p>In general, the postman.setNextRequest parameter is associated with the request and can be set in the pre-request or the test script. In case of more than one assignment, the last set value is considered. If postman.setNextRequest is absent, the runner defaults to the linear execution and moves to the next request. postman.setNextRequest(null) terminates execution.</p><p>I hope you find this useful. <strong>postman.setNextRequest</strong> is just the beginning and we will push out more APIs to easily create complex workflows in the coming quarters within Postman. Stay tuned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f79c05306671" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-restful-web/conditional-workflows-in-postman-f79c05306671">Conditional Workflows in Postman</a> was originally published in <a href="https://medium.com/the-restful-web">The RESTful Web</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>