Architecture Weekly #140

Architecture Weekly Issue #140. Articles, books, and playlists on architecture and related topics. Split by sections, highlighted with complexity: 🤟 means hardcore, 👷‍♂️ is technically applicable right away,  🍼 - is an introduction to the topic or an overview. Now in telegram and Substack as well.

Sponsored

Depot Managed GitHub Actions runners offer caching that's 10x faster than GitHub's own solution, and at half the cost. It’s the secret to boosting your CI/CD pipelines without breaking the bank. Find out how it works!

Highlights

How Discord Reduced Websocket Traffic by 40% 👷‍♂️

TL;DR: Discord tried a new compression algorithm, failed initially but then was extremely successful. At the same time the article is the fun read with technical details on the usage of dictionaries in data compression and learnings about roll-outs.

How Discord Reduced Websocket Traffic by 40%
How we rolled out zstandard and other improvements across our gateway cluster to reduce the amount of bandwidth that’s used by our clients.

#performance

The different types of events in event-driven systems  🍼

When building event-driven systems you can use events that contain all the information that potentially can be useful. On the other side of the spectrum you can just an event with the related entity id. What should you do? Frand de Jonge demonstrates three types of events and compares their pros and cons

The different types of events in event-driven systems
Event-driven systems come in all sorts of shapes and sizes. The obvious commonality is; they all use events to communicate information. These events come in many shapes and sizes, and determining what goes into an event has an immense impact on the design of your system. In this post I’d

#ddd

How Shopify improved consumer search intent with real-time ML 👷‍♂️

We used to write "jeans" or "hat" in the search bar in e-Commerce, but what if we could write "Warm teenage clothes for winter" instead? This is what Shopify rolled out with real-time ML. Find the deeply technical article how it was made possible.

How Shopify improved consumer search intent with real-time ML (2024) - Shopify
In the dynamic landscape of commerce, Shopify merchants rely on our platform’s ability to seamlessly and reliably deliver highly relevant products to potential customers. Therefore, a rich and intuitive search experience is an essential part of our offering. Over the past year, Shopify has been integrating AI-powered search capabilities into our merchants’ storefronts. Shopify Storefront Search has transformed the way consumers can shop online. With Semantic Search, we went beyond keyword matching. We improved our understanding of the intent behind a consumer’s search, so that we could match a search with the most relevant products. The net result is helping our merchants boost their sales while offering positive interactive experiences for their consumers. It’s a win-win! Building ML assets with real-time Embeddings Around the same time, Shopify also started investing in creating foundational machine learning (ML) assets. These assets are built as a shared repository of ML primitives which are used as reusable building blocks for more sophisticated AI systems. Shopify Storefront Search is the perfect use case for these ML assets. Complex systems like this need primitives that can transform both text and images into data formats it can process. How do we do that? Enter embeddings, which translate textual and visual content into numerical vectors in a high-dimensional space. This transformation allows us to measure the similarity between different pieces of content, whether text or images, enabling more accurate and context-aware search results. Simplified example of using embeddings to compare search text to result corpus Now that we have a clear idea of the ML primitives that Shopify Storefront Search relies on, let’s take a look at how we send these embedding updates to their systems. Designing ML inference streaming pipelines Currently, Shopify processes roughly 2,500 embeddings per second (or roughly 216 million per day) across our image and text pipelines in near real time. These embeddings include net-new or updated content from across our merchants. Since most of our data platform infrastructure is built on BigQuery,

#ml #casestudy

Follow-Up

Examples of Zero-Knowledge proofs 🍼

Zero knowledge is a useful cybersecurity concept yet to be widely adopted. Nevertheless, it's worth to understand the examples of the proofs that can be presented to show that one pocesses a secret without revealing it. Follow the article for such examples(Waldo inside!)

Understanding Zero-knowledge proofs through simple examples
I recently listened to this ZKFM podcast, which gave illustrative examples that clearly explained key concepts on zero knowledge proofs. I…

#security

Crafting the Ultimate Docker Image for Spring Applications 👷‍♂️

Recently we read about how AWS Lamda sped up the cold start of functions via caching of docker layers; apparently you can apply the same approach for your own apps to optimize the pull size. Pasha Finkelstein shows how to do that in his deck.

#performance

Testing a React App in Chrome 👷‍♂️

End-to-end tests is a good way to ensure that the app's basic scenarios are operational. But you can't rely on tests running on local machines; you rather need to run those tests on CI. Heroku shared how it can be done on general CI and on Heroku CI as well.

Testing a React App in Chrome with Heroku CI
Automate end-to-end testing for React apps with Heroku CI. See how to use the Chrome for Testing Heroku Buildpack for seamless browser testing integration.

#quality

Dead code, Zombie servers 🍼

The rare topic as it is, but have you thought how bad of underutilization are your apps and servers? Holly Cummins shares some statistics about the average server running at 18% capacity still consuming 60% of maximum power. That's sad and probably at the Halloween Eve we should about lean usage of resource once more.

Zombie Menace, Vampire Peril - Holly Cummins
It’s the spookiest time of year! You might think spookiness and tech are unrelated, but you’d be wrong. Well, actually, you’d probably be…

#sustainability

Scalability! But at what COST? 🤟

The paper introduces the concept of "COST" (Configuration that Outperforms a Single Thread) as a metric to evaluate the true performance of scalable big data systems. COST assesses how much hardware is required for a distributed system to surpass the performance of a single-threaded implementation. The authors highlight that many distributed systems exhibit high COST due to excessive parallelization overhead, questioning the actual performance benefits of such systems compared to simple, single-threaded alternatives.

#paper #scalability