<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nasim</title>
    <description>The latest articles on Forem by Nasim (@n451m).</description>
    <link>https://forem.com/n451m</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1144755%2F9349a350-e03f-4d76-ae6c-283e7e6d7111.png</url>
      <title>Forem: Nasim</title>
      <link>https://forem.com/n451m</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/n451m"/>
    <language>en</language>
    <item>
      <title>Distributed Tracing and W3C Trace Context</title>
      <dc:creator>Nasim</dc:creator>
      <pubDate>Mon, 13 Apr 2026 17:45:01 +0000</pubDate>
      <link>https://forem.com/n451m/distributed-tracing-and-w3c-trace-context-2p4n</link>
      <guid>https://forem.com/n451m/distributed-tracing-and-w3c-trace-context-2p4n</guid>
      <description>&lt;p&gt;When a user makes a single request to an application or clicks “checkout” on an e-commerce site, it involves multiple services, API gateway → auth service → cart service → Redis cache → inventory database → payment → notification. Traditional logs show what happened within a single service. Distributed tracing shows the entire story of a request as it traveled across all the services in the application. &lt;/p&gt;

&lt;p&gt;The core data model has &lt;em&gt;three&lt;/em&gt; concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trace - journey of request. Each trace has unique trace-id&lt;/li&gt;
&lt;li&gt;Span - unit of work within that trace defined with a start time and duration. Could be calling another service, doing a database query. Child spans are also created &lt;/li&gt;
&lt;li&gt;Context - the metadata that goes with the request to tell each service that this request is part of another request. This the W3C Trace Context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6in4lwamxm59iph5d5t8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6in4lwamxm59iph5d5t8.png" alt="Gantt chart" width="800" height="510"&gt;&lt;/a&gt;&lt;br&gt;
The Gantt chart (known as a waterfall) immediately shows you the critical path for the application. &lt;br&gt;
Auth → Cart → Inventory → Payment&lt;br&gt;
&lt;strong&gt;Reading the Gantt Chart&lt;/strong&gt;&lt;br&gt;
Each horizontal bar represents one span of work within one service. The left edge of each bar is the start time of that work, the right edge is the finish time, and the width is the length of that span of work. The vertical axis represents the different services, and the horizontal axis is the wall-clock time between 0ms and 600ms.&lt;br&gt;
The vertical lines that are indented within each service represent the parent-child relationships between those services. Each service’s work starts directly when these vertical lines start: it was called directly by its parent service.&lt;/p&gt;

&lt;h4&gt;
  
  
  Look at the time at when each service starts:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Auth service starts at ~20ms and finishes at ~100ms. API Gateway must authenticate the user before continuing with any other work; Cart cannot start until Auth is complete.&lt;/li&gt;
&lt;li&gt;Cart service starts at ~110ms (after Auth) and makes an inline call to Redis (a child service). Cart cannot return successfully to its caller until Redis returns.&lt;/li&gt;
&lt;li&gt;Inventory service starts at ~270ms (after Cart) and makes an inline call to Postgres (a child service). Postgres is called inline so that the Inventory service can return to Cart with the requested inventory information.&lt;/li&gt;
&lt;li&gt;The Payment service starts at ~410ms (after Inventory is called) and takes 140ms to complete (the longest task after the API Gateway’s root span).&lt;/li&gt;
&lt;li&gt;The Notification service starts at ~555ms and is very short at ~25ms in length. This is likely a fire-and-forget service that is called asynchronously when the Purchase operation is complete.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The process strictly follows a sequence: Auth → Cart (with Redis) → Inventory (with Postgres) → Payment → Notification. None of these steps run simultaneously. That’s the main issue—the design enforces a linear chain when, in theory, some parts could operate in parallel.&lt;/p&gt;

&lt;p&gt;Now, about why Payment is the bottleneck. A bottleneck isn’t just the slowest step; it’s the part on the critical path that, if improved, would speed up the entire workflow. Here, the longest sequence—the critical path—takes 580ms, and Payment’s 140ms sits toward the end. Cutting time in Payment directly reduces the overall response time. For example, even if you eliminated the 70ms Redis cache retrieval in Cart, Payment would still take 140ms afterward, leaving the total duration almost unchanged.&lt;/p&gt;

&lt;p&gt;There’s also another factor: Payment involves calling an external third-party API (Stripe), which adds extra dependency and latency.&lt;br&gt;
You can’t control latency here—it can jump unpredictably. Network round-trips add delays on top of Stripe’s processing time, and any outage or rate limit from Stripe stalls your whole checkout flow.&lt;/p&gt;

&lt;p&gt;The amber highlight in the diagram shows it’s slower compared to other parts, but the real problem is where it sits—in a late spot in a chain with no parallel work and relying on an external system you can't tweak.&lt;/p&gt;

&lt;p&gt;So, now what? Two main handles: &lt;em&gt;parallelism&lt;/em&gt; and &lt;em&gt;externalization&lt;/em&gt;.&lt;br&gt;
First, run Inventory and Auth checks at the same time. Starting both simultaneously after the request could cut down about 200ms of sequential waiting to around 130ms, limited by whichever is slower.&lt;/p&gt;

&lt;p&gt;Second, take Payment out of the critical path. Accept the order right away, then process payment asynchronously using a queue. This lets users see a quick “order received” response while payment happens behind the scenes—just like most large e-commerce platforms do.&lt;/p&gt;

&lt;p&gt;Also, add a timeout and retry strategy. Since Stripe is external, its slowest 1% delays become yours too. Setting a strict timeout—say 200ms—and handling errors gracefully means a Stripe glitch won’t wreck the checkout experience.&lt;/p&gt;

&lt;p&gt;Without this trace, you might blame the database or cache, but the waterfall view clears that up instantly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Now, lets dive into W3C Trace Context
&lt;/h4&gt;

&lt;p&gt;Before W3C settled on a standard in 2021, each had their own way of passing trace context around. Zipkin used &lt;em&gt;X-B3-TraceId&lt;/em&gt; headers. AWS X-Ray used &lt;em&gt;X-Amzn-Trace-Id&lt;/em&gt;. Jaeger had its own format. When requests moved between these systems, the trace often got lost. &lt;a href="https://www.w3.org/TR/trace-context" rel="noopener noreferrer"&gt;W3C Trace Context&lt;/a&gt; introduced two HTTP headers that all compliant systems should support&lt;/p&gt;

&lt;h4&gt;
  
  
  Header 1: traceparent
&lt;/h4&gt;

&lt;p&gt;This is the core carrier. It encodes four fields in a single, compact header:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0uqmdsdua8nwl1h089a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0uqmdsdua8nwl1h089a.png" alt="traceparent" width="800" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;version&lt;/strong&gt; — always 00 currently. Future versions can add fields.&lt;br&gt;
&lt;strong&gt;trace-id&lt;/strong&gt; — 128-bit identifier for the entire distributed trace. All spans across all services share this value.&lt;br&gt;
&lt;strong&gt;parent-id&lt;/strong&gt; — 64-bit identifier of the calling span. The receiving service uses this as its parent span when creating its own span.&lt;br&gt;
&lt;strong&gt;flags&lt;/strong&gt; — currently 1 byte. The lowest bit is the sampling flag (01 = sampled, 00 = not sampled).&lt;/p&gt;

&lt;h4&gt;
  
  
  Header 2: tracestate
&lt;/h4&gt;

&lt;p&gt;Vendor extension list, an ordered comma-separated set of key=value pairs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx70mw8y4t21b3q7u9z0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx70mw8y4t21b3q7u9z0t.png" alt="tracestate" width="696" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each tracing vendor gets a unique key (e.g. dd for Datadog, b3 for Zipkin B3). This lets vendor-specific metadata (sampling priority, origin, session IDs) ride alongside the standard traceparent without polluting it. When a service forwards a request, it must preserve the full tracestate and may prepend its own entry at the front. Entries beyond 32 are dropped from the tail.&lt;/p&gt;

&lt;p&gt;Headers propagation across service boundaries&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqcw08mka93golxp27ux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqcw08mka93golxp27ux.png" alt="Headers propagation across service boundaries" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sampled flag, which shows as 01 or 00, might seem like a small detail but it actually matters a lot. Tracking every single request in a busy production system is usually too costly—for example, a service handling 100k requests per second. Sampling helps by recording just a slice of traces, yet still keeping full detail for those captured.&lt;/p&gt;

&lt;p&gt;The sampled bit (flags 01 vs 00) plays a crucial role in tracing. Tracing every request in a high-traffic system, like one handling 100k requests per second, quickly becomes impractical. Sampling helps by recording only a subset of traces while maintaining detail for those captured.&lt;/p&gt;

&lt;p&gt;There are &lt;em&gt;three main sampling methods&lt;/em&gt;:&lt;br&gt;
&lt;em&gt;Head-based&lt;/em&gt; sampling decides at the root span before downstream calls. It sets the sampled flag to 01 or 00 and propagates it. This approach is straightforward and efficient but can't prioritize capturing interesting events like errors since they haven’t occurred yet.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tail-based&lt;/em&gt; sampling collects all spans from every service. The collector delays the sampling decision until the full trace is received, allowing it to keep all error traces and a small fraction of normal ones. This requires a more complex, stateful collector, such as the OpenTelemetry Collector with tail sampling.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Parent-based&lt;/em&gt; sampling simply follows the parent’s sampling decision via the sampled flag. It’s a safe default that ensures the whole trace is either fully recorded or entirely dropped, preventing disconnected spans without a root.&lt;/p&gt;

&lt;p&gt;A span isn’t just about its name and how long it lasts. OpenTelemetry, which leads as the open-source implementation of W3C Trace Context, sets semantic conventions—standard attribute names. This helps tracing tools interpret your data consistently, without needing extra setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgb7p4ydonoxwegf64qj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzgb7p4ydonoxwegf64qj.png" alt="semantic conventions" width="800" height="277"&gt;&lt;/a&gt; Spans can include events, which are specific log entries tied to a moment within the span, like noting a “cache miss occurred”. They also hold links, which reference other traces—useful in async or queue situations where the producer and consumer traces are related but happen separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Async and Queue Propagation&lt;/strong&gt;&lt;br&gt;
Handling async and queue propagation differs from straightforward HTTP propagation. Since producer and consumer don’t operate simultaneously, you can’t rely on passing a traceparent in a request header. &lt;br&gt;
Instead, the traceparent value is embedded within the message metadata—such as Kafka headers, SQS attributes, or AMQP headers. The consumer then reads this metadata and treats it as a span link, not a parent. This means the consumer’s trace connects to the producer’s but remains a separate trace-id. This approach keeps the causal link clear without letting trace information grow uncontrollably deep.&lt;/p&gt;

&lt;p&gt;How does this fit into the OpenTelemetry stack?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fypkrzfweugyrk1fmkxbe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fypkrzfweugyrk1fmkxbe.png" alt="OpenTelemetry stack" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the work-horse OpenTelemetry SDK auto-instruments common frameworks like Express, Django, Spring, and net/http, automatically creating spans and managing traceparent injection and extraction. Each service uses the OTLP exporter to send span data to the OTel Collector, which processes the data—sampling, redacting sensitive info, batching, and distributing it to multiple backends at once. This vendor-neutral setup lets you switch between tools like Jaeger and Grafana Tempo without modifying your application code.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key implementation considerations
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Clock skew&lt;/strong&gt; — spans from different machines have timestamps from different clocks. A child span with a start time before its parent is a common artifact of NTP drift. Tracing SDKs work around this by using monotonic clocks for durations and accepting some display weirdness on absolute timestamps.&lt;br&gt;
&lt;strong&gt;Baggage&lt;/strong&gt; — a sibling to tracestate, the W3C Baggage header (baggage: userId=alice, env=prod) lets you propagate arbitrary key-value pairs across service boundaries. It's useful for passing tenant IDs or feature flag states without touching application code, but beware: every hop re-serializes and forwards it, so large baggage values add latency.&lt;br&gt;
&lt;strong&gt;Instrumentation gaps&lt;/strong&gt; — if any service in the chain drops the traceparent header (an unmigrated internal proxy, a legacy service, a third-party vendor), the trace breaks. The downstream spans become "orphans" with no parent. Good tracing platforms surface these as disconnected sub-traces.&lt;br&gt;
&lt;strong&gt;Security&lt;/strong&gt; — traceparent is safe to expose externally. tracestate may contain internal vendor metadata you don't want leaking. Strip tracestate at your public ingress, then re-inject a fresh one for internal propagation.&lt;br&gt;
The W3C standard deliberately kept the spec minimal — it defines the wire format, not how to collect, store, or visualize. That separation of concerns is what made it possible for the whole ecosystem to converge on it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Diagrams created with the assistance of AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>distributedsystems</category>
      <category>microservices</category>
      <category>monitoring</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Ray: Building Distributed Systems—Just Like Running a Restaurant</title>
      <dc:creator>Nasim</dc:creator>
      <pubDate>Tue, 14 Oct 2025 16:37:06 +0000</pubDate>
      <link>https://forem.com/n451m/building-distributed-systems-with-ray-just-like-running-a-restaurant-1gjo</link>
      <guid>https://forem.com/n451m/building-distributed-systems-with-ray-just-like-running-a-restaurant-1gjo</guid>
      <description>&lt;p&gt;In our fast-paced digital world, data keeps piling up at a staggering rate. To make sense of it all, we need some supercharged computing tools that can handle what we throw at them. That is where Ray comes in. It is an open-source framework designed to help you build distributed applications without all the headaches. In the following sections, we’ll break down each Ray component using our restaurant analogy, translating abstract concepts into familiar, real-world operations. Let’s get cooking!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Data: Ingredient Prep Station&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Role&lt;/strong&gt;&lt;/em&gt;: Prepares every ingredient (chopping, washing, stalking) so when the kitchen manager is ready, everything is good to go with the cooking process. &lt;br&gt;
&lt;em&gt;&lt;strong&gt;Ray Version&lt;/strong&gt;&lt;/em&gt;: Handles all the preparations for massive data transformations—loading and mapping to transform data sets pre-work to avoid unnecessary time before training. &lt;br&gt;
&lt;em&gt;&lt;strong&gt;Key Analogy&lt;/strong&gt;&lt;/em&gt;: If you have a hundred tomatoes to chop or a hundred bags of flour, it is much easier to get it done on Ray Data before it is time to train than during actual cooking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Train: The Chefs Cooking the Main Dishes&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/strong&gt;: Cooks distribute what they're preparing and they can follow instructions, manage temperature and time, and check in along the way.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Ray Version&lt;/strong&gt;&lt;/em&gt;: Distributes CPU/GPUs for model training, distributes/checks in along the way.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Key Analogy&lt;/strong&gt;&lt;/em&gt;: You want different cooks (hardware) trained on different dishes (models) at the same time as possible so you can kill two birds with one stone and work efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Tune: The Research Team Experimenting with Recipes&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Role&lt;/strong&gt;&lt;/em&gt;: The restaurant's R&amp;amp;D team is constantly exploring new tastes—iterating on sauces, thickness of pasta/ice cream/whatever other courses there are.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Ray Version&lt;/strong&gt;&lt;/em&gt;: Runs many trials in parallel for different parameters to assess best hyperparameters for a model. &lt;br&gt;
Key Analogy: Tune is like a lab that tries dozens or hundreds or iterations on a single recipe to find the best version—most palatable tasting notes—and best version for this request.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Serve: Waitstaff and Quick Service Station&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/strong&gt;: The system for delivering courses to diners in a timely manner at the speed these clients want, especially if there is a rush and volume/inventory can help accommodate. &lt;br&gt;
&lt;em&gt;&lt;strong&gt;Ray Version&lt;/strong&gt;&lt;/em&gt;: Deploys and manages models/APIs, auto-scaling for client request routing. &lt;br&gt;
&lt;em&gt;&lt;strong&gt;Key Analogy&lt;/strong&gt;&lt;/em&gt;: Serve does not train models because Serve is a waitstaff who does not cook; it takes what is made in the kitchen (Run) to clients and can take many requests at once without sacrificing turnaround time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray RLlib: The Robot Chef Experimenting with Reinforcement Learning&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/strong&gt;: A chef using learning mechanisms over time—finds the best way to create various dishes with notes/feedback along the way. &lt;br&gt;
Ray Version: Builds, distributes/runs reinforcement learning algorithms from agents that can get feedback to learn over time. &lt;br&gt;
&lt;em&gt;&lt;strong&gt;Key Analogy&lt;/strong&gt;&lt;/em&gt;: RLlib is a robot chef who can learn through trial and error, figuring out which seasonings people like after adjusting and trying repeatedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Core: Kitchen Manager and Scheduling System&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Role&lt;/em&gt;&lt;/strong&gt;: Schedules all kitchen staff, knows what each cook is doing, who is available to support what task, ensuring order fulfillment does not bottleneck.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;Ray Version&lt;/strong&gt;&lt;/em&gt;: The core component to handle fundamental parallel computing—starting/stopping processes for workers, knowing what's going on, who's got what tasks, and generating reports about assigned resources.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Key Analogy&lt;/em&gt;&lt;/strong&gt;: If one cook is busy, he'll have to wait for the next and it will take longer to line up what's being prepared next but Ray Core will essentially keep everyone in line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Cluster = The Kitchen&lt;/strong&gt;: Just like a restaurant has a kitchen where all the cooking happens, a Ray cluster is a collection of computers that work together. They pool their resources, whether it is memory or processing power, to get things done efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Workers = The Kitchen Staff&lt;/strong&gt;: In any kitchen, you have distinct roles. There are chefs whipping up meals, sous chefs prepping ingredients, and dishwashers keeping things clean. Ray workers are like that staff—they are computers or components of computers that tackle their tasks independently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Scheduler = The Head Chef&lt;/strong&gt;: Think of the head chef as the one in charge of getting things done. They assign tasks to the staff, making sure everyone knows what to work on and when. The Ray scheduler does the same thing by distributing tasks to the workers and keeping everything on track.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Tasks = Recipes&lt;/strong&gt;: Just like a well-structured recipe guides a chef, Ray tasks are steps that need to be executed. Whether it is crunching data or performing calculations, these tasks are straightforward units of work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Jobs = Customer Orders&lt;/strong&gt;: When a customer puts in an order, the kitchen team jumps into action to make it happen. A Ray job is like that order—it is made up of a group of tasks that need to come together to complete a bigger goal, such as training a machine learning model or processing a big dataset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Actors = Specialized Chefs/Stations&lt;/strong&gt;: Some chefs have specialties; for instance, a pastry chef only focuses on desserts. In Ray, actors are specialized workers that keep their state between task executions, just like those chefs focus on their craft.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Tasks with Dependencies = Recipe Steps&lt;/strong&gt;: In cooking, some steps cannot happen until others are finished—like you need to caramelize onions before adding them to the dish. Ray takes care of ordering these tasks properly, ensuring everything gets done at the right time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Libraries = Specialized Cookbooks&lt;/strong&gt;: Just as a chef might have cookbooks for various cuisines, Ray comes with built-in libraries that help you deal with common tasks. For instance, it has RLlib for reinforcement learning and Tune for optimizing hyperparameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray Client = Restaurant Manager/Front of House&lt;/strong&gt;: Finally, much like a restaurant manager bridges the kitchen and the dining area, the Ray Client makes it easy for users outside the cluster to interact with it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ray's Object Store&lt;/strong&gt; is like a restaurant's central pantry since it streamlines everything all Ray components (tasks/actors/workers) do by facilitating communication and possession of what is needed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Central Pantry (Object Store):&lt;/em&gt;&lt;br&gt;
The Object Store integrates everything from processed tasks and necessary tasks so there is one place for everyone to come together without issue. In a vast restaurant setting, it is the only way to operate, and a modern-day restaurant must become Ray.&lt;br&gt;
&lt;em&gt;The Ingredients (Objects):&lt;/em&gt;&lt;br&gt;
Everything that gets served eventually is in the pantry. It is all there as individual items or groups of items, if necessary, with separate and respective characteristics. In Ray, everything is stored and compartmentalized as an "object".&lt;br&gt;
&lt;em&gt;Access and Sharing:&lt;/em&gt;&lt;br&gt;
Since it is a shared pantry, one ingredient can be used by many chefs or dishes and there is no overlap or redundancy. This means that it is easily accessible and reapplied without offense. In Ray, Object Store allows multiple workers to easily access or repurpose what someone else has done so distributed processing is easier and quicker without wasting energy.&lt;br&gt;
&lt;em&gt;Efficiency:&lt;/em&gt;&lt;br&gt;
It saves time from searching everywhere and cuts down on ordering redundancy, excess shipping or transporting from other places. Everything they need is in-house. The same with Ray—if the Object Store can pre-exist certain uses, Ray saves on sending over certain pieces of data/transferring network access/computational time of selecting what is used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connecting it All — Ray as a Restaurant (single end-to-end flow)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Guest places order (&lt;em&gt;user request / Job starts&lt;/em&gt;): someone orders a meal — a job is sent to Ray.&lt;/li&gt;
&lt;li&gt;Restaurant manager (&lt;em&gt;Ray Core&lt;/em&gt; / &lt;em&gt;Scheduler&lt;/em&gt;) parses the order and breaks it down into tasks: Ray Core breaks the job down into tasks and schedules them to workers.&lt;/li&gt;
&lt;li&gt;Pantry &amp;amp; prep station (&lt;em&gt;Ray Data&lt;/em&gt;) prepare and stage ingredients: data pipelines partition, preprocess, cache, and share datasets for efficient access and effective workers.&lt;/li&gt;
&lt;li&gt;Head chef assigns &amp;amp; staff coordinate (&lt;em&gt;Scheduler _+ _Workers&lt;/em&gt; / Ray Train): the scheduler gives tasks to the cooks; workers perform distributed compute and training jobs (Ray Train), coordinating efforts for cooking and baking.&lt;/li&gt;
&lt;li&gt;Line cooks &amp;amp; sous-chefs execute dishes (&lt;em&gt;Workers&lt;/em&gt; / &lt;em&gt;Ray Train&lt;/em&gt;): workers perform the compute-heavy steps (model training, batch jobs, data transforms) on the ingredients.&lt;/li&gt;
&lt;li&gt;Tasting lab runs experiments (&lt;em&gt;Ray Tune&lt;/em&gt;): parallel experiments evaluate various recipe configurations (hyperparameters), feeding better versions back into training.&lt;/li&gt;
&lt;li&gt;Robot chef explores improvements continuously (&lt;em&gt;Ray RLlib&lt;/em&gt;): reinforcement-learning agents autonomously learn better policy/strategies that improve recipes/models.&lt;/li&gt;
&lt;li&gt;Waitstaff &amp;amp; hosts deliver dishes (&lt;em&gt;Ray Serve&lt;/em&gt;): Ray Serve hosts the trained model, manages inference requests, scales instances, adapts to traffic — bringing results to the user.&lt;/li&gt;
&lt;li&gt;Meal served &amp;amp; feedback loop (&lt;em&gt;Job done → iterate&lt;/em&gt;): the order is fulfilled; metrics, feedback fed into Ray Tune, RLlib, retraining, get into action for iterative development.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ray is like a restaurant that can easily ramp up for a busy night; it provides a means of scaling for computers to work collaboratively with ease on otherwise complicated tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Scaling the Kitchen&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;Easy Scaling&lt;/em&gt;-Ray can add more machines to the cluster, just like a restaurant easily adds in more chefs for a rush, without any issues bringing in one, two, or three more trained professionals to manage a larger situation.&lt;br&gt;
&lt;em&gt;Execution Efficiency&lt;/em&gt;-Ray effectively works across many workers creating effective compilation of many hands and minds to cut down on complicated processes—like a kitchen where each team member takes part in a unique, critical role.&lt;br&gt;
&lt;em&gt;Complicated Execution&lt;/em&gt;-Ray can manage processes of advanced complexities adding in support to establish an all-encompassing effort—like a restaurant that can put out lots of meals with disparate processes, techniques and timing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-World Examples&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Recommendation Systems&lt;/strong&gt;&lt;br&gt;
Developers implement Ray by working on thousands of computations that require a quick turnaround—from movie recommendation engines that need instantaneous audience analytics to compile the best results.&lt;br&gt;
&lt;strong&gt;Scientific Inquiry&lt;/strong&gt;&lt;br&gt;
Ray engages in many pilot studies, from raw data assessment to model training, in research inquiries seeking simple predictive analytics or extensive exploration into existing data sets.&lt;br&gt;
&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Ray streamlines distributed computing for developers. When a once-strained restaurant manager can easily expand and organize and optimize service during a rush it creates better opportunities for quality work and better ideas. Similarly, Ray makes scaling and establishing powerful parallel projects to be simple and worthwhile endeavors, transforming developer thinking into reality.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/adamnasim/" rel="noopener noreferrer"&gt;Connect with me on LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ray</category>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Is Linux dead or awful</title>
      <dc:creator>Nasim</dc:creator>
      <pubDate>Thu, 29 Feb 2024 14:14:04 +0000</pubDate>
      <link>https://forem.com/n451m/is-linux-dead-or-awful-411p</link>
      <guid>https://forem.com/n451m/is-linux-dead-or-awful-411p</guid>
      <description>&lt;p&gt;The market share of Linux desktops is significantly lower compared to Windows and macOS, which dominate the desktop market. Some technologists have long predicted the &lt;a href="https://youtu.be/X_7AbdHbW4I" rel="noopener noreferrer"&gt;downfall&lt;/a&gt; of Linux. However, developers, system administrators, and enthusiasts continue to use Linux due to its flexibility, customization options, security features, and the availability of free and open-source software.&lt;br&gt;
Microsoft is still the sultan of OS, their Windows Mobile platform failed to generate interest compared to the pioneering iPhone and Android smartphones, resulting in a lackluster ecosystem with minimal interest. In contrast, Linux is gaining ground in both the mobile and server markets.&lt;br&gt;
Although Linux offers many benefits, such as flexibility, security, and open-source nature, it can be challenging for some users. Different Linux distributions have user interfaces that differ from Windows or macOS, which can be unfamiliar. Software compatibility may require workarounds, and the command-line interface can be daunting for users accustomed to graphical user interfaces. Additionally, while customization is a strength of Linux, it can be overwhelming for new users.&lt;br&gt;
Despite these challenges, the large and active Linux community provides support and documentation. However, finding the right resources and solutions for specific issues can be challenging for beginners. Nonetheless, with the right customization, Linux can be a superior tool if you have nerves, it offers increased privacy, a seamless desktop interface, and enhanced control. The anti-Linux cult has loyal disciples but to be fair all OS's have faults until it fits your use case.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
