<?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[Upply - Medium]]></title>
        <description><![CDATA[Get the freshest news on how is tech done at Upply! ⚙️🚀 - Medium]]></description>
        <link>https://medium.com/upply?source=rss----10a09731d1c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Upply - Medium</title>
            <link>https://medium.com/upply?source=rss----10a09731d1c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:11:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/upply" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Data-Driven Air Freight: How We Built an Importance Index for Better Zoning]]></title>
            <link>https://medium.com/upply/data-driven-air-freight-how-we-built-an-importance-index-for-better-zoning-2dbf6badca9a?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2dbf6badca9a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[air-freight]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[logistics]]></category>
            <category><![CDATA[supply-chain]]></category>
            <dc:creator><![CDATA[Rebours Baptiste]]></dc:creator>
            <pubDate>Thu, 26 Feb 2026 13:02:47 GMT</pubDate>
            <atom:updated>2026-02-26T13:02:46.122Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WdCyrIuOVR95YCzRRwzsVw.jpeg" /></figure><p>Upply digitizes the world of transportation and enables its clients to obtain market price estimates, particularly for air freight. To achieve this, an Artificial Intelligence (AI) model, trained on millions of transports, is used. This model returns an estimate for a given origin airport and destination airport. However, clients can choose to provide only cities instead of directly specifying airports. In such cases, it becomes imperative for us to perform zoning to find the most relevant airport based on the provided location. This zoning algorithm is based on both the distance between the city and the airports and their logistical importance.</p><p>We are building an <strong>airport importance index</strong> based on the <strong>methodology</strong> used by the <strong>United Nations Conference on Trade and Development (UNCTAD)</strong> for the <a href="https://unctadstat.unctad.org/datacentre/dataviewer/US.PLSCI">Port Liner Shipping Connectivity Index (PLSCI)</a>. Several factors are taken into account such as the <strong>number of flights</strong>, the <strong>number of aircraft</strong>, and the <strong>number of connected airports for each airport</strong>. This article details our thought process on this subject.</p><h3>Diving into the World of Upply: Data at the Heart of Freight Transportation</h3><h4>Upply: Technology Serving Freight Transport</h4><p>Upply is a digital platform dedicated to professionals in freight transportation and logistics. Thanks to AI models built on a database of millions of transports, it offers various services that allow its clients to compare prices, anticipate market fluctuations, and optimize their costs.</p><p>These clients are key players in the transportation world: shippers (companies looking to transport their goods, such as major retail chains), carriers (companies that move goods for shippers), freight forwarders (specialized intermediaries who plan, optimize, and coordinate the transport of goods on behalf of clients), and even transportation consulting firms. All these actors need to know the market prices in order to position themselves and negotiate effectively. And nothing beats data for that.</p><h4>Data: The Engine Behind Transport Price Prediction</h4><p>Determining the cost of transporting goods involves several factors: the mode of transport, the departure and arrival locations, the transport date… and, of course, all the details about the goods themselves: weight, volume, content, etc. Upply’s AI models learn from this variety of data, identify the decisive parameters for pricing, and can estimate costs with precision.</p><p>Thus, a client can provide an origin location, a destination location, and information regarding the goods being transported, and the model returns a price estimate. This is how the models work for the three types of transport managed by Upply: road, maritime, and air.</p><p>For air freight, the model is slightly more specific since it is composed of sub-models that take one or several airports as input locations. If a client decides to benchmark between cities, we must therefore find the most relevant airports for them.</p><h4>Air Freight: A Unique Ecosystem</h4><p>Compared to other modes of transport, air freight is distinguished by its speed and reliability, although it represents a smaller share of the total volume of goods transported worldwide. While maritime dominates international trade in terms of volume, air transport is crucial for high-value, perishable, or time-sensitive goods, such as electronic components, pharmaceuticals, and fresh produce.</p><p>However, it shares with maritime the way in which a transport is executed. An air freight transport is generally divided as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*8LO2_MDuzrqDZBw3JzvDzA.png" /><figcaption>Decomposition of an Air Freight Transport</figcaption></figure><p>First, the goods are transported from a warehouse to the origin airport (<em>pre-carriage</em>). Then they are flown from the origin airport to the destination airport (<em>main leg</em>). Finally, they are delivered from the destination airport to a new warehouse (<em>post-carriage</em>).</p><p>The total transport cost is the sum of the cost of each segment. At Upply, two distinct models are used to predict the cost of these three segments: the <em>freight</em> model for the <em>main leg</em> and the <em>carriage</em> model for the <em>pre-carriage</em> and <em>post-carriage</em> segments.</p><p><strong>Zoning Is Necessary for Non-Airport Locations…</strong></p><p>We saw that the <em>freight</em> model estimates the price for the <em>main leg</em>, i.e., the transport cost between two airports. However, a client might want to know the price for a transport between two cities, or between a city and an airport, for example, between Berlin and Los Angeles International Airport. In this case, before using the <em>pre-carriage</em> and <em>freight</em> models to compute the estimate, it is necessary to choose the airport through which the goods will flow from Berlin before reaching Los Angeles.</p><p>This is made possible thanks to our zoning algorithm, which returns the most relevant airport for a given location. At Upply, the relevance of an airport relative to a city is measured by the distance between them and the <strong>logistical importance of that airport</strong>. The functioning of this algorithm is similar to the one presented in the article <strong><em>Finding the Most Relevant Port Using Weighted K-Nearest Neighbors</em></strong>. However, unlike sea freight, we do not have an index quantifying the overall importance of all terminals worldwide for air freight.</p><p><strong>… And an Importance Index Is Necessary for Zoning</strong></p><p>To perform the zoning, we use distance, which is easily accessible given the geolocations (latitude and longitude) of airports, along with their importance. The latter is much more complicated to obtain.</p><p>When discussing the logistical importance of an airport, we refer to the role it plays in the global supply chain and its influence in air freight. More specifically, what share of air freight departures and arrivals occur through that airport? How many different aircraft transit through it? To how many other airports is it connected via freight flights? We need an indicator that reflects the answers to all these questions.</p><p>One idea considered was to use rankings published by specialized organizations that list the top 10 or even the top 50 airports worldwide in terms of air freight. However, in addition to the fact that these rankings are far from exhaustive in terms of the number of airports, they mostly use a single characteristic for comparison, usually the volume of goods handled.</p><p>Yet, we need an indicator that compares a much larger list of airports, covering the widest possible geographical area, in order to best meet client demands. Furthermore, we want this indicator to take into account several factors beyond just the volume of goods, such as the number of arrivals and departures for each airport, so that it is as representative as possible of market reality. We are therefore building this <strong>airport importance index for the international air freight network</strong>.</p><h3>An Importance Index Built from a Validated Methodology and Open Source Data</h3><h4>PLSCI: An Indicator Validated by Transport Experts</h4><p>To create our index of airport importance from a logistical standpoint, we decided to base it on the methodology employed by the United Nations Conference on Trade and Development (UNCTAD) for the <a href="https://unctadstat.unctad.org/datacentre/dataviewer/US.PLSCI">Port Liner Shipping Connectivity Index (PLSCI)</a>. It is from this same index that we built <a href="https://medium.com/upply/finding-the-most-relevant-port-using-weighted-k-nearest-neighbors-8f18044f61e8">our maritime zoning algorithm</a>. This is an indicator validated by transport experts, including our own specialists at Upply, so we believe it is a good idea to adapt it for air freight.</p><p>The PLSCI reflects the position of ports in the global liner shipping network. It takes several factors into account:</p><ul><li>The number of vessels scheduled per week at the port</li><li>The annual cargo capacity deployed, measured in twenty-foot equivalent units (TEUs)</li><li>The number of regular maritime transport services offered from and arriving at the port</li><li>The number of shipping companies offering regular services to and from the port</li><li>The average TEU size of the largest container ship that regularly departs from and arrives at the port</li><li>The number of ports connected to the port</li></ul><p>The PLSCI is calculated quarterly for each port as follows: each component’s ratio (compared to the average of that component across all ports) is computed, then these ratios are averaged and multiplied by 100.</p><p><strong>The Advantages of This Type of Index</strong></p><p>The main advantage of this method is that it examines the terminal from several aspects rather than just one, for example, not solely the volume of goods handled. Indeed, if a port handles a large volume of goods but these goods are limited to only a few ships arriving and departing at the same location, the importance of the port would be overestimated.</p><p>Moreover, it is calculated regularly over extended periods to smooth out results that might be exceptionally low or high over a given period. Multiplying by 100 gives an index with an average of 100, which makes it easier to compare any given terminal with the <em>average terminal</em>.</p><p>We therefore decided to follow the main principles of the PLSCI for our airport importance index in the global air freight network. However, to build it, we need air transport data that provides similar components to those mentioned above.</p><h4>Open Source and Reliable Flight Data</h4><p><strong>Data That Meets Our Needs</strong></p><p>To build the importance index, we use an open source database of more than <strong>250,000 aircraft routes</strong>. These air freight transports involve around <strong>3,000 aircraft</strong> and took place between April and the end of June 2024. We have the following information concerning the flight:</p><ul><li>Origin airport</li><li>Destination airport</li><li>Departure date</li><li>Arrival date</li></ul><p>We also have additional information concerning the aircraft:</p><ul><li>Aircraft identifier</li><li>Aircraft type</li><li>Airline identifier</li><li>Service type (cargo = goods only / mix = both goods and passengers)</li><li>Aircraft capacity (in tonnes of cargo)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_9zrMipNcFMolZXCw0AfXA.png" /><figcaption>Sample of the Raw Data Used</figcaption></figure><p><strong>Data That Accurately Reflects the Market</strong></p><p>Before building the index, we begin by exploring the data through some basic descriptive statistics. This allows us to verify that the data aligns with market realities (thanks to our internal industry expertise) and to detect any potential discrepancies that might bias our calculations.</p><p>We start by counting the number of flights departing from and arriving at each airport to obtain a basic component representing their importance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/219/1*HoQWiY78cEhxBkG8IPO-0A.png" /><figcaption>Number of Departing Flights per Airport</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*0hZP7W6hzimf-Ry-MJd92A.png" /><figcaption>Number of Arriving Flights per Airport</figcaption></figure><p>Among the most frequented airports, we find Memphis (USMEM), Hong Kong (HKHKG), and Dubai (AEDXB). These figures allow us to perform an initial check regarding the most important airports overall and by geographic region. The results are consistent with our industry expertise.</p><p>We also examine this data by country to verify the results on a broader scale. These results also appear to reflect market reality well, as the top 10 countries with the most air freight transports include major global powers (USA, China, France, Germany, etc.).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*wgcmktuv2sNhaB_vljMMmw.png" /><figcaption>Number of Flights by Origin Country</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*3SFATKT3vDsxAnAxhrkL8w.png" /><figcaption>Number of Flights by Destination Country</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Rb5uwdPBZsCJynME3msyQ.png" /><figcaption>Number of Flights by Country (Origin — Destination)</figcaption></figure><p>Finally, when checking the number of flights executed by each airline, we notice that FedEx Express and UPS Airlines are the two most popular carriers. This observation also aligns with reality, as these two companies are among the most important, if not the two most important, cargo airlines.</p><p><strong>One Caution Regarding Our Data</strong></p><p>Our industry expertise raised one alert based on these results: the over-representation of flights involving Australian airports. There appears to be a higher proportion of Australian flights in our data than in reality. This could bias results depending on the subject of study, but not in this case.</p><p>Indeed, we aim to create an airport importance index for use with our zoning algorithm. This algorithm returns the most relevant airport based on a given location and only considers airports located on the same landmass as the location in question. For example, if the location is in Australia, the calculation for the most relevant airport will only consider Australian airports.</p><p>Thus, it is not problematic if the importance index for Australian airports is overestimated compared to other international airports, since they will not be compared to one another. However, attention should be paid to this point if the index is used in other contexts, perhaps by applying a weighting.</p><h4>A Reliable Index to Measure Airport Importance</h4><p><strong>Components That Reflect the Reach of Airports in the Global Air Freight Network</strong></p><p>Based on the data presented above, we develop an importance score for each of the <strong>754 airports</strong> in our database, which we can then use with our zoning algorithm.</p><p>To calculate this index, we draw inspiration from the methodology used for the PLSCI by UNCTAD, as mentioned earlier, as well as from the insights of our industry experts in air freight. We cannot produce the importance index directly from raw data; instead, we first calculate several components that characterize importance:</p><ul><li>Number of flights departing from the airport</li><li>Number of flights arriving at the airport</li><li>Number of distinct aircraft transiting through the airport</li><li>Number of distinct airlines operating through the airport</li><li>Number of airports connected to the airport</li><li>Total potential cargo volume transiting through the airport</li></ul><p>These components reflect the key ideas behind those used to calculate the maritime index on which we base our reasoning. They provide a comprehensive view of the overall activity of a freight terminal. We do not only consider the volume of goods handled and the number of flights, but also the geographical reach of each airport and how many different players are connected to it.</p><p><strong>The Revised PLSCI Methodology for Our Needs and Data</strong></p><p>We calculate the above components on a monthly basis for each airport. We choose to do it monthly rather than weekly, as we believe the volume of data is too low for some weeks. Unlike UNCTAD, we do not calculate them quarterly because we do not have enough total data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8rrPh02u6LRygHrQIR5FA.jpeg" /></figure><p>From these components, we are able to calculate metrics that ultimately allow us to produce the index. The metrics are obtained by computing, for each component, the monthly average for each airport and then the ratio of this average compared to the overall average of all airports. This allows us to compare each airport to an <em>average airport</em> for each metric.</p><p>For example, for the number of departing and arriving flights, the results for the busiest airports are as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*pOiZKhOveiEsjhcJ8QWlFw.png" /><figcaption>Normalized Average Number of Departing Flights per Airport</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*ao23YSimHfLj12sx154kSQ.png" /><figcaption>Normalized Average Number of Arriving Flights per Airport</figcaption></figure><p>We can observe that there are 45 times more flights departing monthly from Memphis (USMEM) than from an average airport. We can therefore expect that it will be among the most important airports in the world.</p><p>We continue to follow UNCTAD’s methodology and then calculate the average of all these metrics. Unlike UNCTAD, however, we do not use a simple arithmetic mean but a weighted average. Based on advice from our industry experts, we want to create an index that gives more weight to the characteristics that matter most when evaluating an airport’s importance. This weighting, determined in consultation with the experts, is central to ensuring the index aligns with market reality. For example, we have given more importance to the number of distinct aircraft and distinct airlines than to the number of flights. This approach notably reduces the impact of airports that have many flights but where most flights are operated by only a few airlines.</p><p>Finally, we decide to normalize this score between 1 and 100 to make it more interpretable, as well as to control the range of possible values and facilitate the creation of our zoning algorithm.</p><p><strong>An Importance Index Consistent with the Market</strong></p><p>Among the top 10 most important airports worldwide in terms of air freight, 6 are American airports, including Memphis (USMEM) and Los Angeles (USLAX), and 4 are Asian, including the most important according to our index, Hong Kong International Airport (HKHKG).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*HEQQR__cFd7CO5vb7nhyKA.png" /><figcaption>Top 10 Most Important Airports According to Our Index</figcaption></figure><p>Notably, there is an absence of European airports in the global top 10. Among the most important in Europe, we find Paris-Charles de Gaulle (FRCDG), Frankfurt (DEFRA), and Amsterdam (NLAMS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*1klV_UXzKjhZJxQzIkOWtQ.png" /><figcaption>Map of European Airports by Importance</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*ftxSqiKI90Y0hu29EhTeSA.png" /><figcaption>Top 10 Most Important European Airports According to Our Index</figcaption></figure><p>The airports ranked as most important by our index are consistent with our industry expertise and similar to those published by organizations specializing in air freight, confirming the reliability of our approach.</p><h3>A Consistent Index That Can Serve Transportation Professionals</h3><h4>A Relevant and Coherent Indicator</h4><p>In order to perform zoning for an air freight benchmark when no specific airports are provided, it was necessary to build an importance index. In fact, no open source index exists, and the only rankings produced by industry experts cover at most around fifty airports and compare them using a single metric.</p><p>Our index perfectly addresses this problem. It is calculated using open source data that aligns with market reality according to our analyses. Moreover, its methodology is based on that of an equivalent indicator for maritime transport, calculated by a recognized organization in the transportation world and validated by industry experts. It takes into account several components to provide the most faithful picture of each airport relative to other terminals worldwide.</p><p>The results of the created index are very satisfactory, correctly reflecting the position of each airport within the air freight network. The top airports globally, as well as by geographic region, are consistent with our industry expertise. We are therefore very pleased with the produced index and can build our zoning algorithm based on it.</p><h4>Useful Internally, But Not Only</h4><p>This index initially addresses an internal challenge. In cases where a client performs an air freight benchmark without directly specifying the relevant airports, we use a zoning algorithm to identify the most pertinent ones based on the provided locations. This relevance takes into account both the distance and the importance of the airports, which is our focus here. Thus, the index allows us to build a high-quality zoning algorithm to satisfy clients when they wish to know market prices.</p><p>However, this indicator also has broader potential applications. It could help logistics companies and shippers select the most efficient airports for their transportation needs. It might also serve as a tool for market analysts to forecast air freight trends.</p><p>Going even further, one can imagine investors using it to identify the most influential airports and prioritize investments in infrastructure or cargo processing technologies. Insurers might leverage this index to assess the risk associated with strategic hubs and offer insurance products tailored to the challenges of business continuity in freight transportation. Finally, researchers could use it to study the dynamics of freight networks, understand the success factors of airport hubs, or model scenarios for the evolution of traffic and cargo flows.</p><h4>Some Adjustments Are Still Needed</h4><p>Despite validation by our industry experts and the fact that it is built on reliable data and a recognized methodology from another type of transport, there are still some aspects to refine in order to perfect the index.</p><p>Firstly, while we worked with a sizable dataset, it could certainly be much larger. Aggregating larger volumes of data would likely make our index even more robust.</p><p>Additionally, the data contains too many transports involving Australia. As mentioned earlier, this does not affect our current use case, but it could be an issue in other projects. We need to consider a solution to achieve a better representation of Australian air freight within the global network. One idea would be to filter the input data to include only certain airlines or aircraft types. Another idea would be to adjust afterward by applying a weighting for Australian airports.</p><p>Finally, at the moment, this index is used only internally for our zoning algorithm. We could consider sharing it more widely so that it can benefit the growth and understanding of this mode of freight transportation, tell us in the comments if you’re interested!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dbf6badca9a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/data-driven-air-freight-how-we-built-an-importance-index-for-better-zoning-2dbf6badca9a">Data-Driven Air Freight: How We Built an Importance Index for Better Zoning</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From an AI idea to Production : a Dust story]]></title>
            <link>https://medium.com/upply/from-an-ai-idea-to-production-a-dust-story-461679d2d7ed?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/461679d2d7ed</guid>
            <dc:creator><![CDATA[Florent Laval]]></dc:creator>
            <pubDate>Mon, 08 Dec 2025 20:54:17 GMT</pubDate>
            <atom:updated>2025-12-08T20:55:09.402Z</atom:updated>
            <content:encoded><![CDATA[<h3>From an AI idea to Production: a Dust story</h3><p>In the current tech landscape, everyone is “experimenting” with AI. Companies are stockpiling Proofs of Concept (POCs) that end up rotting in digital drawers, or they are stuck in endless debates about which vector database to use for their RAG stack.</p><p>At Upply, we made a simple choice: <strong>stop experimenting and start shipping.</strong></p><p>We didn’t want a cute demo. We wanted a production-grade tool, used by real customers, to solve real supply chain problems. And we wanted it fast.</p><p>On <strong>November 4th, 2025</strong>, we started creating the agent. On <strong>November 24th, 2025</strong>, it was in production with our strategic clients.</p><p>This is the story of <strong>Atlas</strong>, our freight market intelligence agent, and how we went from a blank page to a live product in less than a month.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8PwnjNByPcLztJjLS-ZwA.png" /></figure><h3>1. The Strategy: Buying Velocity vs. Building Infrastructure</h3><p>When we decided to build Atlas, the goal was clear: allow our users to ask complex, natural-language questions about freight rates (Road, Air, Ocean) and get immediate, data-backed answers.</p><p>We could have built a custom RAG (<em>Retrieval-Augmented Generation</em>) stack from scratch. We could have spun up LangChain, configured a Pinecone instance, and written an army of Python scripts to handle ingestion and chunking. But that would have taken months of engineering time just to get the plumbing right.</p><p>We chose <strong>Dust</strong>.</p><h4>Why this choice? (Pragmatism over Ego)</h4><p>In my previous article on choosing PHP over Rust, I explained the importance of pragmatism. The same logic applies here. Our market analysis showed that Dust offered the best “time-to-value” ratio to get us off the ground.</p><ol><li><strong>Time-to-Value:</strong> We could configure an MVP agent in hours, not weeks. The native connectors for Notion and the Web meant we didn’t have to write code to ingest our documentation.</li><li><strong>Model Agnosticism:</strong> We refused to be locked into OpenAI. We needed the flexibility to “hot-swap” between GPT-4, Claude, Mistral, or Gemini to see which one actually “understood” logistics nuances.</li><li><strong>API-First Architecture:</strong> This wasn’t just going to be a standalone chatbot. Dust provides a full REST API. This meant we could integrate the intelligence directly into the Upply web application, keeping the user experience seamless while offloading the LLM infrastructure.</li></ol><p>This decision allowed the tech team to focus on what actually matters: <strong>the quality of the data and the intelligence</strong>, rather than maintaining GPU servers or debugging context windows.</p><h3>2. The Risk: Starting Development Without the Final Model</h3><p>The decision we took here was not necessarily an easy one, it didn’t have too much impact though. But it was leap of faith: we knew we wanted to build something with Dust, we knew we were “tech enough” to handle the uncertainty of this product we never worked with and we bet on the fact we would be able to streamline four parallel processes:</p><ul><li>Design the release and communication strategy on the beta and final versions</li><li>Developing the UI and front-end application</li><li>Developing the backend connection to Dust, credit management and access</li><li>Developing the context and knowledge needed to design a great beta model</li></ul><p>We needed all these elements to synchronize smoothly in order to put it on production in time. Each developer, product designer, product manager, devops engineer, data scientist and data engineer knew their role, their mission and what they had to do.</p><p>The design has been highly sober and effective, dark mode has been used to have a direct look &amp; feel with our new AI branding — all of our upcoming AI tools will be in dark mode to help users differentiate which is AI and which is purely operational and freight.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cSQXtLZ7LY3JA9P0XnDdqw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkSGh2auQWLeA0hzPQix4A.png" /></figure><p>Here is an extract of our Atlas Epic, every single task has been atomized and is independent and ready to be developed without any other meeting. We had more than 40 tasks and everything has been done efficiently in a breeze.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TwIyzTk-mbdPHz0hbylOPg.png" /></figure><p>But Atlas can’t be put on production without being game changer for our users. It needed to be different than the ChatGPT they already use in their operational tasks.</p><h3>3. The “Brain”: Curation Over Quantity</h3><p>An AI agent is only as good as the data you feed it. If you plug a generic LLM into the open web, you get generic answers. Atlas had to be an expert. It needed to know the difference between a spot rate and a contract rate in Europe for Q3 2025.</p><p>We created a “Closed Context” environment. We put Atlas on a strict diet, composed solely of high-quality inputs defined at our “Space” level:</p><ul><li><strong>Upply Proprietary Data:</strong> Our market indices (UFI), benchmarks, and monthly barometers (Air, Ocean, Road) through MCP connections.</li><li><strong>Expert Content:</strong> Almost 10 years of Upply proprietary expert articles (from our expert website <a href="http://market-insights.upply.com/">market-insights.upply.com</a>), our white papers, economic outlooks, and methodological reports.</li><li><strong>Trusted External Sources:</strong> A whitelist of specialized freight news sites (like <em>The Loadstar</em>, <em>L’Antenne</em>) to bridge the gap between our “cold” data and breaking market news.</li></ul><h4>The Context Challenge</h4><p>The advantage of this approach is granularity. We could create a specialized agent without reconfiguring the entire data retrieval pipeline every time. However, we did face limitations. For instance, Dust does not always allow for easy exclusion of specific sub-folders within a synchronized source, and we sometimes navigate “blindly” regarding what the web crawler has actually indexed.</p><p>Despite these hurdles, by strictly controlling the context window, we minimize hallucinations. If the answer isn’t in the data, Atlas is trained to say “I don’t know” rather than inventing a market trend.</p><p>Atlas will ask the user if he needs more precisions, if he doesn’t understand or needs more information to deep dive into a specific topic. Atlas can use deep research to create professional-grade reports.</p><h3>4. The “Blind Test”: Winter is Coming</h3><p>This is where the real engineering happened. We had the data, but we needed the right “brain” to process it. We didn’t want to rely on benchmarks found on Twitter or LinkedIn, every single week a new model is released and all past benchmarks don’t work anymore.</p><p>We wanted something real, we hence organized our own <strong>Internal Blind Test</strong>.</p><p>We configured three identical agents, fed with exactly the same data, but powered by three different Large Language Models (LLMs). To avoid any bias from our internal testers, we anonymized them under seasonal code names:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*NK1RzoQ_cg8zpmp-9iVa7A.png" /></figure><p>Each of them was used to compare something:</p><ul><li>🌱 <strong>Printemps (Spring) → ChatGPT5.1 Vanilla, without additional script, without knowledge</strong></li></ul><p><strong>Printemps (Spring)</strong> was mainly used to compare our top 2 models Autumn and Winter with the worst competitor we had against our clients: their own ChatGPT they already use and that they would compare us directly with. We needed to make sure we beat that guy.</p><ul><li>🍁 <strong>Automne (Autumn) → Mistral Large Model</strong></li><li>☃️ <strong>Hiver (Winter) → Claude 4.5 Sonnet</strong></li></ul><p>We needed here to find the best model between two that we couldn’t really compare ourselves, we liked both, so we couldn’t choose, we performed this blind test to a lot of different people within the company (developers, product managers, account executives, customer success managers, field operators, economic experts, freight experts, even our legal team!) and to get their gut feeling on the one they prefer in terms of answers, expertise, etc.</p><p>We unleashed our internal teams (Sales, Product, Tech) on these models with a simple instruction: <em>Ask</em> <em>your toughest client questions to each model, and rate the answer.</em></p><h4>The Crash-Test Results</h4><p>We analyzed the logs based on three criteria: reasoning capability, response time (latency), and structural quality.</p><h4>1. The Reasoning Heavyweight (GPT-5/High Reasoning)</h4><p>We tested a model with “High” reasoning capabilities.</p><ul><li><strong>The Good:</strong> Incredible depth.</li><li><strong>The Bad:</strong> The latency was unacceptable for production. It averaged <strong>106 seconds</strong> for complex queries.</li><li><strong>The Verdict:</strong> “Too long… huge search time.” For a business user, staring at a loading screen for nearly 2 minutes is not a feature; it’s a bug.</li></ul><h4>2. The Speedster (Mistral)</h4><p>We tested a version based on Mistral.</p><ul><li><strong>The Good:</strong> Very clear. Decent response time (~43 seconds for Large).</li><li><strong>The Bad:</strong> A style deemed “less conversational” than its competitors.</li><li><strong>The Variant:</strong> The “Small” version was lightning fast (17 seconds) but the answers were significantly less detailed. Speed does not justify the loss of relevance.</li></ul><h4>3. The Winner: Claude 4.5 Sonnet (aka “Autumn”) 🏆</h4><p>This model hit the perfect zone, for the time spent.</p><ul><li><strong>Structure:</strong> It perfectly respected our prompt engineering instructions: Summary → Details → Sources. Feedback was unanimous: “Well structured answers,” “Citations included in the response,” “More concise and better formulated”.</li><li><strong>Latency:</strong> An average of <strong>70 seconds</strong> for complex tasks. This is on the high side, but the quality justified the wait.</li><li><strong>Tone:</strong> It struck the right professional, factual, and neutral tone aligned with Upply’s editorial standards.</li></ul><p>We chose to go to production with <strong>Claude 4.5 Sonnet</strong> during this closed-beta phase.</p><h3>5. Production: This Is Not a Gadget</h3><p>Less than 20 days after the first line of configuration, we pushed Atlas to production for a “Closed Beta” with 10 of our key accounts.</p><p>This isn’t a sandbox experiment. Atlas is fully integrated into the Upply web interface via API. When a user logs in, they access a dedicated “Market Insights” interface.</p><h4>The Beta Constraints</h4><p>To maintain control during this launch phase (early December to end of January), we implemented strict guardrails:</p><ul><li><strong>Scope:</strong> A pilot with 10 selected customers.</li><li><strong>Volume:</strong> Free access, but capped at approximately 100 questions per customer to prevent abuse and manage API costs.</li><li><strong>Setup:</strong> Each customer configuration is managed via our internal tools (Jarvis) to ensure personalized tracking.</li></ul><h4>The Feedback Loop &amp; “Explo” Insights</h4><p>One of the major advantages of using the Dust API is that we can replicate conversation logs into our own database. This allows us to perform post-mortem analytics: What questions are asked most frequently? Where does the model fail?</p><p>During our exploration phase (“Explo”), we discovered critical behaviors:</p><ul><li><strong>Graph Generation:</strong> The model works surprisingly well when explicitly asked for visuals (“Tool Frame”), producing “very quality visuals,” though it increases response time.</li><li><strong>Data Conflicts:</strong> We noticed misalignment when the model read from both our “Market Insights” (text) and “UFI” (index data) simultaneously. It sometimes struggled with date formats. We had to iterate on the prompt to force it to prioritize UFI data when available and standardize date formats to yyyy-mm-dd.</li><li><strong>Source Hallucination:</strong> On very niche questions, the model sometimes claimed to use internal sources even when the specific info wasn’t there. This forced us to refine the system prompt to be more honest about data gaps.</li><li><strong>Deep Research</strong>: Somes users tried to generate complete economic freight outlooks, and they succeeded! Because Atlas can do it! However, we can go even further and provide deep research functionalities that take much more time but are excellent to build these kinds of reports.</li></ul><h3>6. The Endgame: European Sovereignty</h3><p>Atlas is live. It works. It delivers contextual economic analysis in seconds. But this is just step one.</p><p>Our vision goes far beyond simply “wrapping” American LLMs. We are building toward the <strong>First Sovereign European Freight LLM</strong>.</p><p>While Dust is an excellent accelerator (MVP), we are aware of its long-term limitations: it cannot easily orchestrate complex decision chains (agents calling other agents) or be fully self-hosted for maximum security.</p><p>That is why we are already looking to the future. We are evaluating architectures involving <strong>CrewAI</strong> or European opensourced equivalents and hosting open-weights models on European infrastructure (like <strong>Scaleway</strong>).</p><p>This move will allow us to guarantee:</p><ol><li><strong>Data Governance:</strong> Our clients’ queries and our proprietary data will never leave European jurisdiction.</li><li><strong>Vertical Specialization:</strong> A model fine-tuned specifically on logistics terminology, not generic internet text.</li></ol><h3>Conclusion</h3><p>We succeeded in this bet in 25 days because we applied a simple rule: <strong>Pragmatism &gt; Perfectionism.</strong></p><p>We chose a managed tool (Dust) over custom code. We chose to involve our teams in “Blind Tests” rather than trusting theoretical benchmarks. And most importantly, we chose to put the tool in the hands of customers immediately.</p><p>Atlas is not a promise of what AI <em>could</em> do for the supply chain in 2030. It is what it is doing today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461679d2d7ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/from-an-ai-idea-to-production-a-dust-story-461679d2d7ed">From an AI idea to Production : a Dust story</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Getting things done” with Databricks: a bet on Delta Lake and Unity Catalog]]></title>
            <link>https://medium.com/upply/getting-things-done-with-databricks-a-bet-on-delta-lake-and-unity-catalog-ba028dee8e00?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/ba028dee8e00</guid>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[scalability]]></category>
            <dc:creator><![CDATA[Jaime Avila Farrar]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 16:37:26 GMT</pubDate>
            <atom:updated>2025-09-10T16:32:36.765Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NSbDNAOQc7gvpfH_losCQ.png" /></figure><blockquote>Growing data volumes were slowing us down. We needed a smarter way to manage, govern, and scale our pipelines without ballooning costs or complexity. That’s why we doubled down on <a href="https://medium.com/u/5ae67e7eecef">Databricks</a>, adopting <strong>Delta Lake</strong> and <strong>Unity Catalog</strong> to overcome the limits of our Parquet-based workflows.</blockquote><blockquote>By making this move, we modernized our platform, cut costs, simplified governance, and improved reliability across the products that power our business.</blockquote><p>In this article, I’ll walk you through the challenges of our previous process, explain why Delta Lake and Unity Catalog were the right fit, and share the benefits we’ve already seen. Finally, I’ll give a glimpse of what comes next.</p><h3>What is Upply?</h3><p>👉 <strong><em>Before diving into data pipelines, let me first introduce Upply…</em></strong></p><p>Upply is a digital platform transforming freight transportation management by combining data, AI, and logistics expertise. Built on models trained on millions of transports, Upply helps businesses compare prices, anticipate market fluctuations, optimize costs, and streamline operations.</p><p>We work with shippers, carriers, freight forwarders, and consulting firms, offering tools for price analysis, carrier sourcing, shipment tracking, administrative management, and CO₂ impact assessment. By uniting technology with industry know-how, Upply makes supply chains more efficient, transparent, and accessible.</p><p>📊 <strong><em>Our data-driven solutions come in several forms</em></strong></p><p><strong>Benchmark and Smartscan</strong> help professionals compare freight rates across trade lanes while also assessing environmental impact.</p><p>The <strong>Upply Freight Index (UFI)</strong> provides macro-level indicators and short-term forecasts on price trends.</p><p>And for day-to-day operations, our <strong>Dashboards</strong> centralize logistics data in real time, giving teams a clear and reliable view of their activities.</p><p>All of these solutions are powered by a data architecture built on <strong>Databricks</strong> and <strong>Azure</strong>. To understand it better, let’s walk through its main components.</p><h3>Inside Upply’s Data Architecture</h3><p>🏗️ <strong><em>Strong products start with strong data foundations</em></strong></p><p>At Upply, ours has evolved a lot in recent years. What used to be separate steps is now a coherent system where ingestion, orchestration, compute, storage, and exposure all flow together seamlessly.</p><p>The diagram below gives a high-level view of how these components connect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oITwE9e5SgO7l-ubGbHStQ.png" /><figcaption><em>Upply’s Data Architecture — </em><a href="https://www.notion.so/The-New-Data-Architecture-at-Upply-1819c9606c1880e3af91ce12e16a6d65?pvs=21"><em>The New Data Architecture at Upply</em></a><em> (2025) — by Alan Moria</em></figcaption></figure><p>🧪<em> </em><strong><em>At the heart of our architecture lies the modeling phase</em></strong></p><p>This is where raw inputs are shaped into structured datasets that fuel our statistical models. For years, Azure and Databricks handled the ETL work, retrieving, transforming, and storing data.</p><p>That setup served us well, but with growing data volumes and rising client expectations, its limitations quickly surfaced. We faced <strong>technical and operational limits</strong> that forced us to rethink. <br>➡️ That’s when we turned to <strong>Delta Lake</strong> and <strong>Unity Catalog</strong>.</p><p>The diagram below zooms in on this modeling phase, showing how it fits within our broader data architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YogFrM5iDfZ-hUPJy4lACQ.png" /><figcaption><em>A dive into process’ modeling phase (Upply’s Data Architecture revised) — </em><a href="https://www.notion.so/The-New-Data-Architecture-at-Upply-1819c9606c1880e3af91ce12e16a6d65?pvs=21"><em>The New Data Architecture at Upply</em></a><em> (2025) — by Alan Moria</em></figcaption></figure><h3>Challenges of the old process</h3><p><strong>🔎 <em>To understand the shift, we first need to explore our old modeling process…</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErGIGJcZ6MJQqJOOSbc0fg.png" /><figcaption>Yesterday’s process: effective at first, but limited as data volumes grew.</figcaption></figure><p>Our old modeling process was straightforward. Data was ingested via SFTP or email attachments, validated, and stored as daily raw Parquet files in Azure Data Lake. Each day’s data was appended to a growing historical dataset, which quickly became massive.</p><p>From there, pipelines transformed the data through Silver and Gold layers, cleaning and structuring it for analysis. Finally, Gold data fed into model training, and results were exposed through APIs.</p><p>This approach worked, but it came with trade-offs. Parquet was efficient for its time, yet it lacked features like ACID transactions, schema enforcement, or governance. We also chose simplicity over complexity, reprocessing the entire history daily so we could reproduce exact states for client queries. Functional at first, this strategy became increasingly costly and slow as volumes exploded.</p><p>The symptoms were clear:</p><ul><li>Storage costs surged.</li><li>Queries slowed as datasets ballooned.</li><li>Scaling required ever more powerful clusters.</li><li>Schema mismatches created occasional pipeline issues.</li></ul><p>In short, Parquet alone couldn’t keep up with our growth. We needed stronger foundations. That’s when we knew it was time to move forward and embrace the journey.</p><h3>Where we have migrated to</h3><p><strong>💡<em>Introducing new solutions</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5j58tSlJeyu66tohfN6cdw.png" /><figcaption>Unified data governance and storage — <a href="https://www.databricks.com/product/delta-live-tables">Databricks: Data Intelligence Platform</a> (2025)</figcaption></figure><p>Two technologies proved to be turning points for us: <strong>Delta Lake</strong> and <strong>Unity Catalog</strong>.</p><p>With <strong>Delta Lake</strong>, we moved beyond simple Parquet storage. It gave us what we had been missing: ACID transactions to guarantee reliability, schema enforcement to keep our data consistent, and historical versioning to reproduce past states with ease. Thanks to these features, managing raw, silver, and gold datasets became much more robust and predictable.</p><p><strong>Unity Catalog</strong>, meanwhile, solved the governance challenge. Instead of juggling fragmented access rules, we gained a single, centralized layer for security, permissions, and cataloging. This made our data easier to discover, safer to share, and compliant by design.</p><p>Together, these two technologies fit naturally into our Databricks environment and transformed our pipelines into something far more scalable, reliable, and transparent than before.</p><p><strong>⭐ <em>The new modeling process</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*82_NVXoxOzwCkdGX4ayjbQ.png" /><figcaption>From Parquet to Delta: how our modeling phase works today.</figcaption></figure><p>In our redesigned process, <strong>Delta Lake</strong> replaces Parquet as the main storage format, while <strong>Unity Catalog</strong> takes care of managing and governing the tables. On paper, this might look like a small adjustment. In practice, it has brought major improvements such as transactional consistency, schema versioning, and fine-grained access control.</p><p>Orchestration is still handled by <strong>Azure Data Factory</strong>, while <strong>Azure Databricks</strong> continues to power compute, transformations, and model training. The big difference lies in how the data is stored and governed: tables now live in <strong>Azure Data Lake</strong>, but they are managed as first-class, cataloged assets through Unity Catalog.</p><p>This ensures better security, easier discovery, and smoother collaboration.</p><h3>Delta Lake + Unity Catalog vs. Parquet-based approach</h3><p>Parquet files were a good starting point. They gave us efficient compression and structured storage. But as our needs grew, it became clear that we needed something more powerful. This is where <strong>Delta Lake</strong> and <strong>Unity Catalog</strong> stand apart. Together, they take data management to a level that goes far beyond what Parquet alone can offer.</p><p>✨<em> </em><strong><em>Delta Tables benefits</em></strong></p><p><strong>Delta Lake</strong> builds directly on the strengths of Parquet but adds reliability and performance at scale. With full <strong>ACID transactions</strong>, we know that changes are applied completely or not at all, that tables remain consistent, and that concurrent reads and writes never interfere. Once a transaction succeeds, it is permanent, even in the face of failure. Delta Lake also introduces <strong>time travel</strong>, giving us the ability to roll back to past versions of the data for auditing, debugging, or recovery. Performance improves as well: features like <strong>Z-ordering</strong> help reorganize data for faster queries, while <strong>data compaction</strong> and <strong>auto-optimization</strong> reduce the small-file problem and keep queries efficient as data grows. On top of that, <strong>schema enforcement and evolution</strong> ensure integrity without blocking controlled changes. And perhaps most importantly, Delta Lake unifies batch and streaming pipelines in a single framework.</p><p>✨<em> </em><strong><em>Unity Catalog benefits</em></strong></p><p>If Delta Lake strengthens the technical foundation, <strong>Unity Catalog</strong> brings order and governance. It provides <strong>fine-grained security controls</strong>, down to the column level, ensuring sensitive data is protected without slowing teams down. Datasets are organized into <strong>catalogs</strong>, making them easier to discover, search, and sample. And with <strong>lineage and auditing</strong>, we can track how data flows and transforms end to end, ensuring compliance and transparency across the entire lifecycle.</p><p><strong>👌<em> The Perfect Pair</em></strong></p><p>Together, Delta Lake and Unity Catalog give us a platform that is reliable, secure, and built for scale. Something a Parquet-only setup simply could not achieve.</p><h3>Benefits we’ve seen</h3><p>Here’s how Delta Lake and Unity Catalog helped us overcome the challenges of a Parquet-only setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*xF-uRTDla2LtkHLhepzI3g.png" /></figure><p>The impact has been real. By moving to incremental updates, we cut storage costs by <strong>40% year-over-year</strong>. Ingestion times dropped by <strong>30%</strong>, pipelines run faster, and compute costs are lower thanks to fewer reruns.</p><p>Time Travel now makes debugging and answering client questions simple. We can reproduce exact historical states in seconds. And Unity Catalog has transformed governance: permissions are granular, sharing is secure, and GDPR compliance is built in.</p><p>Taken together, these improvements show that Delta Lake and Unity Catalog are not just a replacement for Parquet. They’re a foundation for scaling with confidence.</p><h3>Lessons learned</h3><p>The main takeaway? Small upgrades can have outsized effects.</p><p>Switching from Parquet to Delta might look like a minor technical detail, but it reshaped how we handle performance, governance, and data quality. Staying curious and keeping up with Databricks and Azure releases is what makes these leaps possible.</p><h3>Conclusion and Future Perspectives</h3><p>Moving to <strong>Delta Lake</strong> and <strong>Unity Catalog</strong> has been a decisive step forward. We’ve gained performance, reliability, simpler governance, and lower costs by replacing full rewrites with incremental, transactional pipelines.</p><p><strong>🧐<em> What’s next?</em> </strong><br>Our focus is on continuing to industrialize and open up the platform:</p><ul><li><strong>Delta Live Tables (DLT)</strong> to define resilient pipelines as declarative workflows, with built-in monitoring, quality checks, and recovery.</li><li><strong>Databricks Workflows</strong> to orchestrate jobs natively in Databricks, reducing the need for external schedulers or custom glue code.</li><li><strong>Databricks SQL</strong> to power governed self-service analytics, giving business teams fast access to trusted datasets without leaving the Lakehouse.</li></ul><p>We are also preparing to integrate the <strong>Databricks Marketplace</strong>, which opens two key opportunities. First, we will be able to <strong>consume</strong> curated third-party datasets (such as geospatial grids, traffic data, weather feeds, fuel indices, or port congestion) directly under Unity Catalog governance. Second, we plan to <strong>publish</strong> selected Upply assets, such as UFI time series or anonymized aggregates, through <strong>Delta Sharing</strong>. This makes them instantly available to customers and partners with no data duplication, full permission control, and complete auditing.</p><p>By staying proactive and leveraging Lakehouse innovations, we’ll keep raising the bar on reliability, speed, and efficiency, so our teams can make faster, better-informed decisions.</p><p><strong>Author</strong>: <em>Jaime Avila Farrar</em>, Data Engineer at <a href="https://medium.com/u/7ff5fd6f48cf">Upply</a></p><p><em>Contact me if you have any questions or would like to learn more about our ongoing data initiatives!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba028dee8e00" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/getting-things-done-with-databricks-a-bet-on-delta-lake-and-unity-catalog-ba028dee8e00">“Getting things done” with Databricks: a bet on Delta Lake and Unity Catalog</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The New Data Architecture at Upply]]></title>
            <link>https://medium.com/upply/the-new-data-architecture-at-upply-c63b1c57559a?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/c63b1c57559a</guid>
            <category><![CDATA[azure-databricks]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[databricks]]></category>
            <dc:creator><![CDATA[Alan Moria]]></dc:creator>
            <pubDate>Thu, 28 Aug 2025 08:08:41 GMT</pubDate>
            <atom:updated>2025-09-05T14:19:59.126Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In today’s data-driven world, organizations are under immense pressure to extract meaningful insights from ever-increasing volumes of data.</p><p>At Upply, we recently embarked on a transformative journey to redesign our analytics data architecture. This article explains why we made this change, how the new system works technically, and what it means for our business.</p><h3>Global Architecture Overview</h3><p>Below is an overview of Upply’s redesigned data architecture, highlighting the seamless interaction between key components like data sources, orchestration, compute, storage, and data exposure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_lv8bcGDJYvfsiuxmprVwg.png" /><figcaption>Upply’s Data Architecture</figcaption></figure><h3>Challenges of the Previous Architecture</h3><p>Our legacy architecture served us well for years but was no longer fit for purpose in the face of growing data demands — such as the export of new feature usage, client consumption tracking, user login analysis, client package history, and cross-KPI reporting.</p><p>Key pain points included:</p><ul><li><strong>Scalability Limitations</strong>: Growing data volumes led to slower query responses and higher maintenance costs.</li><li><strong>Data Silos</strong>: Fragmented storage systems hindered cross-functional analysis.</li><li><strong>Limited Flexibility</strong>: Adapting to new business requirements required significant manual intervention.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6bhIe3SGQjGHKKNwofdrA.png" /><figcaption>Old Data processing</figcaption></figure><p>Before implementing the new infrastructure, our workflow involved:</p><ul><li>Extracting data from backend databases using Azure Data Factory.</li><li>Loading data into Parquet files.</li><li>Transforming data within Parquet files stored on Azure Data Lake Gen 2.</li><li>Exporting transformed data as CSV or XLSX files, based on the specific needs of business or product teams, which were then shared via SharePoint.</li></ul><p>This infrastructure was difficult to maintain because the <strong>structure of the backend databases changed frequently</strong>, causing errors in our extraction and transformation scripts.</p><p>We could have solved this by setting up a strict process — like in many big companies, where the analytics team is always involved every time the backend changes, just to avoid problems. But let’s be honest: those kinds of processes are often heavy and mostly used to make up for the fact that teams don’t communicate well with each other. Additionally, creating custom extractions for the unique needs of each team required maintaining numerous scripts, further increasing complexity and overhead.</p><p>Another significant disadvantage was the daily full extractions of backend data, which were time-consuming and involved transforming large volumes of data — often several gigabytes — every day. This process was not only resource-intensive but also inefficient for handling incremental changes.</p><p>For example, generating weekly business intelligence reports could take up to 3 hours due to inefficient ETL pipelines and outdated infrastructure.</p><h3>Goals of the New Architecture</h3><p>The primary objective of this new infrastructure was to centralize data from multiple sources, making it easily accessible and exploitable by all teams at Upply. Additionally, we established clear objectives for our new data architecture:</p><ul><li><strong>Fast Insights</strong>: Enable fast processing of data through multiple batches per day, allowing near-real-time insights for decision-making.</li><li><strong>Unified Data Platform</strong>: Break down silos and provide a single source of truth.</li><li><strong>Cost Efficiency</strong>: Optimize resource utilization to reduce operational expenses.</li><li><strong>Future Ready</strong>: Ensure compatibility with emerging technologies like AI and machine learning improvements.</li></ul><h3>Technical Breakdown of the New Architecture</h3><p>Our backend operates on a microservice architecture, with approximately 10 services developed in PHP Symfony. These microservices communicate through messages exchanged via RabbitMQ. To ensure reliability, all messages are stored in dedicated tables in PostgreSQL, allowing them to be replayed in case of an issue.</p><p>Previously, we relied on events from the microservices or projection tables derived from those events. However, frequent changes such as column deletions or structural modifications in messages or tables often caused issues in our processes. To address this, we decided to create a dedicated analytics schema in PostgreSQL.</p><p>We implemented a consumer that retrieves messages from the microservices and projects them into analytics tables. These projections are different from those in the backend tables used by the application, because the needs are not the same, the analytics tables are designed for reporting and exploration, while the backend tables focus on operational use.</p><p>The schema of these tables is pre-defined by collaboration between our Data Engineering and Backend teams, ensuring consistency and resilience against structural changes.</p><p>These analytics tables contain all events from all microservices, with fields such as event_id, event_name, event_date, and others to ensure the rawest form of data is preserved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*ln0UO4CGNmf7LcKwQiXKSQ.png" /><figcaption>Event example</figcaption></figure><p>This approach enables maximum flexibility for downstream analysis while maintaining a consistent schema.</p><p>We also established a precise process for creating and modifying these tables. For example, when a new feature is introduced in the application, we simultaneously create a corresponding analytics ticket. This ensures that as soon as the feature goes live in production, an analytics table with a predefined schema is created and populated with relevant data. This process, defined collaboratively by the Data Engineering and Backend teams, ensures smooth integration and readiness for analysis from day one.</p><p>Once all these data are available, they must be extracted, transformed, stored, and exposed. For this, we decided to retain the same tools as before but use them differently:</p><ul><li><strong>Orchestration</strong>: Azure Data Factory.</li><li><strong>Compute</strong>: Azure Databricks.</li><li><strong>Storage</strong>: Databricks Unity Catalog, with managed tables stored on our Azure Data Lake.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEvk1U040QeDoyzFrTXAiw.png" /><figcaption>NewData processing</figcaption></figure><p>To facilitate this, we created a dedicated catalog in Databricks called Analytics, containing four schemas: raw, staging, clean, and checkpoint:</p><ul><li><strong>Raw</strong>: An exact copy of the data from PostgreSQL.</li><li><strong>Staging</strong>: Transforms the raw data by renaming columns, formatting fields, and filtering as needed.</li><li><strong>Clean</strong>: Aggregates data by entity to derive the final state of each object based on events from raw. This schema also normalizes and explodes the data into fact and dimension tables.</li><li><strong>Checkpoint</strong>: Stores the date of the last event retrieved for each table. This allows incremental data extraction from PostgreSQL, ensuring that only new events are fetched during subsequent runs, significantly improving efficiency.</li></ul><p>This layered approach ensures data is systematically processed and optimized for analysis and reporting.</p><h3>Key Benefits</h3><p>The transition to our new architecture has delivered measurable improvements:</p><ul><li><strong>70% Faster Queries:</strong> Improved performance, enabling faster decision-making</li><li><strong>Triple Data Capacity</strong>: Seamless scaling with business growth.</li><li><strong>50% Automation:</strong> Automating processes from repetitive tasks.</li><li><strong>Real-Time Insights:</strong> Empowering teams through self-service analytics.</li></ul><h3>Delta Tables and Unity Catalog: Why They Outperform Parquet</h3><p>Parquet files are efficient, but Delta Tables and Unity Catalog elevate data management with features that enhance reliability, governance, and performance. Here’s how they stand out:</p><h3>Delta Tables: Enhanced Reliability and Performance</h3><p>Delta Tables (Delta Lake) provide an optimized layer on top of Parquet files with additional features:</p><ul><li><strong>ACID Transactions:</strong> Delta Tables ensure consistent and reliable data operations, avoiding corruption issues common with Parquet.</li><li><strong>Time Travel:</strong> Access historical data versions for auditing and recovery — a feature unavailable in Parquet.</li><li><strong>Performance Boost:</strong> Features like <strong>Z-ordering</strong>, <strong>automatic indexing</strong> and <strong>compaction</strong> optimize queries and storage efficiency.</li><li><strong>Schema Management:</strong> Enforces and evolves schemas to maintain data consistency.</li><li><strong>Seamless Streaming:</strong> Integrates batch and real-time data pipelines effortlessly.</li></ul><h3>Unity Catalog: Simplified Governance</h3><p>Unity Catalog is a governance and metadata management layer in Databricks.</p><ul><li><strong>Centralized Security:</strong> Fine-grained access controls (e.g., column-level) streamline governance, unlike Parquet.</li><li><strong>Data Discovery:</strong> Organizes datasets into catalogs for easy search and metadata management.</li><li><strong>Auditing and Lineage:</strong> Tracks data access and operations for compliance and transparency.</li></ul><p>Combining Delta Tables and Unity Catalog creates a secure, performant, and governed ecosystem ideal for analytics and machine learning. Together, they address the limitations of Parquet and enable smarter data management</p><h3>Data Exposure</h3><p>For the initial phase, we have chosen Power BI as the sole tool for exposing data to end-users. Power BI provides dynamic dashboards and reports, empowering teams to derive insights in real time. The flexibility of Power BI ensures that business users can interact with the data without needing deep technical knowledge, enhancing decision-making across the organization.</p><h3>Challenges and Lessons Learned</h3><p>The journey to a modern data architecture came with challenges</p><ul><li><strong>Complex migration:</strong> Moving legacy data to the new platform required rigorous planning and execution.</li><li><strong>Skill Gaps</strong>: Ensuring all stakeholders understood the new tools and processes was critical.</li><li><strong>Iterative Adjustments</strong>: Continuous feedback loops were essential to optimize the system post-deployment.</li></ul><h3>Conclusion</h3><p>At Upply, we’ve moved away from an outdated system and built a more modern data architecture that brings real value to the business. This change isn’t just about tech, it’s about giving teams access to reliable, up-to-date data so they can make faster and better decisions.</p><p>And this is just the beginning. With this new foundation, we can now imagine more advanced use cases, like automating and scaling Power BI reports to support decision-making across the company.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c63b1c57559a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/the-new-data-architecture-at-upply-c63b1c57559a">The New Data Architecture at Upply</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding the Most Relevant Port Using Weighted K-Nearest Neighbors]]></title>
            <link>https://medium.com/upply/finding-the-most-relevant-port-using-weighted-k-nearest-neighbors-8f18044f61e8?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/8f18044f61e8</guid>
            <category><![CDATA[knn]]></category>
            <category><![CDATA[freight]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[zoning]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Rebours Baptiste]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 13:44:29 GMT</pubDate>
            <atom:updated>2025-02-26T13:44:29.542Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bbeb3fDw1UZD-4oQPVGENg.jpeg" /></figure><p>Upply digitizes the world of transportation, enabling its clients to obtain market price estimates, particularly for maritime transport. To achieve this, an Artificial Intelligence (AI) model — trained on millions of transports — is used. This model returns an estimate for a given origin port and destination port. However, clients can choose to provide only cities instead of directly specifying ports. In such cases, it becomes imperative for us to perform zoning to find the most relevant port based on the provided location. For this purpose, we decided to use <strong>K-nearest neighbors (KNN) weighted by port importance and using the Haversine distance</strong>. This article details our thought process on the subject.</p><h3>Diving into the World of Upply: Data at the Heart of Freight Transport</h3><h4>Upply: Technology Serving Freight Transport</h4><p>Upply is a digital platform revolutionizing freight transportation management by leveraging data and technology to enhance operational efficiency. Built on AI models trained on a vast database of several million transports, Upply offers a suite of solutions that empower businesses to compare prices, anticipate market fluctuations, optimize costs, and streamline their operations.</p><p>Serving a diverse range of clients — including shippers, carriers, freight forwarders, and consulting firms — Upply provides essential tools for price analysis, carrier sourcing, shipment tracking, administrative management, and CO₂ impact assessment. By combining cutting-edge technology with deep industry expertise, Upply simplifies and optimizes transport operations, making the supply chain more accessible, efficient, and transparent.</p><h4>Data: The Engine Behind Transport Price Prediction</h4><p>To determine the price of transporting goods, several factors come into play: the mode of transport, the departure and arrival locations, the transport date… And, of course, all the details about the goods themselves: weight, volume, content, etc. Upply’s AI models learn from these diverse data sources, identify the decisive parameters for pricing, and can estimate costs with precision.</p><p>Thus, a client can provide an origin location, a destination location, and details about the goods being transported, and the model returns a price estimate. This is how the models work for the three types of transport managed by Upply: road, air, and maritime.</p><p>For maritime transport, the model is slightly more specific, as it is composed of sub-models that take one or more ports as input locations. If a client decides to benchmark between cities, we must then find the most relevant ports for those cities.</p><h4>Maritime: A Unique Ecosystem</h4><p>To begin, it is important to understand how maritime transport works. It is generally divided into the following stages:</p><figure><img alt="Picture showing the different stages of a sea freight shipment" src="https://cdn-images-1.medium.com/max/909/1*ciaTFDa0fs5FKPAPv3gSyg.png" /><figcaption>Decomposition of a maritime transport</figcaption></figure><p>First, the goods are transported from a warehouse to the origin port (<em>pre-carriage</em>). Then they are shipped by boat from the origin port to the destination port (<em>main leg</em>). Finally, they are delivered from the destination port to a new warehouse (<em>post-carriage</em>).</p><p>The total transport cost is the sum of the cost of each segment. At Upply, two distinct models predict the cost of these three segments: the <em>freight</em> model for the <em>main leg</em> and the <em>carriage</em> model for the <em>pre-carriage</em> and <em>post-carriage</em> segments.</p><p><strong>Zoning is Necessary for Non-Port Locations</strong></p><p>We saw that the <em>freight</em> model can estimate the price of the <em>main leg</em>, meaning the transport cost between two ports. However, a client may want to know the price for a transport between two cities, or between a city and a port — for example, between Paris and the port of Shanghai. In this case, before using the <em>pre-carriage</em> and <em>freight</em> models for the estimate, it is necessary to choose the port through which the goods will flow from Paris before reaching the port of Shanghai.</p><p>It is therefore essential to <strong>find the most relevant port corresponding to the location provided by the user</strong>. At Upply, the relevance of a port relative to a city is measured by the port’s <strong>logistical importance</strong> and the <strong>distance</strong> separating them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*btw096nj8uDACss5IblKFQ.png" /></figure><h3>Our Approach in a Few Steps</h3><p>We aim to associate a port with each location. To do this, we use a classification algorithm: K-nearest neighbors (KNN). We test the effectiveness of our various solutions on a sample of French municipalities.</p><h4>KNN: The Key Tool for Zoning</h4><p><strong>KNN: The Ideal Algorithm for Distance-Based Classification</strong></p><p>KNN is an algorithm that relies on the distance between observations to categorize them into groups. The fundamental idea behind KNN is to find the <em>k</em> samples closest to a given point in the feature space. For classification, it assigns the most frequent label among its neighbors to that point. The default metric used to calculate the distance between points is generally the Euclidean distance.</p><p>The choice of <em>k</em>, the number of neighbors, is crucial to strike the right balance between specialization and generalization. Here, since we want to associate a location with its most relevant port, we use <strong>k = 1</strong>.</p><p><strong>Applying KNN with Euclidean Distance</strong></p><p>We test KNN with the Euclidean distance to associate a port with each French municipality. The ports used are all those in the Upply database.</p><p>We obtain the following result:</p><figure><img alt="Map showing the zoning with KNN and Euclidean Distance assigning each French commune to a port" src="https://cdn-images-1.medium.com/max/760/1*TXDEg2kK-h2KQaFgMJ247A.png" /><figcaption>Zoning with KNN and Euclidean Distance</figcaption></figure><p>As seen on the map, each municipality is associated with its closest port based on Euclidean distance. This distance corresponds to the straight-line distance between two points:</p><figure><img alt="Representation of Euclidean distance in two-dimensional space" src="https://cdn-images-1.medium.com/max/283/1*8wWtuLR8kP0IOi3bZX8mww.png" /><figcaption>Euclidean Distance</figcaption></figure><p>This measure is simple to compute and thus not computationally intensive (here, 1.35 seconds for classifying 20,000 municipalities), but it does not take into account the Earth’s curvature.</p><h4>The Haversine Distance: Superior Geographic Accuracy</h4><p><strong>Calculating Distances on Earth Using the Haversine Formula</strong></p><p>When working with geographic coordinates, using the Euclidean distance can lead to inaccuracies, especially over long distances.</p><p>In contrast, the Haversine distance — based on the eponymous formula — is specifically designed to measure distances on a sphere like Earth. However, this formula is more complex and thus more computationally demanding.</p><figure><img alt="Representation of Haversine distance on a sphere" src="https://cdn-images-1.medium.com/max/283/1*Qzd87jBo7CnOjCiZT5eaBA.png" /><figcaption>Haversine Distance</figcaption></figure><p><strong>KNN with Haversine to Enhance Zoning Accuracy</strong></p><p>We test our algorithm on the same municipalities, modifying only the distance metric used to determine the nearest neighbor by using the Haversine distance.</p><p>Here is the result:</p><figure><img alt="Map showing the zoning with KNN and Haversine Distance assigning each French commune to a port" src="https://cdn-images-1.medium.com/max/771/1*adai43PIzHGppINKn5ughA.png" /><figcaption>Zoning with KNN and Haversine Distance</figcaption></figure><p>We notice that using the Haversine distance slightly adjusts some zones, correcting the inaccuracies mentioned earlier. However, the computation time is significantly longer: 19.08 seconds for classifying 20,000 municipalities versus 1.35 seconds with the Euclidean distance.</p><p>So, Euclidean or Haversine?</p><p>Since we do not have millions of queries to handle simultaneously, the increased computation time is not a major issue. Although there is nearly a 20-fold difference in calculation time, the time per query remains minimal. Therefore, we favor the precision of the Haversine method over the efficiency of the Euclidean method.</p><p><strong>Beyond Distance: Incorporating the Logistical Importance of Ports</strong></p><p>A new challenge arises when observing the zoning results on the map above. For instance, the ports of Rouen (FRURO), Montoir (FRMTX), and La Pallice (FRLPE) have much larger zones than that assigned to the port of Le Havre (FRLEH).</p><p>However, according to our industry expertise, the port of Le Havre (FRLEH) is the most logistically important port in France, and one of the most significant in Northern Europe. Its area of influence should therefore be much larger. We thus decide to factor in not only the distance but also the logistical importance of the ports.</p><h4>Measuring the Logistical Importance of Ports</h4><p><strong>Connectivity Index: The Key to Evaluating Port Importance</strong></p><p>To assess the logistical importance of ports, we use the <a href="https://unctadstat.unctad.org/datacentre/dataviewer/US.PLSCI">Port Liner Shipping Connectivity Index (PLSCI)</a> calculated by the United Nations Conference on Trade and Development (UNCTAD). The PLSCI reflects the position of ports in the global liner shipping network. It considers several factors, including:</p><ul><li>The number of vessels scheduled per week at the port</li><li>The annual cargo capacity deployed, measured in twenty-foot equivalent units (TEUs)</li><li>The number of shipping companies offering liner services to and from the port</li><li>The number of ports connected to the port</li></ul><p>The PLSCI is calculated quarterly for each port, and its value is expressed as a ratio relative to the highest value in Q1 2006, multiplied by 100.</p><p>The initial dataset contains around 1,300 ports, from which we retain only those with at least 3 data points over the past 5 years (to ensure statistical relevance for comparisons) and that are included in our internal database. The final port database contains 945 ports. For each port, we have:</p><ul><li>Its UN/LOCODE (port identifier code)</li><li>Its importance (average importance over each quarter)</li><li>Its geographic coordinates (latitude and longitude)</li></ul><figure><img alt="Table of most important ports in France and neighboring countries as of 2023, with their importance score and geographical coordinates" src="https://cdn-images-1.medium.com/max/239/1*g6LxBDD3mq32vpN2MKcMkw.png" /><figcaption>Most Important Ports in France and Neighboring Countries as of 2023</figcaption></figure><p>The most significant ports in Western Europe (excluding the United Kingdom) are Rotterdam (NLRTM), Antwerp (BEANR), and Hamburg (DEHAM). In France, the dominant ports are Le Havre (FRLEH), Dunkerque (FRDKK), and Fos-sur-Mer (FRFOS).</p><p><strong>Weighted KNN: Combining Distance and Logistical Importance</strong></p><p>As mentioned earlier, we want to assign to a location the most relevant port, not just the nearest one. Therefore, we do not simply use the basic algorithm that computes the Haversine distance between the location and each port and assigns the nearest port.</p><p>Instead, we use a variant of KNN known as weighted KNN. This alternative to classic KNN allows us to assign different weights to observations, taking them into account when searching for the nearest neighbors. The nearest neighbors are no longer determined solely by geographic proximity; we now consider their weight. Thus, an observation that is farther away from our target point but more important can be deemed the nearest neighbor, depending on the distance/weight weighting applied.</p><p>In our case, we weight the Haversine distance by the importance of the ports. More precisely, to find the nearest neighbor, we divide the distance from the location to each port by its importance.</p><p>Here is the resulting outcome:</p><figure><img alt="Map showing the zoning with Weighted KNN and Haversine Distance assigning each French commune to a port" src="https://cdn-images-1.medium.com/max/690/1*AOsVCvfEfZ5NCrnqvGk3XQ.png" /><figcaption>Zoning with Weighted KNN and Haversine Distance</figcaption></figure><p>We observe that French municipalities are now assigned to fewer distinct ports. Ports with very low importance are no longer selected, as the algorithm favors a more important port even if it is farther away. The extent of the zone assigned to each port now depends on both its location and its importance, which aligns more closely with market reality according to our industry expertise.</p><p>For example, the port of Dunkerque (FRDKK) is more important than the port of Fos-sur-Mer (FRFOS), yet fewer locations are assigned to it. This is because it is close to two more important ports, Antwerp (BEANR) and Le Havre (FRLEH), while Fos-sur-Mer (FRFOS) faces two ports with similar importance.</p><p>Moreover, the port of Le Havre (FRLEH) is now the designated port for a large part of western France, which was not the case with the previous zoning version. However, some locations are still assigned to ports of medium or even low importance.</p><figure><img alt="Zoom on Western France — Map showing the zoning with Weighted KNN and Haversine Distance assigning each French commune to a port" src="https://cdn-images-1.medium.com/max/772/1*jJa5J3xt_4aJyklt9bUA5A.png" /><figcaption>Zoom on Western France with Weighted KNN and Haversine Distance</figcaption></figure><p>Zooming in on western France, we notice that the zoning assigns some municipalities to ports such as Brest (FRBES), Montoir (FRMTX), or La Pallice (FRLPE). This is due to their importance, which, although significantly lower than that of Le Havre (FRLEH), is sufficient to allocate them a certain number of municipalities.</p><p>According to our industry expertise, goods from these locations almost exclusively depart from the port of Le Havre (FRLEH), with the other ports (e.g., FRBES, FRMTX, and FRLPE) being used only in very specific cases. We thus modify our algorithm to better align with market reality.</p><h4>Expertise Beyond the Data</h4><p><strong>Filtering Ports to Retain Only the Most Significant</strong></p><p>We do not want to assign the port of Brest (FRBES) to municipalities in Brittany, because, based on industry expertise, we know that the port of Le Havre (FRLEH) is almost the only port systematically used for locations in western France.</p><p>Therefore, we filter the ports used by our algorithm to retain only the most important ones, all in collaboration with our industry experts.</p><p><strong>Our Zoning Closely Reflects Market Reality</strong></p><p>Finally, after filtering the ports used in the zoning, we obtain the following result:</p><figure><img alt="Map showing the zoning with Weighted KNN, Haversine Distance, and Significantly Important Ports assigning each French commune to a port" src="https://cdn-images-1.medium.com/max/694/1*KkeLjbh1dAqyR1qzLhM55g.png" /><figcaption>Zoning with Weighted KNN, Haversine Distance, and Significantly Important Ports</figcaption></figure><p>We note that only two French ports (Le Havre — FRLEH and Fos-sur-Mer — FRFOS) are now returned, compared to thirteen before filtering. These ports respectively cover northwestern and southeastern France. Meanwhile, northeastern, southwestern, and extreme southeastern regions of the country are assigned to the most important ports of neighboring countries — Antwerp (BEANR), Barcelona (ESBCN), and Genoa (ITGOA).</p><p>We compare our results with the map of economic influence and attraction zones of ports, also known as hinterlands:</p><figure><img alt="Map of French Hinterlands" src="https://cdn-images-1.medium.com/max/804/1*w4MOda6Y2MUA9X69QQNYUg.png" /><figcaption>Map of French Hinterlands (Source: Upply)</figcaption></figure><p>Overall, our classification is satisfactory and remains very close to what is observed in reality. We recover the ports of Le Havre (FRLEH), Fos-sur-Mer (FRFOS), and Antwerp (BEANR) which respectively cover western, southeastern, and northeastern France. As indicated by our industry experts, ports such as Brest (FRBES) or Montoir (FRMTX) are not used, being sidelined in favor of the port of Le Havre (FRLEH). However, some differences remain between our classification and the hinterland map.</p><h3>A Functional and Efficient Algorithm</h3><h4>Zoning with Weighted KNN</h4><p>The objective was to develop an algorithm that finds the most relevant port corresponding to the location provided by the user, enabling the use of the benchmark model when a port code is not directly specified.</p><p>The algorithm presented in this article — KNN with Haversine distance weighted by port importance — perfectly addresses the stated problem. KNN with k = 1 enables zoning. Using the Haversine metric for distance calculation provides better precision than the Euclidean metric by accounting for the Earth’s curvature, without being too computationally intensive. Finally, employing weighted KNN allows us to consider the critical aspect of a port’s relevance — its logistical importance. The port of Le Havre (FRLEH) is not as important as Fos-sur-Mer (FRFOS); their zones of influence are affected accordingly, and it is imperative to account for this in the algorithm. As in most data projects, industry expertise is essential to deliver a product that meets expectations. Here, we used expert insights to filter out ports that are rarely used by clients, except in exceptional cases.</p><p>This algorithm does not perfectly mirror market reality — as seen with the hinterland map — but it represents an excellent compromise between complexity and performance. We are very satisfied with the proposed solution.</p><h4>Areas for Improvement</h4><p>Our classification differs from the hinterland map in the zones of influence for the ports of Le Havre (FRLEH) and Fos-sur-Mer (FRFOS). Based on expertise, the influence of these ports is greater than that of foreign ports in their respective regions. We could therefore refine the importance index we calculated to address these points.</p><p>Moreover, our zones are delineated rather crudely due to the simplicity of our algorithm. In contrast, hinterlands are much more nuanced. A striking example is the area around Paris. Our classification divides it into two — the western part being assigned to Le Havre (FRLEH) and the eastern part to Antwerp (BEANR) — whereas in reality, the entire region is served by Le Havre (FRLEH), as seen on the hinterland map. We could adjust our algorithm to incorporate other factors such as administrative boundaries (departments, regions), topography (natural relief, road networks), and demographics (population size).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f18044f61e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/finding-the-most-relevant-port-using-weighted-k-nearest-neighbors-8f18044f61e8">Finding the Most Relevant Port Using Weighted K-Nearest Neighbors</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Upply Chose PHP Over Scala, Go, and Rust]]></title>
            <link>https://medium.com/upply/why-upply-chose-php-over-scala-go-and-rust-465ab404d25c?source=rss----10a09731d1c---4</link>
            <guid isPermaLink="false">https://medium.com/p/465ab404d25c</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[symfony]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Florent Laval]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 13:56:49 GMT</pubDate>
            <atom:updated>2024-12-05T13:56:49.061Z</atom:updated>
            <content:encoded><![CDATA[<h3>The PHP Advantage: How We Resisted the Switch to Scala, Rust, or Go</h3><figure><img alt="There are so many languages to build the same application — or are there?" src="https://cdn-images-1.medium.com/max/700/1*WrBewVdR1DzdD7ItIjnBcQ.png" /></figure><p>Let’s begin with a quick introduction: I’m Florent, Chief Technical and Data Officer at <a href="https://www.upply.com/">Upply</a>: the Tech platform striving to revolutionize freight transportation. I joined the company in 2017 as a Data Scientist and gradually transitioned to managing both data and IT teams by 2022.</p><p>This article is about the tough choice we faced in 2022, when we re-opened the discussion around changing the main back-end language we had been using since Upply’s inception: <em>PHP</em> — and why we ultimately decided to keep it. We won’t dive <em>too much</em> into the technical specifics of the language itself, as the principles we discuss can apply to any language decision.</p><h3>Marketplace Challenges in a Fast-Evolving Environment</h3><p>At Upply, we drive the digitalization of the supply chain by offering accessible, high-performance, and sustainable solutions. Our goal is to help users make smarter decisions, industrialize and optimize their freight shipments.</p><ul><li><em>Smart</em>: a machine learning-powered solution providing insights on freight prices worldwide (sea, air, and road freight), forecasts, and expert-written articles to help users stay informed and reduce costs or increase margins.</li><li><em>Connect</em>: a freight marketplace where shippers can post loads, carriers can bid, and once a match is made, the shipment details are tracked in real-time, with payment processed in less than a week for carriers.</li></ul><p>These two solutions require different architectural logics: <em>Smart</em> focuses on displaying data and machine learning outputs, while <em>Connect</em> demands a high-performance, stable marketplace.</p><h3>Rebuilding the Marketplace: From Version 1 to Version 2</h3><p>The first version of <em>Connect</em> was developed during the COVID period. However, it was built based on assumptions from Upply’s previous executive committee rather than user-centric needs. When it launched, it didn’t resonate with users — the platform lacked usability, and engagement never reached critical mass.</p><p>In 2022, after a change in the executive committee, I took on the technical lead role. My first big decision was to scrap <em>Connect v1</em> and rebuild it from scratch, this time with a clear focus on user needs.</p><h3>Performance, Scalability, and Reliability: What Our Architecture Demands</h3><p>Starting from scratch gives you the opportunity to rethink everything, which inevitably leads to asking some tough questions. Technical choices at such times can be fundamental, and poor decisions can create massive technical debt that lingers through multiple generations of developers. These issues become “company constraints” — too heavy to fix and something you just have to live with.</p><h3>Key Architectural Decisions: Monolith vs Microservices</h3><p>As we embarked on the <em>Connect v2</em> project, we discussed everything — from the overall architecture (monolith vs. microservices, queues vs. event-driven systems, CQRS, etc.) to deeper questions, like which programming language to use.</p><p>We’ll dive deeper into each of these technical topics in future articles. Let us know in the comments which one you’d like to read about first.</p><h3>Should We Stick with PHP or Move to Scala, Rust, or Go?</h3><p>One major question that arose: should we stick with our PHP Symfony stack, or should we migrate to something fancier and more suited to our performance needs — perhaps Scala, Rust, or Go?</p><p>This was an easy question to ask but a tough one to analyze. And even harder to implement if we decided to.</p><p>In <em>Connect v2</em>, shippers post loads, carriers offer quotes, and shippers must select or reject offers in real time. Once a shipment is accepted, both parties are kept informed of each step of the shipment’s journey. This required a system that could process events in a specific order, ensuring that real-time updates were reliable and accurate.</p><p>For instance, you can’t load a truck if the shipment has already been delivered. While this seems obvious from a business standpoint, handling event sequences correctly in code, at scale, can be tricky. And beyond accuracy, the system needed to handle massive volumes of transactions efficiently — a slow marketplace is simply a failed marketplace. These constraints had to be central in every architectural decision.</p><h3>PHP: From Skepticism to Success in a Scalable System</h3><p>When you think about PHP, especially for a complex system like a marketplace, the initial reaction is often skepticism. PHP has a long history, but it’s often seen as a “legacy” language. Compared to modern languages like Scala, Rust, or Go, PHP is frequently criticized for its performance, scalability, and modern development capabilities.</p><h3>PHP vs Modern Languages: Can It Handle the Load?</h3><p>At Upply, our initial discussions echoed these concerns. Could PHP really handle the load, the concurrency, and the real-time data processing we needed? This is where Scala (known for its scalability and functional programming), Rust (for high performance and memory safety), and Go (praised for its efficient concurrency) seemed like strong contenders and attractive alternatives.</p><p>But here’s where PHP surprised us. Over the years, it has evolved, especially with modern frameworks like Symfony that provide a robust ecosystem capable of supporting large-scale applications. By applying the right architectural patterns — like microservices, event-driven systems, using roadrunner, CQRS — we realized that our PHP Symfony stack could meet the high-performance requirements needed for our upcoming marketplace.</p><p>What PHP might lack in “hype” or modern cachet, it makes up for in stability, developer productivity, and a mature business-oriented ecosystem. Ultimately, the success of our platform wasn’t about the language itself but how we architected the system using the right tools and practices.</p><h3>Assessing the Migration Costs: PHP vs Scala, Rust, and Go</h3><p>When considering a migration, it’s not just about rewriting code. The true cost includes opportunity costs, learning curves, and the inherent risks involved. Migrating from PHP to Scala, Rust, or Go would have required a substantial investment in training and recruitment. While each language offers specific advantages — Scala for scalability, Rust for performance and safety, and Go for simplicity and concurrency — but each introduces its own complexities.</p><h3>Why We Ruled Out Rust Early On</h3><p>At a high level, we quickly ruled out Rust. Despite its innovation and high performance, Rust is the most complex language on our list. After a cost-benefit analysis, we realized that while Rust could boost performance, the productivity losses due to the learning curve outweighed the gains for our team.</p><p>Rust is a fantastic language, but if you have an experienced team in another language, the cost-benefit analysis is crucial. You need to weigh performance gains against the learning curve for your specific use case. In our case, Scala, Go and PHP would perform a bit worse, but we would benefit from all other factors a language may possess.</p><h3>The Recruitment and Onboarding Challenge</h3><p>Speaking of key factors: recruitment and onboarding should be included in your main focal points. Scala, and Go developers are in high demand, but the talent pool is relatively smaller compared to PHP. Hiring experts in these languages would be costly and time-consuming, potentially delaying key projects.</p><p>Moreover, onboarding new hires or training our existing team would have taken time, impacting our ability to quickly deliver value to users on a short-term point of view, which might still be interested for your stakeholders if you’re in a time of needed results.</p><p>I need to add a special note on these specific other languages: Scala and Go talent pools are a bit different and need to be apprehended in a different way as well.</p><p><strong>Scala’s Talent Pool: Highly Skilled but Limited</strong></p><p>The Scala talent pool, while highly skilled, is quite limited. Many Scala developers initially learned more mainstream languages like Java or PHP before transitioning to Scala. While this means the talent pool is generally more experienced, scaling a team with Scala developers can be challenging due to the smaller number of available candidates.</p><p><strong>Go’s Talent Pool: Growing but Younger</strong></p><p>On the other hand, Go developers tend to be younger and less experienced, as Go is increasingly being taught as a first language in some countries. Go’s simplicity and performance make it attractive, but the pool of experienced developers is still growing, which can pose challenges when building highly scalable, complex systems.</p><h3>PHP’s Talent Pool: Abundant but Volatile</h3><p>Conversely, <a href="https://survey.stackoverflow.co/2024/technology/">PHP developers are more abundant</a>, but the talent quality is more volatile. Since PHP is one of the most widely used programming languages, you’ll find a mix of bad, mediocre, and great developers. However, the advantage is that you have a larger pool of talent to select from, and the recruitment process can be streamlined by focusing on identifying top talent.</p><p>We knew that to ensure success, we’d need to be cautious during recruitment, spending extra time to identify great PHP developers. While this process might be more time-consuming upfront, it ensures that we build a team capable of delivering high-quality work quickly <em>(note: pssst, we’re recruiting</em> 👀*).*</p><h3>Balancing Talent Quality and Team Experience</h3><p>At Upply, our PHP team already had extensive experience. Shifting to a new language like Scala or Go would introduce risks, such as dissatisfaction and turnover, as developers might feel less comfortable or productive in a language they don’t know well.</p><p>Ultimately, the decision to remain with PHP wasn’t purely technical. It was driven by a combination of team expertise, recruitment challenges, and a need for long-term sustainability. Migrating to another language would have affected not only our codebase but also our people and culture.</p><h3>Why PHP Was the Right Call for Our Team and Marketplace</h3><p>Ultimately, our choice to stick with PHP was based on pragmatism and long-term vision. It wasn’t about favoring one language over another, but about making sure we had a sustainable and scalable architecture while leveraging the strengths of our current team.</p><p>By choosing PHP, we avoided the considerable costs and risks associated with transitioning to Scala, Rust, or Go. While these languages offer compelling advantages for high-performance systems, PHP allowed us to continue building at speed, with a team ready to deliver from day one. PHP’s mature ecosystem and large community also give us the flexibility to scale our team without friction, ensuring we can meet both our technical and organizational goals.</p><h3>PHP for the Future: Evolving Without Lock-In</h3><p>This decision has borne fruit. With <em>Connect v2</em>, we’ve built a marketplace that’s fast, reliable, and user-friendly. Our PHP-based event-driven micro-services architecture handles high volumes efficiently, allowing us to iterate quickly and meet user demands without sacrificing performance.</p><p>Looking forward, our decision to stay with PHP doesn’t lock us in forever. As the tech landscape evolves, we continue to evaluate options like Scala, Rust, and Go to ensure we’re always using the best tools for our needs. For now, though, PHP remains the best fit for our team, our users, and our business.</p><p>Interestingly, we’ve already begun integrating Go for some of our microservices, specifically to boost performance between our back-end and front-end or public gateways. As mentioned before, Go is a language that is easier to understand and learn, with amazing -but limited- libraries.</p><p>The key takeaway: Choosing the right language matters, but it’s just one part of a much larger puzzle. What truly matters is how well that language fits the business’s needs, the team’s strengths, and the ability to scale both technology and talent effectively.</p><p><em>Thanks to Anès, Julien, Stanislav, Maxime.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=465ab404d25c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upply/why-upply-chose-php-over-scala-go-and-rust-465ab404d25c">Why Upply Chose PHP Over Scala, Go, and Rust</a> was originally published in <a href="https://medium.com/upply">Upply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>