<?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 Miguel Pinilla on Medium]]></title>
        <description><![CDATA[Stories by Miguel Pinilla on Medium]]></description>
        <link>https://medium.com/@jmpicnic?source=rss-76a7eb0b035b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aAASKKYEf88h1HjOmLxQ1Q.png</url>
            <title>Stories by Miguel Pinilla on Medium</title>
            <link>https://medium.com/@jmpicnic?source=rss-76a7eb0b035b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:39:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jmpicnic/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[The ROI of Supply Chain Technology Projects]]></title>
            <link>https://medium.com/salduba/the-roi-of-supply-chain-technology-projects-c92fbf857236?source=rss-76a7eb0b035b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c92fbf857236</guid>
            <category><![CDATA[investment]]></category>
            <category><![CDATA[supply-chain]]></category>
            <category><![CDATA[warehouse-automation]]></category>
            <dc:creator><![CDATA[Miguel Pinilla]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 23:58:03 GMT</pubDate>
            <atom:updated>2024-04-01T23:58:03.428Z</atom:updated>
            <content:encoded><![CDATA[<p>The last 10 years have seen unprecedented investment levels in supply chain and distribution capabilities. Giants in distribution and logistics have poured prodigious amounts of capital to compete in the race to support e-commerce fulfillment. As examples of this effort <a href="https://finbox.com/BIT:AMZN/explorer/capex/">Amazon</a>, <a href="https://finbox.com/NYSE:WMT/explorer/capex">Walmart</a> and <a href="https://finbox.com/NYSE:UPS/explorer/capex">UPS</a> alone total around $300 Billion dollars in capital expenditures over the last five years, which although not all of them are dedicated to their supply chain, a substantial portion is.</p><p>Customer expectations in e-commerce are summarized in two sound bites that we have used in the past. <em>The Tyranny of Now</em> and <em>The Infinite Shelf</em> that capture the value that customers put on ever shortening <em>click-to-door</em> times and the availability of any product one can ever look for. At the same time, the same customers show little or no tolerance for mis-shipped goods or incomplete deliveries, ready to jump to a competitor at the first sign mis-hap.</p><p>Customers’ <em>Tyranny of Now</em> and <em>Infinite Shelf</em> expectations affect not only fulfillment centers as the edge of distribution chains, but are increasingly felt by upstream distribution, wholesale and origin facilities as the overall <em>product-to-market</em> time shrinks and the variety of products offered by each provider grows.</p><p>The pressure to perform is qualitatively altering the way supply chain operations are designed and measured. <em>Throughput</em> of a facility and its <em>Cost per shipped unit</em> where traditionally the main performance metrics for logistics operations. In the new conditions, optimization must focus on <em>order lead time</em> and <em>fulfillment accuracy</em> metrics. The ROI calculations were almost exclusively based on reducing the Operational Cost or increasing the volume for a given cost or capital investment (e.g. in buildings). Now the calculation needs to be much more sophisticated because returns are the driven by customer retention or satisfaction. These are hard to relate to operational practices. The most common operational metrics to use as proxies measure lead time SLA, e.g. the P95 time to ship and yield, e.g. percent of orders with a missing or incorrect item.</p><p>The calculation of the return on automation investments varies from case to case in modern logistics nodes. The first step is to decide what business goals the investment is attempting to achieve which can be classified along a few broad categories:</p><ul><li>Increased Productivity either as cost reduction or as an increase of output for the same facility and cost levels.</li><li>Increase or protect the revenue stream by increasing the accuracy and speed of shipments, or increasing the variety of products that a facility can handle.</li><li>Improve the operational capabilities in resilience, reliability, security, shrinkage reduction, etc.</li><li>Maintain or achieve compliance against industry specific regulations at an acceptable cost (e.g. Pharma, cold-chain, etc.)</li><li>Some other specific goals that sometimes are not explicitly discussed by decision making executives like reducing dependencies on specific suppliers, service or transportation providers, unions, …</li></ul><p>The last one, although very important and sometimes the overriding deciding factor, is very specific of the industry, jurisdiction and even company considering the investment and necessarily out of the scope of this article. We will dig into the others trying to provide some insight on how to go about evaluating them.</p><h3>Reducing Cost</h3><p>Cost reduction ROI evaluation has been widely taught in business schools and multiple books on warehouse or supply chain design, nevertheless it is useful to highlight some points that may be overlooked on a first pass.</p><p>A complete cost calculation for an operation will take into account variable and fixed operational costs as well as depreciation and capital costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*WauOwyUsdr0mV06QQ1qsZw.png" /></figure><p>With the variable cost in turn being an estimate of Unit Cost times the expected volume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/83/1*s0LykEuxSm-EdwZsoj_MXQ.png" /></figure><p>An Automation project will generally:</p><p>Decrease the unit cost <em>c_u</em>, typically by a reduction of the direct labor required to ship all the items in an order.</p><ol><li>Increase the fixed operational cost <em>C_f</em> as the cost of maintaining and running the automation equipment increases with maintenance staff, software licenses or subscriptions, etc which are mostly independent of the actual throughput or utilization of the facility.</li><li>Add depreciation costs for the investment</li><li>Increase the capital cost either through obvious financial cost if debt needs to be used, or the harder to estimate opportunity cost.</li></ol><p>The result is a non-trivial shift from variable costs to fixed or semi-fixed costs. Variable costs can be easily adjusted to varying volume requirements (e.g. seasonal, promotions, etc.). Fixed costs, with their associated inflexibility increase the operational risk of the facility and the company in the case of lower volumes than expected. ROI calculations should use tools to address uncertainty like scenario planning or Montecarlo simulations to inform decision makers. Simple calculations based on <em>best estimates</em> can be very dangerous if they are not qualified by the assumptions made in their inputs.</p><p>This problem is compounded by the way cost allocation is usually done, which ends up hiding these effects or at a minimum delaying information to decision makers as masterfully described in <a href="https://www.salduba.info/post/relevance-lost-by-h-thomas-johnson-and-robert-s-kaplan">Relevance Lost</a>.</p><p>When using the generally accepted <a href="https://www.investopedia.com/terms/a/absorptioncosting.asp">Absorption Costing</a> a <em>per unit</em> cost <em>c_a</em> is computed based on the expected volume <em>V^</em> for the facility or operation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*cSw7j0iX8S32HtjrMDOMoA.png" /></figure><p>and then reformulating the total cost as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*0N3Ew8t3nW-G-s_nnvRFfg.png" /></figure><p><em>C_abs</em> is the <em>Absorption Cost</em>. It is an accounting adjustment to capture the over or under allocation of cost when the actual volume is different than the estimated volume. If the difference is small, this adjustment is not material, but in current supply chains with hard to predict volumes and incidences, the adjustment may be significant. The problem is not the accuracy of the cost, because at the end of the day, a cost is a cost whether you account for it in one place or another, but the timing when this information is made available to decision makers. Variable costs can be collected and reported almost in real-time, but absorption costs are usually only computed at the end of each accounting period, when it is too late to make any adjustments, even if they were technically feasible. Reliance on the Absorption cost adjustment is even more dangerous because any change in volume results in a change in cost inversely proportional to the square of the volume (simple derivatives as described in the <a href="https://www.linkedin.com/posts/mpinilla_supplychain-automation-roi-activity-7178752650333585408--Dhi">Cost Accounting for Engineers</a> article), making it very sensitive to low volume or high variability operations.</p><p>Aside from the direct impact in the cost structure, automation systems also have much harder limits on the possible throughput for a given configuration. Increasing the capacity in manual or low automation situations is frequently just a matter of adding shifts or hiring additional operators with broad latitude on the limits to those changes. In more automated facilities increasing capacity beyond the design limits of the system is very difficult.</p><p>When deciding the level of investment, we need to take into account the variable and fixed costs of the proposed solution and what is their maximum throughput. It is convenient to render these considerations visually to gain intuition on the decisions to make.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/0*rDZRrplsfktAqGtM.png" /></figure><p>In the figure, the pink like represents the cost profile of a manual or low automation, the green line a medium automation solution and the blue one a hight automation solution. The bands of the corresponding colors signal the throughput ranges where each solution is preferred.</p><p>The vertical green and blue lines represent the maximum throughput that the automated options have.</p><p>Based purely on cost, the decision for the target volume in the example (green arrow) would be a Medium Automation system. Apart from cost we need to consider:</p><ol><li>What is the uncertainty on the estimation of the target volume including growth projections. If the uncertainty makes it cross the maximum throughput of the selected solution, or even the cost cross-over point with another solution, the actual design volume of the solution needs to be adjusted.</li><li>What are the limits on Capital expenditures for the project. Even if cost wise a high automation solution might be optimal, the capital availability, or put another way, the risk tolerance to large investments, may not afford it.</li><li>What is the expected variability of volumes in operation as it may have a big impact on the actual unit costs even if they are hidden by the practice of Absorption Costing. In the graph we see that for a given throughput, a high automation solution has a steeper curve than a medium or low automation option, indicating that it is much more sensitive to variability in volume.</li></ol><h3>Increase or Protect Revenue</h3><p>Customer fulfillment operations are extremely sensitive to customer satisfaction. Customers are always a click away from choosing a competitor if they don’t find exactly the product they are looking for, the delivery times are perceived as too long, or the delivered products are incorrect or damaged. These satisfaction drivers are very dependent on the SLA of the facility in terms of <em>order-to-ship</em> lead time and order accuracy.</p><p>Automation influences <em>order-to-ship</em> lead time in three critical ways:</p><ol><li>It increases the capacity of the facility when compared with manual operations, which for a given order throughput reduces congestion delays.</li><li>Automated equipment is less variable in its operations than people, reducing the overall variability of the <em>inventory-to-shipment</em> processes.</li><li>Automation and its integration into the order management systems enable <em>Waveless Fulfillment</em>. This is also possible in manual warehouses but harder to implement because the reaction times to changes of people is slower than automated equipment and it requires RF or Voice Picking implementations. Paper based warehouses need to operate in <em>Batch</em> mode due to the nature of printed pick and pack lists and instructions.</li></ol><p>The third effect is very important, but merits a separate article, which will be coming. If you are not afraid of more academic papers, I recommend looking at the seminal paper by <a href="https://dspace.mit.edu/handle/1721.1/63083">Bishop and Todd from MIT</a></p><h3>Increasing Capacity &amp; Productivity</h3><p>Congestion and Queuing delays are roughly inversely proportional to the <em>spare capacity</em> of a system. That means that lower utilizations result in dramatically smaller congestion delays. This is strictly true for the idealized <a href="https://en.wikipedia.org/wiki/M/M/1_queue">M/M/1 Processing queue</a>. For real systems, it frequently also holds directionally, with different multiplier factors ( <em>K</em> below), as they tend to have a defined bottleneck point. The delays due to queuing when compared to the <em>raw</em> lead time when the system only needs to handle one order (the queuing factor <em>QF</em>) is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/145/1*qkFGdC6R373w30WEklM-0A.png" /></figure><p>Companies try to operate their facilities at high utilizations, always higher than <em>80%</em> utilization to obtain a good return on assets. Utilizations above that threshold result in a very steep section of the congestion or queuing factor curve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*rDEC1x2vIYG_1PWY.png" /></figure><p>Any variability in utilization at those levels will cause big swings in congestion delays. By using automation to increase the capacity of a facility, we may move the utilization operating point to the left and reduce the sensitivity to changes resulting in more manageable queuing delays.</p><h3>Reducing Variability of fulfillment operations</h3><p>The curve shown above is drawn for the <a href="https://en.wikipedia.org/wiki/M/M/1_queue">M/M/1 Processing queue</a> as a simple representative of the overall shape of the utilization/congestion response. A bit more general model, the <a href="https://en.wikipedia.org/wiki/G/G/1_queue">G/G/1 Queue</a> can be approximated using <a href="https://en.wikipedia.org/wiki/Kingman%27s_formula">Kingman’s Formula</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*dFj72TwpCF_5-B2h86Ve8w.png" /></figure><p>Where \(c_a\) and \(c_s\) are the variability of order arrival and service (fulfillment) times respectively. The corresponding Congestion/Utilization response curves change with the variability of the fulfillment times:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/0*xO9m-2nuJWVT-yJU.png" /></figure><p>shows that reducing the variability of the fulfillment operations has a dramatic effect on congestion delays, with more pronounced impact at high utilizations. When SLA’s are expressed as a 95 or 99 percentile of orders fulfilled in a specific time frame, this impact of service times variability by itself may determine if a facility may achieve it or not.</p><h3>Improve Operational Capabilities</h3><p>Apart from the very direct goals of capacity, productivity and reduced variability, other operational capabilities have a sizable impact on the performance of a facility. We should not be deterred from considering them in the evaluation of investments because they maybe somewhat harder to measure or relate directly to the investment spend.</p><p>Shipping accuracy is a critical factor in the customer satisfaction and revenue and even faulty shipments that are caught before they are actually shipped have a very negative effect on the performance of a fulfillment center. The reasons for them include damaged product, inventory shorts, picking errors, incorrect dimensions, etc. Automation facilitates better inventory accuracy, is more consistent in picking operations and, by requiring more precise product data (dimensions) also eliminates errors. Sensor that are incorporated in automation equipment for its operation can also be used as data sources for early detection of problems (e.g. scales, bar code readers, etc…) creating a double benefit that is not directly accounted for in straight capacity or lead time measurements.</p><p>Security, Shrinkage and damage to inventory are also greatly improved by reducing the touchpoints between operators and product, which in turn results in better shipment yields.</p><p>Finally, the capacity of a well run and maintained automated facility is much more predictable than a manual one. Interruptions or degradation of operations because of absenteeism, strikes or even pandemics as the recent COVID-19 lock downs demonstrated are either avoided or mitigated in automated warehouses. Not only because they require less direct labor, but also because the jobs that are required to run it can sometimes be performed centrally or even remotely which expose workers to fewer hazards and strenuous situations.</p><h3>Support Industry Specific Compliance</h3><p>For certain industries, automation is no longer an optional investment if they want to meet regulatory requirements or do so at a reasonable cost. Industries like pharma that have stringent security, quality and tracking requirements are finding it increasingly difficult to remain compliant without introducing automation. Cold chain distribution is quickly becoming another example of <em>Functional Automation Requirements</em> where the justification for the investment is not a quantitative difference in the performance of a facility but a qualitative difference in its processes by reducing the exposure of workers to hostile conditions, minimizing the time outside refrigeration that inventory spends and being able to accurately track expiration dates, temperature profiles and history with handling unit precision, etc.</p><p>There are many other examples like hazardous material handling, high value serialized products, etc. each with their specialized requirements.</p><h3>Conclusion</h3><p>Investing in automation projects is an important decision for any company not only because of the size of the investment itself but also because it usually implies significant changes in its internal processes, skills required from its workforce, requirements on their data and information systems and material changes in their cost structures.</p><p>Understanding these impacts and quantifying them, even through estimates, should be a given as an input to decision makers. Cost reductions need to be evaluated against the trade-offs in flexibility and need for accurate growth estimates. Modern fulfillment operations have also a role to play in protecting and increasing revenue by supporting customer satisfaction with reduced lead times and increased order accuracy. Automation projects also support other capabilities of supply chains and are indispensable in certain highly regulated industries, all aspects to consider and weight when evaluating the investment.</p><p>The application and execution aspects of automation investments are critical to the ultimate results of these projects and we’ll address them in follow up articles. If you are interested in these, please subscribe to the <a href="https://www.linkedin.com/newsletters/7168774727367409664/">Supply Chain Essentials Newsletter</a> where they will be posted.</p><p><em>Originally published at </em><a href="https://jmpicnic.github.io/obsidian-docs/Projects/scac-technology/the-ROI-of-sc-technology-projects/ROI/"><em>https://jmpicnic.github.io</em></a><em> also with better math typesetting.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c92fbf857236" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salduba/the-roi-of-supply-chain-technology-projects-c92fbf857236">The ROI of Supply Chain Technology Projects</a> was originally published in <a href="https://medium.com/salduba">salduba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Oriented Salad: Entities, Instances, Identity, Data Records, Objects…]]></title>
            <link>https://medium.com/salduba/object-oriented-salad-entities-instances-identity-data-records-objects-37c417804cfc?source=rss-76a7eb0b035b------2</link>
            <guid isPermaLink="false">https://medium.com/p/37c417804cfc</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[object-oriented]]></category>
            <dc:creator><![CDATA[Miguel Pinilla]]></dc:creator>
            <pubDate>Tue, 25 May 2021 05:29:04 GMT</pubDate>
            <atom:updated>2023-02-28T23:40:37.460Z</atom:updated>
            <content:encoded><![CDATA[<h3>The mirage of Object Oriented Enterprise systems</h3><p>In Enterprise Software Development the concept of and “Entity” is an essential one that helps structure and understand the system. Its origins are in the <em>Entity</em> of Entity-Relationship-Diagrams and got really popular in the Java Enterprise world with the emergence of ORM’s and JPA. It is also a very convenient concept that aligns nicely with the concept of an Object in Object Oriented Programming.</p><p>During the time of J2EE dominance in enterprise architectures, “Entities” had a very well defined structure and mapping to the different technologies used to implement them. Typically, having a triple 1:1 correspondence for Entity definitions, instances/identities and collections of instances:</p><ul><li>For Entity Definitions:</li></ul><blockquote>Programming Language Class ← → DB Table Definition ← → ORM Mapping</blockquote><ul><li>For Entity Instances:</li></ul><blockquote>Object (Pojo)/Object Reference ← → DB row/Primary Key ← → Object in the ORM Session/Cache</blockquote><ul><li>For Entity Collections:</li></ul><blockquote>Objects of a Class in a VM (although not accessible as a set) ← → DB Table ← → DAO in the persistence layer</blockquote><p>In a general way, this correspondence holds for most of the ORM’s out there: JPA, Hibernate, SpringData, RoR Active Records, … and has also been extended to non relational databases like MongoDB, replacing the row with a document and the table with a collection.</p><p>The success of this design pattern has led in practice to blurring the separation between the conceptual design of entities with the implementation mechanisms that are used in theses traditional <em>WebApp</em><strong><em> </em></strong>architectures.</p><p>Modern architectures are now based on µ-services, with distribution of not only computing power, but also of the state of the system in multiple data stores. In these architectures, the correspondence between programming language, storage and access/querying comes unglued and needs to be reworked. Furthermore, the nice abstraction layer of a population of entity instances that is transparently accessible no longer holds. In particular:</p><ol><li>The address space of Entity Instances is not flat and it is partitioned in multiple “API Endpoints”, each of them holding a sub-set of the population of instances.</li><li>An Entity definition does not correspond to a Programming language class because each separate micro service may be implemented in a different programming language, or, even if they share a programming language, they may not share the same code libraries as they may be implemented by different teams at different times (versions).</li><li>Links between Entity Instances lose their referential transparency, forcing the application developers to explicitly define when an Entity contains another entity “by Value” or contains a reference to that other entity that needs to be explicitly retrieved if additional information or field values are needed.</li><li>Querying the population of entities is no longer possible using a high level query language (e.g. like DAO patterns) because those entities maybe spread over a number of heterogeneous storage systems and joins are not possible to resolve references.</li></ol><p>Apart from these functional differences, distributed systems exhibit failure modes and exception behaviors that are much more complex than traditional WebbApps and don’t have a clean “commit/rollback” semantics.</p><p>Despite these challenges, distributed µ-service based systems promise big advantages of scalability and resilience not only on the computing, runtime aspects, but also on the Software Engineering aspects of our trade by reducing the coupling between teams and making the systems themselves more modular. This comes at a price though of having to re-think how this Entity Oriented systems look like in a truly distributed environment.</p><h3>Breaking the illusion</h3><p>Some early distributed systems, notably CORBA, tried to replicate the object oriented model directly in distributed environments, but they did not succeed in achieving widespread acceptance, probably because of the difficulty to offer a consistent <em>non-leaky</em><strong><em> </em></strong>abstraction layer for application developers. Current systems are more modest in their goals and offer only some variation of RPC communication for request/response interaction between components of the system. There are other architectural patterns that rely only on asynchronous, one-way messages, but we will focus on the common request/response interaction for this discussion. RPC based communication systems (e.g. gRpc, OAS3, SOAP) can be seen as providing:</p><ol><li>A way to define the information exchanged in terms familiar to programming language abstractions (protobuf, json-schema, xsd).</li><li>A data format for the information in the wire</li><li>A concept of <em>endpoint</em> to address messages and mechanisms to bind these endpoints to underlying communication networks (gRpc services, Urls, SOAP Services)</li><li>A specification of the request/response semantics, with multiple synchronization modes (gRpc operations with/without streaming, etc..)</li></ol><p>The work left to be done to bridge the gap in abstractions between these RPC oriented mechanisms and the Object-Oriented abstractions of programming languages and enterprise “entities” is:</p><ul><li>Define the concept of an “Entity”, “Entity Instance” and their mapping to Implementation mechanisms and concepts</li><li>What is the identity of an “Entity Instance” and how it can be used to access it in the distributed environment</li><li>How to represent and access Entity references</li><li>How to map operations in API endpoints to method invocations within a programming language.</li></ul><h3>Navigating the new landscape</h3><p>It would be fool’s errand to try to rebuild the abstraction layer built for traditional Enterprise Applications (J2EE style) in a distributed system. Aside from the technical difficulties of implementing distributed transactions, a flat object address/reference space, referential transparency, distributed identity, etc… since 2002, the <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP theorem</a> tells us that no distributed system will ever behave like that, much less be scalable. The new Enterprise System developers need to settle for some form of eventual consistency and provide interpretations and/or substitutes for the concepts available in more traditional systems. My proposal to get sanity back has three parts: (1) Go back to basics in what an entity is (2) Establish an explicit map between Entities and implementation concepts and (3) Use µ-service design patterns to support common scenarios.</p><h4>Entities represent part of the system state</h4><p>The response to the entity-as-record approach in database centric system is to go back to the concept of an entity instance as a well defined part of the state of the system. This state is represented by a set of value properties plus references to other entities. Entity instances are then first class citizens of the system, with their own system wide identity. In the traditional systems, the identity is a database synthetic primary key together with the type of entity or table that hosts it. In our distributed world, the identity needs to support system-wide addressing. A first, very workable approach is to find a well defined “home” for all the instances of an Entity type and a local id that is unique within that home. We need to be aware that this approach does not provide direct support “roaming” instances (instances that may be supported by different deployment µ-services over time) or “sharding” of instances of the same Entity type (having different instances of the same type in different µ-services). These two capabilities are still possible, but they require other solutions apart from the design of the identity/addressing mechanisms.</p><h4>Entities are encapsulated state and behavior</h4><p>Entity types are conceptually similar to the well-known Classes in Object Oriented programming languages, but obviously in a distributed environment they are not a 100% match. The similarities that are interesting to preserve are:</p><ul><li>The state of all instances of a type is specified by a well-known definition. In a distributed system, this is usually done using the message definition language to represent the serialized state of entity instances (e.g. through protobuf, GQL types or JSON-schema).</li><li>The operations and actions that can be applied to an instance of an Entity type are also the same for all instances of the type and similarly defined through the API definition language of choice (gRpc services, GQL queries and mutations or OAS3 endpoints)</li><li>The state of an instance is only accessible through the properties and operations defined for its type (encapsulation). If the choices of the previous two points are followed, this is trivially accomplished through the implementation and binding of the API protocol endpoints to network addresses</li></ul><p>The only subtle point to make is that by “hiding” the definition of the Entity Type behind the messages used to communicate its state and API, we acquire an additional degree of freedom to present multiple “views” of an entity against a state that is only uniquely defined within the limits of the µ-service that hosts it.</p><h4>µ-Services and API Endpoints are the Entities’ Home Addresses</h4><p>The easiest, more direct choice for home of an Entity Type is to pick a µ-service (which can be replicated for load or fault tolerance) and an API Endpoint offered by it. This combination should be unique in the system (e.g. in K8s this can be defined by a K8s Service) and they also define how to access it and what you can do with it through the API definition language of choice. Taking this approach the only remaining topic to resolve is to decide how to map the API Endpoint defined in the language (e.g. a gRpc service) to the actual addressable endpoint in the system. The only requirement is that this mapping is unique based on an Entity type.</p><h4>RPC protocols provide you the language to talk but…</h4><p>are only useful to act on an Entity instance once your code knows how to find the right API endpoint based on the information in the instance. Entity Id’s can provide a mechanism to do this by encapsulating the API Endpoint address in them. Alternatively, a table of Entity type to API Endpoint that is installed at deployment time can provide a “cheap” lookup without having to deploy a full endpoint registry service. An emerging alternative is to use the new Service mesh layers like Istio to provide the addressing based on symbolic names.</p><p>Once the location of the instance in the system is resolved, there are some design patterns that become very accessible beyond the simple request/response and CRUD-like operations. Interactions based on streams of messages, asynchronous messages with promises, etc… give us flexibility that is harder to achieve within a single VM.</p><h3>A first map to implementation</h3><p>To look at how this plays when planning an implementation, let’s take a µ-service system based on gRpc communication. Right out of the box we find a lot of things resolved for us (see <a href="https://grpc.io/">grpc.io</a> if you have not seen it already):</p><ul><li>Message definitions, their representation on the wire and their bindings to the programming language of choice are given by the protobuf toolset.</li><li>Naming and Addressing of Endpoints from the programming language is also given by the package structure and naming of gRpc services in protobuf files.</li><li>Invoking actions is given by the definition of operations (op) in gRpc services with flexible semantics for streaming arguments and results</li><li>Language binding stubs, also provides a flexible concurrency and invocation synchronicity through blocking, streaming and Future/Promise type of interactions.</li><li>Connecting the Stubs to underlying communication through TCP/IP and sockets.</li></ul><p>What is left for us is to decide how to use these capabilities to approximate an Object/Entity Oriented world.</p><p>Entity Types/Classes in traditional OO environments play the dual roles of defining functionality and serving as the “Home” for all the objects of that class. Both roles can be mapped onto a gRpc service, as it also provides definition of functionality through the operations it declares and supports a form of addressing at the language level (through the Instantiation of stubs).</p><p>This map is not perfect though and one needs to be conscious of the choices to make:</p><p>An Object and its Identity are one and the same in modern OO languages like Java. If you have a handle to an object, you have the object. What’s more, access to the reachable graph of other objects barely has any cost in a centralized system. In a distributed system that is not the case. You can only ever have access to the identity of an Object and never to the Object itself. If an object has references to other objects, we will need a second call (or n+1 calls if we are not careful) to retrieve their information. Objects in distributed systems are hidden away behind an API Endpoint and we can only get to their information by retrieving a potentially partial and transformed copy in a message. This strict isolation and encapsulation of the Object state means that the definition of the messages in the protocol needs to be expressive enough to cover multiple use cases efficiently. We will need to define “fat” and “skinny” versions of the object state to use when we need all the details or only the headlines for a list. We will likely need to also define several versions of messages that contain different portions of the marshaled graph of objects that are relevant to the different use cases. GraphQL solves part of this problem with its very flexible schema and projection mechanisms, but other protocols like gRpc and OAS3 don’t have that built in flexibility.</p><p>Similarly, modifying an object is not possible, it is only possible by sending a message to request the update from an API Endpoint. Combined with the expense of remote calls, and the lack of easy transactional semantics, leads to designs with heavier mutation operations that combine multiple smaller changes that would have been made together in the programming language directly. (think of multiple property setters). Ironically, this is closer to the original intent of Object communicating only through messages in the early OO languages. Mutation</p><p>Classes/Entity Types are good candidates to be implemented in a gRpc service. The gRpc service can be instantiated in a single or in multiple µ-services or network addresses. The simpler option is to instantiate them only once, becoming de-facto the “home” for all functionality of a given class. Multiple instantiations may be useful to partition the system for scale or other coarse-grain distribution (e.g. geographical sharding). Multiple instantiations tend to create a lot of headaches around routing of requests to the right instance because one needs to rely on runtime information to do this instead of having the compiler help you figure it out. In some cases this sharding can be hidden behind a dispatcher endpoint and contain the addressing complexity it requires.</p><p>Operations in the gRpc service need to play three roles that are separate in traditional Enterprise patterns: (1) Regular object methods, (2) Static class method and (3) DAO or Factory Class methods. We can separate these three in different gRpc services, but that is not strictly needed following some naming and declaration conventions:</p><ul><li>Regular Object methods should always take an Entity Id as their first field in the protobuf message.</li><li>There should always be a “get” or “read” method that takes one or a set of EntityId’s and return a snapshot of the details of the required objects</li><li>DAO style methods should follow a naming convention and clearly identify what part of the “CRUD” semantics they exercise. DAO methods that retrieve information about Objects/Entities based on attributes or filters should all start with the consistent prefixes. I tend to use “find” for the ones that return “fat” information of objects and “list” for the ones that return “skinny” information.</li><li>Try to avoid static methods by putting them in a library that you distribute with your API stubs, if they don’t require access to state that needs to be centralized, or define a Singleton type of object in a separate API Endpoint.</li></ul><p>Finally, exceptions are not available in the same way that they are within programming languages, my recommendation is to use the protocol meta-data channel (e.g. HTTP headers) to communicate the success or failure of an operation call and any additional information needed.</p><p>Entity Id’s need to be modeled explicitly. They need to be system wide unique. There are two schools of thought regarding the contents of Entity Id’s. Either they contain information to be able to find their “home” API Endpoint, or they don’t. If they do, it enables more dynamic connectivity between µ-services with limited runtime directory support and it can alleviate the complexity of “sharding” objects in different instantiations of an API Endpoint. It can also help with debugging and tracing of execution. On the other hand, they can be fragile w.r.t. changes in the configuration of the system if the API Endpoint addressing is not stable across system updates, which may be a problem when there is a need to persist entity id’s as references. Opaque Entity Id’s require a runtime directory to find the API endpoints to address, or rely on implicit information at code time to know what API Endpoint to address for a particular entity.</p><p>This is a very incomplete and tentative attempt to describe the challenges of Enterprise systems in the age of µ-services, and some approaches that seem to work to make the transition from traditional practices. It is just reflects what I have learned so far in building some of these systems and drawing from some experience in truly distributed systems in telecom and industrial systems. I hope it at least serves to stop and think of the complexity of these systems before we launch whole teams into their development with tools and conceptual frameworks that don’t match what we need to build.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37c417804cfc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salduba/object-oriented-salad-entities-instances-identity-data-records-objects-37c417804cfc">Object Oriented Salad: Entities, Instances, Identity, Data Records, Objects…</a> was originally published in <a href="https://medium.com/salduba">salduba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The three stages of a product’s life]]></title>
            <link>https://medium.com/salduba/the-three-stages-of-a-products-life-eea52d038d15?source=rss-76a7eb0b035b------2</link>
            <guid isPermaLink="false">https://medium.com/p/eea52d038d15</guid>
            <category><![CDATA[engineering-management]]></category>
            <category><![CDATA[product-development]]></category>
            <dc:creator><![CDATA[Miguel Pinilla]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 05:20:59 GMT</pubDate>
            <atom:updated>2021-04-22T05:27:12.027Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>You are designing a new widget, developing an algorithm or defining a database, spending countless hours of work and sleep thinking about it and racing to a deadline. Or you are looking at a new development project and deciding how you will plan or execute it. When you make these decisions, it is worth it to stop and think about what it is that you are building, as it will determine how you should go about it, what risks you should be taking and which ones you need to avoid.</p><p>A first thing to realize is that building a product is more than developing a set of features. Given the high cost of engineering and development that building products entails, products tend to have long lifecycles, with multiple versions of them. There is a growing awareness of the need for building extensibility or modifiability in the design of the product itself. The development team can then be dedicated to add new capabilities, remedy design defects or implement any other changes. A well engineered product will allow these changes without the need to start from scratch. This emerging concept of technology platforms is used in many industries as the underpinnings of multiple products. In Information systems, these underpinnings are given by a combination of technology choices, design patterns and explicit extension points (e.g. API’s, plug-in architectures and scripting languages).</p><p>In this evolutionary view of product development, the challenges that the development team faces vary a lot with the stage of the lifecycle of the underlying technology platform and the maturity of the target market and competitors. Most product development methodologies, including iterative and agile ones focus on some variation of the conception-development-verification-release-feedback cycle. This is useful as a general approach but fails to highlight the differences between the stages of a product that can determine the success of the development effort.</p><p>Dealing with the lifecycle of the underlying technologies is a world onto itself, which would take too much space here, so we will blissfully ignore the technical risks that technology evolution by itself introduces.</p><p>Focusing on the maturity of the market and the competition, including potential products our team could be currently offering or operating, I look at projects in one of three buckets:</p><p><strong>1.0 Developments </strong>aim to create new entrants in a market, where the development team starts from scratch, or from a very generic set of components and platforms to build on. These projects run the risk of starting too many things from scratch at once, ranging from the team itself, which can be a new organization that does not know how to work together yet , or trying new technologies or platforms. For these projects, it is essential to reduce the scope of the first release as much as possible, and minimize exposure to “non-critical” development risks. Techniques that help with achieving this:</p><ul><li>Define a “walking skeleton” or a thin-thread end-to-end demo to shake out any quirks in the development process, tooling, used components, etc… with the minimum functionality possible, even if it involves defining “fake” functionality. The goal is to test the machinery, not to start the journey.</li><li>Define the MVP profile of the product in a clear and communicable way (a three level feature outline works great for this). Classify each of the features as a “right of entry”, “parity”, “dominant” or “breakthrough”, to indicate what level of functionality and “fit and finish” is targeted in each of the features. No matter how tempting, resist over-producing and gold plating any features that are not in the dominant of breakthrough category. Be ruthless in keeping the resources for “right-of-entry” and “parity” features to the minimum needed to clear that bar.</li><li>Separate “ancillary” functionality like authentication, account management, UI management, help &amp; support links, etc.. and use as much off-the-shelf components and/or outsourcing as possible to keep the core team focused on high-value, domain specific functionality.</li><li>Design your project plan around a set of full end-to-end features that can be shown and tested by the business stakeholders, be them Product Managers, Business Analysis or similar.</li><li>Prioritize your features for development following two criteria: Initially pick some easy, low risk features to make sure that your development process and team is well oiled and running, and to quickly develop a small feature set that can serve as the showcase of the ancillary functionality as it comes online. Once this is done, pick the riskiest, most complicated features to make sure that you move the big boulders well ahead of the inevitable time crunch.</li><li>Pile up as much effort as you can onto a single feature before you open another one, keep your battlefront as narrow as possible at any point in time.</li></ul><p><strong>X.Y Development: </strong>This is development that adds features to a product in the middle of its lifecycle. At this point the technology risk should be close to zero, the design and implementation patterns well established, and the needs of the customer and market well understood. The challenge here is to keep a fast and continuous feature release cadence to the market.</p><p>The emphasis needs to be put into defining features that are as independent of each other as possible so that they can be developed and released independently and picking the most value to deliver with the available team capacity. For this type of development, it is also critical to have a robust and fast triage process for bug or incident resolution as well as small improvements that may be required by special customers. A conventional SCRUM or Kanban development process usually runs well and without problems, provided you have strong product owners with an iron fist to rule over the backlog of the team.</p><p><strong>X.0 Development: </strong>In many respects this is the hardest type of development to manage and deliver successfully. X.0 releases tend to be defined when an external threat appears (e.g. the arrival of Web based applications for Client-Server systems or the emergence of SaaS products in enterprise software) or when the age of the existing technology stack and product makes it too costly or impossible to maintain. This is the classic innovators dilemma for a company. Assuming that the decision of the business is to invest in the next generation of products, the development team will still face a set of almost impossible challenges:</p><ul><li>New development needs to compete with the current “X-1” product, which: (1) Has a very big feature footprint, result of many years of effort and resources. (2) Is very mature, has few new bugs and runs on a stable and well understood infrastructure and (3) Keeps adding functionality and new features to keep up with the market, making it a moving target for replacement.</li><li>Critical resources with deep knowledge of the domain, features and customers are still heavily invested in the current product generation and the need to remain involved in it for its maintenance and adding incremental improvements.</li><li>Specification and/or requirements for the MVP of X.0 does not exist and the documentation from the X-1 release is either non-existent, obsolete or lost. The best spec is the X-1 product itself, which without the right guidance will result in copying the bad things along with the good ones</li><li>The new X.0 release typically involves a refresh of the technology stack and foundation, which introduces technical risk by itself and is frequently underestimated. Furthermore the new set of technologies is usually new for the team, requiring training and experimentation that is rarely acknowledged in the allocation of resources and schedules.</li></ul><p>Faced with these difficulties, plus many of the same ones that afflict 1.0 style development, it is no wonder that these projects are the toughest to pull off. The successive thinning of ERP providers with each wave of technology change (from mainframes to client/server, and then to cloud is a highly visible example of how hard it is to emerge successfully from these changes). There is no silver bullet for these projects, and the approach usually requires the involvement of all the business functions and not only engineering or product teams. The complicity and support of the sales and customer service organizations is essential to give the new product a fighting chance by providing the right environment, incentives and opportunities to learn from real customers feedback.</p><p>The highest threat for X.0 projects stems from a combination of boiling the ocean in architecture refactoring, competition for critical resources with other projects with faster payback and the long incubation period they need to stand up to feasibility in the market. When I have seen these projects succeed, they</p><ul><li>Have a champion that can act as a Chief Engineer, with enough pull in the organization to drive the right resources and contend with schedule pressure if necessary.</li><li>Find an “early adopter” customer that is willing to accept the risk of adopting the new product major release and provides a narrow, clear profile of functions to implement in the new product. This is where a close partnership with the sales and business development functions is essential do identify, groom and partner with these “co-innovation” customers</li><li>Create a team with a mix of new staff (not necessarily junior, but new to the project or the industry) with key experienced personnel that avoids repeating mistakes, and making new ones that are already solved in the previous versions of the project. This experienced staff is also the best source of detailed use cases and non-happy-path specifications that are usually ignored in 1.0 type of projects.</li><li>Drive the development through milestones that are validated through the pilot customer. This is harder than it looks because it needs to preserve enough flexibility in the schedule to accommodate unexpected setbacks.</li><li>On the technical side, the chief engineer role is critical to balance the amount or foundational work with the unavoidable technical debt that even a re-architecture project will incur.</li></ul><p>Even is you are not starting a new project, you should stop for a minute and do an internal check of what kind of product you are developing. You owe it to yourself, your sponsors, and very critically to your team to be able to set ambitious but achievable goals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eea52d038d15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/salduba/the-three-stages-of-a-products-life-eea52d038d15">The three stages of a product’s life</a> was originally published in <a href="https://medium.com/salduba">salduba</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>