<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Davinder Pal Singh on Medium]]></title>
        <description><![CDATA[Stories by Davinder Pal Singh on Medium]]></description>
        <link>https://medium.com/@davinder.sfdc?source=rss-b36788375600------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bEGUlXhCvOMMluTLKTl2_A.jpeg</url>
            <title>Stories by Davinder Pal Singh on Medium</title>
            <link>https://medium.com/@davinder.sfdc?source=rss-b36788375600------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:44:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davinder.sfdc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Everyone’s using AI. Almost nobody’s actually winning with it.]]></title>
            <link>https://medium.com/@davinder.sfdc/everyones-using-ai-almost-nobody-s-actually-winning-with-it-84dd91235f54?source=rss-b36788375600------2</link>
            <guid isPermaLink="false">https://medium.com/p/84dd91235f54</guid>
            <category><![CDATA[ai-adoption]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Davinder Pal Singh]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 14:38:37 GMT</pubDate>
            <atom:updated>2026-07-19T14:38:37.054Z</atom:updated>
            <content:encoded><![CDATA[<p>I sat in on a client’s “AI strategy” meeting a few months back. Forty minutes in, someone finally asked the question nobody wanted to touch: “Okay, but what has it actually changed?” Long pause. Someone mentioned a chatbot on the support page. That was it.</p><p>That meeting sums up where most companies are right now.</p><p>The adoption numbers are genuinely wild. 88% of organizations use AI in at least one business function. 72% are using generative AI specifically, up from a third of that two years ago. If you’d told me in 2022 that adoption would look like this by 2026, I wouldn’t have believed you.</p><p>But here’s the number that actually matters: only about a third of companies have gotten AI past the pilot stage into something running at scale. Fewer than one in ten are seeing real, measurable impact on their bottom line. And half of all organizations say AI has caused at least one real problem for them — and the top complaint isn’t cost, it’s not security, it’s just… being wrong. Confidently. In production.</p><p>So no, this isn’t an adoption story anymore. Adoption is done. This is an execution story, and most companies are failing it quietly.</p><h3>It’s not the model. It’s the habit of not changing anything.</h3><p>I’ve read a bunch of the research trying to explain why some companies get real value out of AI and most don’t, and the conclusion keeps landing in the same place: it has almost nothing to do with which model someone’s using. GPT-5, Claude, Gemini, doesn’t matter much. What matters is whether anyone bothered to change the actual process.</p><p>Most companies buy AI tools the way they’d buy any other piece of software — plug it in, hand it to the team, wait. And then wait some more. Nothing happens, because bolting a chatbot onto a workflow that was designed for humans doesn’t transform the workflow. It just makes the same slightly-annoying process marginally faster. Still the same process.</p><p>The companies actually pulling ahead didn’t get a smarter tool. They rebuilt the work itself around what the tool can do. That’s a much less comfortable thing to do than buying a license, which is probably why so few companies bother.</p><h3>Three levels, and most companies never leave the first one</h3><p>I think about this in three tiers. Not because I read it in a McKinsey deck (though it lines up with what they’ve found) — it’s just the pattern I keep seeing over and over in how this actually plays out.</p><p><strong>Automate.</strong> This is the boring, easy stuff. Auto-generated meeting notes. First-draft replies to routine customer emails. Reconciling invoices. Tagging support tickets. Summarizing a 40-page document nobody was going to read anyway. Almost every company has done this by now. It saves time. It rarely moves revenue, and if you’re being honest with yourself, it’s the low-hanging fruit everyone already picked.</p><p><strong>Augment.</strong> This is where AI makes a genuinely skilled person better at the judgment calls, instead of just clearing busywork off their plate. A salesperson who actually knows the prospect’s business cold before the call because AI did the digging. A finance analyst stress-testing a forecast against ten scenarios instead of the usual two, because running the extra eight used to not be worth the time. A support agent who has the right answer surfaced mid-conversation instead of tabbing through five docs to find it. Most of the real ROI I’ve seen shows up here — because it makes your best people sharper instead of just shaving a few minutes off a task nobody cared about anyway.</p><p><strong>Reimagine.</strong> This one’s rare, and it’s the uncomfortable one. It means redesigning the process from scratch, assuming AI capability going in, instead of duct-taping it onto something that already existed. Not “AI helps the support agent respond faster” — a support function where AI fully resolves the routine 70% of tickets on its own, and the humans exist specifically for the hard 30%, with more time and better tools to actually handle them well. Not “AI writes ad copy drafts” — a marketing team that tests fifty variants a week instead of five, because generating and evaluating options stopped being the bottleneck.</p><p>Most companies never get past level one. The ones seeing real results are mostly living in levels two and three. That gap is basically the whole story.</p><h3>What the companies actually pulling this off do differently</h3><p>A handful of things separate the businesses actually capturing value from everyone else using the exact same tools.</p><p>They fund it like infrastructure, not a project with a launch date. High performers put a noticeably bigger chunk of their digital budget into AI, on an ongoing basis, not as a one-time initiative that gets a press release and then quietly fades.</p><p>They actually rebuild the workflow instead of decorating the old one. Companies seeing real returns are roughly three times more likely to have genuinely redesigned how a process works, instead of sticking an AI feature on the interface and calling it done.</p><p>Leadership actually uses the tools themselves. Not “approved the budget for it” — actually uses it. That does more for adoption across a company than any training program I’ve seen.</p><p>They go deep on one thing before going wide on everything. The companies stuck in permanent pilot mode usually have thirty half-finished experiments running at once. The ones getting somewhere picked one function — customer service, dev, knowledge management, whatever — and pushed it all the way to production before touching anything else.</p><h3>If you’re actually going to start</h3><p>Don’t roll this out everywhere at once. That’s the instinct, and it’s the wrong one.</p><p>Pick one process. High volume, not too much judgment required, currently annoying for everyone involved. Ticket triage, first-draft content, lead qualification, expense processing, contract review — any of these work.</p><p>Actually measure where you’re starting from before you touch anything. You can’t prove this worked later if you don’t know your current cost, time, and error rate now. Skip this step and you’ll be arguing about impact from vibes in six months.</p><p>Automate before you augment. Get the boring, mechanical layer solid before you trust AI with anything that involves judgment. Trust gets built in that order. Not the other way around.</p><p>Keep a human in the loop on anything customer-facing or hard to undo, at least until you actually understand your error rate. That 30% of companies complaining about inaccuracy mostly skipped this part.</p><p>And only once one process is genuinely live — not “in pilot,” actually live — should you move to the next one. Depth wins over breadth here, every single time I’ve seen it play out.</p><h3>Where I’d leave this</h3><p>AI isn’t a competitive advantage anymore. Not at 88% adoption. It’s just table stakes at this point, same as having a website was in 2005.</p><p>The actual advantage — the thing almost nobody has — is a business that went through its workflows and asked which parts only still exist because a human used to be the bottleneck. That’s an uncomfortable question, because the honest answer usually means redesigning something people built their careers around.</p><p>The companies pulling ahead aren’t smarter. They just asked that question earlier and didn’t flinch at the answer.</p><p>Here’s a decent gut check if you want to know where you actually stand: take your most AI-touched process today and ask honestly whether it was redesigned around AI, or whether AI was just bolted onto it. If it’s the second one, that’s the gap to close before you spin up anything new.</p><p>Genuinely curious where people think their own org sits on this — mostly automating, occasionally augmenting, or actually reimagining? I suspect most answers land closer to the first one than people want to admit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84dd91235f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building Scalable and Resilient Architectures with Salesforce Platform Events]]></title>
            <link>https://medium.com/@davinder.sfdc/building-scalable-and-resilient-architectures-with-salesforce-platform-events-bf365b535dfd?source=rss-b36788375600------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf365b535dfd</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <dc:creator><![CDATA[Davinder Pal Singh]]></dc:creator>
            <pubDate>Sun, 25 May 2025 22:46:38 GMT</pubDate>
            <atom:updated>2025-05-25T22:46:38.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NF1E2n3DRVe1SwMMebnJnw.png" /></figure><p><strong>Introduction</strong></p><p>If you’re working with cloud-native systems or designing around event-driven architecture (EDA), you already know how important real-time data sync and loose coupling are. That’s where <strong>Salesforce Platform Events</strong> come in — offering a powerful way to connect Salesforce with the rest of your tech stack, whether it’s AWS Lambda, Kafka, or a fleet of microservices.</p><p>In this article, we’ll break down what Platform Events are, how they fit into modern architectures, and some practical tips for getting started.</p><p><strong>Understanding Salesforce Platform Events</strong></p><p><strong>What Are Salesforce Platform Events?</strong></p><p>At their core, Platform Events use a <strong>publish-subscribe (pub/sub)</strong> model — built right into Salesforce — to let different parts of your system talk to each other in real time. You can think of them as <strong>Salesforce’s answer to Kafka</strong>: a way to send and receive events that trigger actions across apps, without tying everything together too tightly.</p><p><strong>Why Use Platform Events?</strong></p><p>Here’s what makes Platform Events stand out:</p><ul><li>Asynchronous Communication<br>Producers and consumers don’t have to wait on each other. Events get fired off and handled when ready, keeping things fast and decoupled.</li><li>Built-In Durability<br>Events are stored for up to 72 hours, which gives consumers a buffer in case they miss something right away.</li><li>Scales with You<br>Depending on your Salesforce edition, Platform Events can handle millions of events a day — perfect for high-throughput use cases.</li><li>Connects Everything<br>Whether it’s Apex, Flows, Lightning Components, or external tools (via CometD or the newer Pub/Sub API), Platform Events work across the board.</li></ul><p><strong>Bringing Platform Events into Modern Architectures</strong></p><p><strong>🔁 Real-Time Integrations</strong></p><p>Let’s face it — relying on scheduled jobs or constant API polling slows things down and adds complexity. With Platform Events, you can push updates in real time, making your systems more responsive and efficient.</p><p>📌 <em>Example</em>: A logistics app listens for the Case_Closed__e event. As soon as a support case wraps up in Salesforce, it instantly updates delivery tracking — no waiting around.</p><h4>#📤 Triggering External Systems</h4><p>Need to kick off workflows in other systems like MuleSoft, Kafka, or a microservice? Platform Events let you do that <em>without</em> waiting on slow, synchronous API calls. It’s a clean, decoupled way to get things moving.</p><p>📌 <em>Example</em>: When a deal hits a certain stage, an Opportunity_Stage_Updated__e event fires off and triggers pricing calculations in an external system — automatically.</p><h4>#🔄 Decoupling Logic Inside Salesforce</h4><p>Tired of massive, tangled Apex triggers? Platform Events help you break that up. You can trigger multiple independent flows or processes from a single event — which makes things easier to maintain and debug.</p><p>📌 <em>Example</em>: One event can launch a bunch of actions at once — send a Slack alert, update related records, notify a manager — all running separately and cleanly.</p><p><strong>Platform Events vs Change Data Capture vs Streaming API</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pqtDYMzSKLOS7D68vjkl2Q.png" /></figure><h3>#Event-Driven Order Management in Action</h3><p>Let’s bring this down to earth with a real-world example. Imagine a company using <strong>Salesforce for sales</strong>, <strong>SAP for order fulfillment</strong>, and <strong>NetSuite for finance</strong>. Rather than gluing everything together with APIs and batch jobs, they build an <strong>event-driven system</strong> — where each step in the process is triggered by real-time events.</p><h4>#🧩 How It Works:</h4><ol><li>A sales rep closes a deal in Salesforce — this fires off an Order_Created__e event.</li><li>SAP (via middleware) picks up that event and starts processing the order.</li><li>Once the order ships, SAP sends back an Order_Shipped__e event.</li><li>Salesforce catches that update and automatically updates the Opportunity status.</li><li>NetSuite also listens in and generates an invoice right on cue.</li></ol><p>Pretty slick, right?</p><h4>#✅ What You Get:</h4><ul><li><strong>Real-time automation</strong> across platforms</li><li><strong>Loose coupling</strong>, so each system stays independent</li><li><strong>High scalability</strong>, even as your business grows</li><li><strong>Transparent, auditable flows</strong> from end to end</li></ul><h3>#Best Practices for Working with Platform Events</h3><p>Want to get the most out of Platform Events? Keep these tips in mind:</p><ul><li>Keep Your Schema Lean<br>Only include the essential fields — think IDs and key status flags. Don’t try to stuff full objects into your events.</li><li>Use Replay IDs Wisely<br>If your subscriber system goes down, you’ll want to pick up where you left off — without processing the same events twice.</li><li>Plan for Failures<br>Make sure subscribers (like Apex triggers or external listeners) have solid error handling and retry logic baked in.</li><li>Watch Your Limits<br>Salesforce has governor limits and event delivery quotas. Keep an eye on usage so you don’t hit any walls unexpectedly.</li></ul><h3>#Advanced Tools to Level Up</h3><h4>#🚀 Pub/Sub API: Next-Gen Event Streaming</h4><p>Salesforce’s <strong>Pub/Sub API</strong> is a major upgrade from the old CometD approach. It uses gRPC and JSON over HTTP/2, and supports:</p><ul><li>Two-way communication</li><li>High-performance event streaming at scale</li><li>Official client libraries for Node.js, Java, and more</li></ul><h4>#🎯 Generic Events: No Predefined Schema Needed</h4><p>With <strong>Generic Events</strong>, you can create and publish events dynamically — no need to define the structure up front in Salesforce. This is perfect for rapidly changing systems or when flexibility is key.</p><h3>#Wrapping Up: Why You Should Be Using Platform Events</h3><p>As more companies shift to <strong>microservices and event-driven designs</strong>, the old REST-based, tightly coupled integrations just don’t cut it anymore.</p><p><strong>Salesforce Platform Events</strong> let you build workflows that are:</p><ul><li>More scalable</li><li>Easier to maintain</li><li>Designed for the real-time, distributed world we live in</li></ul><p>So whether you’re rethinking your integration strategy, refining your internal processes, or just tired of spaghetti logic — <strong>start thinking in events.</strong></p><p>Want help building your first event-driven Salesforce flow? Or integrating with Kafka or AWS? Drop a comment or reach out — always happy to share more.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf365b535dfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing Scalable Salesforce Applications Using Apex and Asynchronous Patterns]]></title>
            <link>https://medium.com/@davinder.sfdc/designing-scalable-salesforce-applications-using-apex-and-asynchronous-patterns-e44981b6a29b?source=rss-b36788375600------2</link>
            <guid isPermaLink="false">https://medium.com/p/e44981b6a29b</guid>
            <category><![CDATA[large-data-volumes]]></category>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <category><![CDATA[architectural-design]]></category>
            <category><![CDATA[salesforce-productivity]]></category>
            <dc:creator><![CDATA[Davinder Pal Singh]]></dc:creator>
            <pubDate>Sat, 17 May 2025 21:00:07 GMT</pubDate>
            <atom:updated>2025-05-17T21:00:07.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s be honest — if you’ve worked with Salesforce for any length of time, you’ve probably seen one of these dreaded errors:<br> <strong>“CPU time limit exceeded”</strong>,<br> <strong>“Too many SOQL queries”</strong>,<br> <strong>“Heap size too large.”</strong></p><p>Yeah, those ones.</p><p>They usually show up right when you’re trying to do something useful — like updating thousands of records or chaining multiple operations in one trigger. That’s Salesforce reminding you that it’s a multi-tenant platform with strict rules.</p><p>But don’t worry — you don’t have to code less. You just have to <strong>design smarter</strong>.</p><p>Let’s talk about how to build <strong>scalable</strong> Salesforce apps using <strong>asynchronous Apex</strong> — so your business logic can breathe a little easier.</p><h3>🚧 The Reality of Governor Limits</h3><p>Salesforce isn’t like your typical server — you can’t just throw more memory or threads at a problem. It enforces limits to keep everyone playing fair. Here are a few you’ll bump into:</p><ul><li><strong>SOQL queries per transaction</strong>: 100</li><li><strong>DML statements</strong>: 150</li><li><strong>CPU time limit</strong>: 10 seconds</li><li><strong>Heap size (sync)</strong>: 6 MB</li></ul><p>Trying to run complex business logic in a single transaction? You’ll hit these walls faster than you think.</p><h3>✅ The Fix: Going Asynchronous</h3><p>Instead of doing everything at once, you can <strong>offload heavy tasks</strong> to run <em>after</em> the main transaction finishes. This way, your logic runs in the background, free from many of the synchronous limits.</p><p>Here are your main tools for async in Apex:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*xvhtsvxZ9QKEQtsn0nseLA.png" /></figure><h3>🧵 1. Future Methods: Fire and Forget</h3><p>Perfect for lightweight stuff like pinging an external API or sending emails — nothing fancy.</p><pre>@future<br>public static void sendEmailAsync(String email) {<br>    // Email sending logic<br>}</pre><p>🚫 <strong>But</strong>: You can’t return values, call another future, or chain logic. Keep it simple.</p><h3>🧳 2. Queueable Apex: Your New Best Friend</h3><p>Queueables are flexible, chainable, and more testable than futures.</p><pre>public class ProcessOrdersQueueable implements Queueable {<br>    public void execute(QueueableContext context) {<br>        // Do the heavy lifting here<br>    }<br>}</pre><p>Bonus: You can chain jobs!</p><pre>System.enqueueJob(new FirstJob());</pre><p>And inside FirstJob, queue the next:</p><pre>System.enqueueJob(new SecondJob());</pre><h3>📦 3. Batch Apex: Built for Big Jobs</h3><p>Processing thousands — or even millions — of records? Batch Apex is made for that.</p><pre>global class UpdateContactsBatch implements Database.Batchable&lt;SObject&gt; {<br>    global Database.QueryLocator start(Database.BatchableContext BC) {<br>        return Database.getQueryLocator([SELECT Id FROM Contact]);<br>    }<br><br>    global void execute(Database.BatchableContext BC, List&lt;Contact&gt; contacts) {<br>        // Logic goes here<br>    }<br><br>    global void finish(Database.BatchableContext BC) {<br>        // Send summary or notifications<br>    }<br>}</pre><p>✅ Handles massive data<br>✅ Breaks it into chunks<br>🚫 A bit slower and more rigid than other patterns</p><h3>⏰ 4. Scheduled Apex: Run It Later</h3><p>Need to do something every night at 11 PM? Schedule it.</p><pre>public class DailyJob implements Schedulable {<br>    public void execute(SchedulableContext SC) {<br>        // Cleanup, report generation, etc.<br>    }<br>}<br><br>String cron = &#39;0 0 23 * * ?&#39;;<br>System.schedule(&#39;Run Daily Job&#39;, cron, new DailyJob());</pre><h3>🔔 5. Platform Events: Go Reactive</h3><p>Platform Events let you <strong>decouple</strong> your logic. Publish an event, and let whoever’s interested respond.</p><pre>Order_Created__e event = new Order_Created__e(OrderId__c = &#39;123&#39;);<br>EventBus.publish(event);</pre><p>Then set up a trigger to handle the event:</p><pre>trigger OrderCreatedTrigger on Order_Created__e (after insert) {<br>    // React to event<br>}</pre><p>Think: workflows that trigger <em>only</em> when something important happens, not every time a record changes.</p><h3>🛠️ Stack ’Em Up: Combining Patterns</h3><p>Here’s how things usually look in a mature, scalable app:</p><ul><li>A <strong>trigger</strong> kicks off a <strong>Queueable</strong></li><li>The Queueable <strong>publishes a Platform Event</strong></li><li>A <strong>listener</strong> fires off a <strong>Batch job</strong> to process bulk data</li></ul><p>This layering ensures no single process slows everything down.</p><h3>🧪 Testing &amp; Monitoring Tips</h3><ul><li>Use Test.startTest() and Test.stopTest() to simulate async execution</li><li>Monitor jobs via Setup → <strong>Apex Jobs</strong></li><li>Use <strong>Debug Logs</strong> and <strong>Event Monitoring</strong> for tracing and troubleshooting</li></ul><h3>📏 Best Practices to Keep in Mind</h3><ul><li><strong>Avoid recursion</strong>: Use static flags to prevent loops</li><li><strong>Always bulkify</strong>: Async doesn’t mean you can write bad SOQL</li><li><strong>Watch your limits</strong>: Even Queueables have limits (e.g., 50 per transaction)</li><li><strong>Test like it’s production</strong>: Write realistic unit tests</li></ul><h3>📌 Final Words</h3><p>Writing Apex that works is one thing. Writing Apex that <strong>scales</strong> is another.<br> With asynchronous processing, you can handle bigger tasks, move logic out of the critical path, and build apps that perform reliably — <strong>even under pressure</strong>.</p><p>Don’t just code harder.<br> Code smarter.<br> And let Apex do the heavy lifting — <strong>on its own time</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e44981b6a29b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>