<?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>DEV Community: Naresh Chandra Lohani</title>
    <description>The latest articles on DEV Community by Naresh Chandra Lohani (@naresh_chandralohani).</description>
    <link>https://dev.to/naresh_chandralohani</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3893656%2F7c19497e-daa2-45b5-a85d-8b6e2b15430a.jpeg</url>
      <title>DEV Community: Naresh Chandra Lohani</title>
      <link>https://dev.to/naresh_chandralohani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/naresh_chandralohani"/>
    <language>en</language>
    <item>
      <title>ERPNext Development Services: Build Faster Workflows with Frappe and Python</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:34:42 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/erpnext-development-services-build-faster-workflows-with-frappe-and-python-246f</link>
      <guid>https://dev.to/naresh_chandralohani/erpnext-development-services-build-faster-workflows-with-frappe-and-python-246f</guid>
      <description>&lt;p&gt;A common ERP performance problem appears when a routine business action triggers several expensive operations. Submitting a purchase receipt might update inventory, recalculate valuation, notify external systems, and generate reports. When these tasks run synchronously, users experience slow forms, request timeouts, or repeated submissions.&lt;/p&gt;

&lt;p&gt;ERPNext Development Services can address these problems through targeted customization, transaction-aware Python code, background processing, and better integration boundaries. The objective is to preserve ERPNext's business rules while reducing unnecessary work in the request-response cycle.&lt;/p&gt;

&lt;p&gt;This guide explains how backend engineers can design these improvements using the Frappe Framework, Python, REST APIs, and background workers. For implementation support, explore &lt;a href="https://www.oodles.com/erp-next?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_53" rel="noopener noreferrer"&gt;ERPNext customization and development&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;ERPNext runs on the Frappe Framework, which provides document models, permissions, database abstractions, hooks, and APIs. A typical deployment uses Python application workers, a relational database, Redis-backed job queues, and a web server. External services may connect through REST endpoints or custom integration methods.&lt;/p&gt;

&lt;p&gt;Consider an inventory workflow that sends stock updates to a third-party warehouse platform whenever a receipt is submitted. If the external API is slow, performing the HTTP request inside the submission flow can delay the user's response.&lt;/p&gt;

&lt;p&gt;Prerequisites for the approach below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A working ERPNext development or staging environment.&lt;/li&gt;
&lt;li&gt;A custom Frappe application for business-specific logic.&lt;/li&gt;
&lt;li&gt;Access to worker logs and database performance metrics.&lt;/li&gt;
&lt;li&gt;A test dataset representing realistic transaction volumes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;a href="https://docs.frappe.io/framework/user/en/api/database" rel="noopener noreferrer"&gt;Frappe database documentation&lt;/a&gt; explains that successful POST and PUT requests commit database changes at the end of the request, while uncaught exceptions cause rollbacks. This transaction behavior matters when moving work outside the original request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How ERPNext Development Services Improve Workflow Performance
&lt;/h2&gt;

&lt;p&gt;The central design principle is to keep essential business validation inside the transaction and move suitable secondary operations to background workers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Separate critical writes from secondary processing
&lt;/h3&gt;

&lt;p&gt;First, identify which operations must complete before a document can be submitted. Stock validation, required-field checks, and accounting rules belong in the critical workflow. Sending notifications or refreshing an external reporting index may not.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Profile the slow workflow under representative load.&lt;/li&gt;
&lt;li&gt;Identify expensive queries, external requests, and repeated calculations.&lt;/li&gt;
&lt;li&gt;Keep data-integrity checks synchronous.&lt;/li&gt;
&lt;li&gt;Move independent, noncritical work to an asynchronous queue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not move every operation into a worker. If an external action determines whether a transaction is valid, asynchronous processing may introduce inconsistent business states.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Queue integration work safely
&lt;/h3&gt;

&lt;p&gt;Frappe supports background jobs through &lt;code&gt;frappe.enqueue()&lt;/code&gt;. The following example illustrates a custom document hook that schedules an external synchronization task after a receipt is submitted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# my_app/hooks.py&lt;/span&gt;
&lt;span class="n"&gt;doc_events&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"Purchase Receipt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"on_submit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"my_app.inventory.queue_sync"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# my_app/inventory.py&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;frappe&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;queue_sync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: defer network I/O instead of blocking document submission.&lt;/span&gt;
    &lt;span class="n"&gt;frappe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enqueue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"my_app.inventory.sync_receipt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"long"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;receipt_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;enqueue_after_commit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sync_receipt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receipt_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: reload committed data instead of relying on stale document state.&lt;/span&gt;
    &lt;span class="n"&gt;receipt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;frappe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_doc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Purchase Receipt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;receipt_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Replace with an authenticated, timeout-controlled integration client.&lt;/span&gt;
    &lt;span class="nf"&gt;send_receipt_to_warehouse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;receipt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;send_receipt_to_warehouse()&lt;/code&gt; represents an application-specific integration function that must be implemented. &lt;code&gt;enqueue_after_commit=True&lt;/code&gt; helps prevent a worker from processing a receipt before its database transaction commits.&lt;/p&gt;

&lt;p&gt;For production use, also implement bounded retries, idempotency keys, structured error logs, and a way to reconcile failed deliveries. A job can fail after the external system receives a request, so retries must not create duplicate warehouse transactions.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="https://docs.frappe.io/framework/user/en/api/background_jobs" rel="noopener noreferrer"&gt;Frappe background jobs guide&lt;/a&gt; for queue options and job execution details.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Choose the right consistency model
&lt;/h3&gt;

&lt;p&gt;Asynchronous processing improves responsiveness, but it changes when external systems receive updates. The ERP transaction can succeed while the integration remains pending.&lt;/p&gt;

&lt;p&gt;Choose an approach based on business requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Synchronous execution: Use when the response depends on an immediate external result.&lt;/li&gt;
&lt;li&gt;Background jobs: Use for independent tasks that can tolerate delayed completion.&lt;/li&gt;
&lt;li&gt;Transactional outbox: For integrations requiring stronger delivery guarantees, persist an event alongside the business transaction and let a worker deliver it with retries.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The outbox pattern adds operational complexity, including event retention and duplicate handling. However, it makes pending integration work visible and recoverable instead of treating a queued task as proof of successful delivery.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application: Measuring an ERPNext Integration
&lt;/h2&gt;

&lt;p&gt;At Oodles, ERPNext implementation work can involve connecting business documents with external operational systems. A representative engineering scenario is a purchase-receipt workflow that updates inventory and synchronizes warehouse data.&lt;/p&gt;

&lt;p&gt;The technical approach is to profile document submission, retain inventory validations in the main transaction, and move external synchronization into a background worker. Monitoring should capture request latency, queue wait time, job duration, retry count, and failed deliveries.&lt;/p&gt;

&lt;p&gt;Performance results must come from measured deployment data. No verified Oodles project benchmark is available for this article, so a specific before-and-after improvement cannot responsibly be attributed to an actual client implementation.&lt;/p&gt;

&lt;p&gt;To establish a defensible result, replay a representative workload in staging and compare p95 submission latency, database query counts, and successful synchronization rates before and after the change. Report the test volume, environment, and measurement window alongside the results.&lt;/p&gt;

&lt;p&gt;For additional engineering resources and company information, visit &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep business-critical validation inside the document transaction.&lt;/li&gt;
&lt;li&gt;Profile database queries and external calls before changing the architecture.&lt;/li&gt;
&lt;li&gt;Use Frappe background jobs for independent, noncritical processing.&lt;/li&gt;
&lt;li&gt;Make integration handlers idempotent and implement observable retry behavior.&lt;/li&gt;
&lt;li&gt;Measure p95 latency, queue delays, and delivery failures under realistic workloads.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's Discuss Your ERPNext Architecture
&lt;/h2&gt;

&lt;p&gt;Are you working on a slow document submission, a custom integration, or a background-job reliability issue? Share your architecture or debugging challenge in the comments.&lt;/p&gt;

&lt;p&gt;For project-specific assistance, contact &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;ERPNext Development Services&lt;/a&gt; to discuss your requirements with the Oodles team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are ERPNext Development Services?
&lt;/h3&gt;

&lt;p&gt;ERPNext Development Services cover ERPNext configuration, custom DocTypes, Python business logic, workflow automation, REST API integrations, reporting, performance optimization, and deployment support. These services help organizations adapt ERPNext to their operational requirements while retaining maintainable application code.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Which programming language is used for ERPNext customization?
&lt;/h3&gt;

&lt;p&gt;ERPNext server-side customization primarily uses Python through the Frappe Framework. JavaScript supports browser-side form behavior and interface interactions. SQL knowledge is useful for investigating database performance, while REST APIs connect ERPNext with external applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How can developers improve ERPNext performance?
&lt;/h3&gt;

&lt;p&gt;Developers can improve ERPNext performance by profiling slow requests, optimizing database queries, reducing repeated calculations, and moving suitable long-running operations into background workers. Benchmarking with realistic data and monitoring p95 latency helps verify whether each change produces measurable improvement.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How does ERPNext integrate with external applications?
&lt;/h3&gt;

&lt;p&gt;ERPNext exposes REST APIs for document operations and supports whitelisted Python methods for custom server-side operations. Integrations should use appropriate authentication, permission checks, request timeouts, and retry policies. Webhooks or background workers can handle updates when immediate processing is unnecessary.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. When should an ERPNext task run asynchronously?
&lt;/h3&gt;

&lt;p&gt;An ERPNext task should run asynchronously when it involves slow, independent work that does not need to finish before the user receives a response. Examples include notifications, bulk exports, and external synchronization. Tasks that determine transaction validity or require an immediate result may need synchronous execution.&lt;/p&gt;

</description>
      <category>erpnext</category>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Scalable Video Streaming Development Services with Node.js and AWS</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Fri, 13 Nov 2026 02:21:18 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-scalable-video-streaming-development-services-with-nodejs-and-aws-hl1</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-scalable-video-streaming-development-services-with-nodejs-and-aws-hl1</guid>
      <description>&lt;p&gt;A video player that buffers during a product launch or drops frames during a live event often exposes a backend bottleneck, not a frontend bug. The problem can originate in encoding, segment delivery, cache configuration, or playback logic. These issues become more visible when viewers connect through different devices and network conditions.&lt;/p&gt;

&lt;p&gt;Video Streaming Development Services require an architecture that separates media processing from application APIs and distributes video efficiently. In this guide, we will design a practical HTTP Live Streaming (HLS) workflow using Node.js, AWS, and a content delivery network (CDN).&lt;/p&gt;

&lt;p&gt;For teams building video-on-demand platforms or live broadcasting products, &lt;a href="https://www.oodles.com/video-streaming?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_51" rel="noopener noreferrer"&gt;video streaming development solutions&lt;/a&gt; should prioritize measurable playback quality, predictable infrastructure costs, and recovery from partial failures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;A scalable streaming platform separates control-plane operations from media delivery. Node.js manages authentication, playback authorization, metadata, and job orchestration. Dedicated media workers encode and package video, while object storage and a CDN distribute the resulting files.&lt;/p&gt;

&lt;p&gt;A typical workflow looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A client uploads a source video to Amazon S3 using a presigned URL.&lt;/li&gt;
&lt;li&gt;An event triggers an encoding job through a queue or managed media service.&lt;/li&gt;
&lt;li&gt;The encoding pipeline generates multiple bitrate renditions and HLS playlists.&lt;/li&gt;
&lt;li&gt;Packaged segments are stored in S3 and distributed through Amazon CloudFront.&lt;/li&gt;
&lt;li&gt;The application API authorizes playback and returns the appropriate manifest URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Apple's &lt;a href="https://developer.apple.com/documentation/http-live-streaming" rel="noopener noreferrer"&gt;HTTP Live Streaming documentation&lt;/a&gt; explains how HLS uses segmented media, playlists, and alternate bitrates to adapt playback to changing network conditions.&lt;/p&gt;

&lt;p&gt;The key architectural decision is to keep large media transfers out of the Node.js application server. Otherwise, application workers can become constrained by bandwidth, open connections, and unnecessary file-processing operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing Video Streaming Development Services with Adaptive Bitrate Delivery
&lt;/h2&gt;

&lt;p&gt;Adaptive bitrate streaming allows a compatible player to switch between video renditions according to available bandwidth and playback conditions. Implementing it correctly requires coordinated encoding, secure delivery, and observability.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Design the Encoding Pipeline
&lt;/h3&gt;

&lt;p&gt;Encoding determines which devices can play the content and how efficiently viewers receive it. Generate several renditions, such as 360p, 720p, and 1080p, based on the source quality and your audience's devices.&lt;/p&gt;

&lt;p&gt;Avoid encoding every upload synchronously inside an API request. Instead, submit a background job and track states such as &lt;code&gt;queued&lt;/code&gt;, &lt;code&gt;processing&lt;/code&gt;, &lt;code&gt;ready&lt;/code&gt;, and &lt;code&gt;failed&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This separation keeps upload requests short and makes retries easier to manage. Use idempotent job identifiers so that duplicate queue events do not produce conflicting publishing operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Generate and Serve HLS Playlists
&lt;/h3&gt;

&lt;p&gt;Node.js can expose a playback endpoint that returns a manifest only after the encoding pipeline finishes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;"express"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/api/videos/:id/playback"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Why: authenticate the viewer before granting media access.&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Unauthorized"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Why: load authoritative video metadata from your database.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;video&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;findVideoById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;video&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s2"&gt;"ready"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Video unavailable"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Why: return a short-lived signed manifest URL, not media bytes.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;playbackUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createSignedManifestUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;manifestKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Cache-Control"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"no-store"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;playbackUrl&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example assumes authentication middleware populates &lt;code&gt;req.user&lt;/code&gt; and that the lookup and signing functions are implemented separately. Add ownership or subscription checks before issuing the signed URL.&lt;/p&gt;

&lt;p&gt;Store manifests and media segments in S3, then configure CloudFront with appropriate origin access controls. Keep private content inaccessible directly from the bucket. Signed URLs or signed cookies can restrict access, but their expiration must account for the expected playback session.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Tune Delivery Without Breaking Playback
&lt;/h3&gt;

&lt;p&gt;The choice between standard HLS and low-latency HLS depends on the product. On-demand libraries can generally prioritize cache efficiency and playback stability. Interactive broadcasts, auctions, or live sports may require tighter latency targets.&lt;/p&gt;

&lt;p&gt;AWS's Well-Architected Streaming Media Lens notes that streaming latency can range from approximately 3 to 90 seconds, depending on architecture and configuration. It also highlights trade-offs between latency, buffering, video quality, and error rates.&lt;/p&gt;

&lt;p&gt;Shorter segments may reduce latency, but they also increase request frequency and can reduce caching efficiency if the CDN is poorly configured.&lt;/p&gt;

&lt;p&gt;Measure startup time, rebuffering ratio, playback errors, rendition switches, and end-to-end live latency before changing segment duration. Test with realistic concurrency and network throttling instead of relying exclusively on server-side response times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;Oodles publishes video-streaming project examples involving live video applications and content-delivery platforms. One example is its &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;video streaming engineering portfolio&lt;/a&gt;, which includes work involving a global spiritual content provider and a prenatal imaging platform.&lt;/p&gt;

&lt;p&gt;For a system of this type, the engineering challenge is to deliver media reliably across supported devices while protecting access to potentially sensitive recordings. A practical implementation combines authenticated playback, background media processing, controlled storage access, and CDN-based distribution.&lt;/p&gt;

&lt;p&gt;A production evaluation should compare baseline and post-implementation metrics such as median startup time, 95th-percentile API latency, rebuffering ratio, and delivery cost per viewing hour. Publicly available Oodles project descriptions do not establish a verified numerical improvement for these examples, so a specific performance gain should not be attributed to them without project measurements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Separate media processing from Node.js API requests to prevent encoding workloads from blocking application operations.&lt;/li&gt;
&lt;li&gt;Use adaptive bitrate HLS to accommodate different network conditions and device capabilities.&lt;/li&gt;
&lt;li&gt;Distribute segments through a CDN rather than routing media traffic through application servers.&lt;/li&gt;
&lt;li&gt;Protect private streams with authorization checks, signed playback URLs, and appropriate storage policies.&lt;/li&gt;
&lt;li&gt;Validate improvements using real playback telemetry, load tests, and delivery-cost measurements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have a streaming architecture question? Share your implementation challenge in the comments, especially if you are debugging buffering, scaling live audiences, or reducing CDN costs.&lt;/p&gt;

&lt;p&gt;For project-specific guidance, discuss your requirements with &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;Video Streaming Development Services&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Video Streaming Development Services?
&lt;/h3&gt;

&lt;p&gt;Video Streaming Development Services cover the engineering of video platforms, including media ingestion, transcoding, adaptive bitrate delivery, playback applications, access control, and monitoring. They help teams build systems for live broadcasts, video-on-demand libraries, online learning, and other media-driven products.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Why use HLS instead of progressive video downloads?
&lt;/h3&gt;

&lt;p&gt;HLS divides video into segments and provides playlists that let compatible players select different quality levels. Unlike a single progressive file, adaptive HLS can change bitrate as network conditions fluctuate. It also supports CDN distribution, encryption options, and live-stream workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How does Node.js fit into a streaming architecture?
&lt;/h3&gt;

&lt;p&gt;Node.js is suitable for playback APIs, authentication, metadata management, upload coordination, and background-job orchestration. Media encoding should normally run in dedicated workers or managed media services because video processing can consume substantial CPU and memory resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How can developers reduce video buffering?
&lt;/h3&gt;

&lt;p&gt;Developers can reduce buffering by tuning bitrate ladders, checking segment availability, improving CDN cache hit ratios, and measuring player buffer behavior. They should also test weak network conditions and monitor rebuffering ratio, startup time, segment-download duration, and playback failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How should teams choose between standard HLS and low-latency HLS?
&lt;/h3&gt;

&lt;p&gt;Standard HLS is suitable for many video-on-demand and broadcast workflows where playback stability matters more than near-real-time delivery. Low-Latency HLS targets time-sensitive live experiences and requires compatible packaging, playlist behavior, and player support. Teams should evaluate latency requirements alongside buffering risk and infrastructure cost.&lt;/p&gt;

</description>
      <category>videostreaming</category>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Engineer Reliable Odoo Implementation Services for Growing Businesses</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Thu, 12 Nov 2026 02:38:58 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-engineer-reliable-odoo-implementation-services-for-growing-businesses-5g2n</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-engineer-reliable-odoo-implementation-services-for-growing-businesses-5g2n</guid>
      <description>&lt;p&gt;A sales order can pass validation, update inventory, and generate an invoice while still leaving a business with inconsistent data. This usually happens when custom modules, automated actions, access rules, and external integrations operate on different assumptions. The problem becomes harder to diagnose when the same transaction behaves differently under concurrent requests.&lt;/p&gt;

&lt;p&gt;Odoo Implementation Services should address these engineering risks before they become production incidents. For developers and solution architects, that means designing business workflows around Odoo's ORM, transaction boundaries, module dependencies, and integration contracts rather than treating implementation as a configuration exercise.&lt;/p&gt;

&lt;p&gt;This guide explains how to structure an Odoo deployment, implement a safe transactional workflow, and validate the result under realistic conditions. For project planning and implementation support, explore &lt;a href="https://www.oodles.com/odoo-implementation?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_50" rel="noopener noreferrer"&gt;Odoo implementation solutions&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;Odoo applications share business records through a common data model, but individual modules can introduce dependencies that affect transaction behavior. A customization involving Sales, Inventory, and Accounting must preserve the assumptions made by all three applications.&lt;/p&gt;

&lt;p&gt;Consider a distribution business that accepts orders through both its website and an internal sales team. Two requests may attempt to reserve the same limited stock. A poorly designed customization might perform a stock check before creating a reservation, allowing both requests to proceed based on the same outdated quantity.&lt;/p&gt;

&lt;p&gt;Before changing the workflow, establish the following prerequisites:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pin the environment: Record the Odoo version, PostgreSQL version, installed modules, and relevant configuration.&lt;/li&gt;
&lt;li&gt;Map the transaction: Identify which models are created or updated, which validations execute, and which integrations run.&lt;/li&gt;
&lt;li&gt;Define invariants: Specify conditions that must always hold, such as preventing duplicate external orders or negative available quantities.&lt;/li&gt;
&lt;li&gt;Create a reproducible test: Simulate simultaneous requests, failed downstream operations, and retries.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For context on production reliability, the PostgreSQL documentation on transaction isolation explains how concurrent transactions can observe and modify database state. The appropriate isolation level and locking strategy depend on the workflow and its consistency requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing Odoo Implementation Services Around Transaction Safety
&lt;/h2&gt;

&lt;p&gt;A reliable implementation makes business rules explicit, keeps database operations inside appropriate transaction boundaries, and handles external side effects separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Put Business Rules in the Correct Model
&lt;/h3&gt;

&lt;p&gt;Start by locating the model that owns the business invariant. Avoid placing critical validation exclusively in a form view or frontend action because imports, scheduled jobs, APIs, and other modules can bypass that interface.&lt;/p&gt;

&lt;p&gt;For example, an order model can validate a required external reference and reject duplicate references within the same company. A database uniqueness constraint should enforce the invariant when concurrent requests attempt the same insert.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Implement Explicit Validation
&lt;/h3&gt;

&lt;p&gt;The following example illustrates a custom Odoo model for an external order reference. It assumes a supported Odoo version with the modern &lt;code&gt;models.Constraint&lt;/code&gt; declaration syntax. Verify the exact API against your installed release.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;odoo&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ExternalOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"integration.external.order"&lt;/span&gt;
    &lt;span class="n"&gt;_description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"External Order"&lt;/span&gt;

    &lt;span class="n"&gt;company_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Many2one&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"res.company"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;external_ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Why: the database rejects duplicates even under concurrent inserts.&lt;/span&gt;
    &lt;span class="n"&gt;_external_ref_unique&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Constraint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"UNIQUE(company_id, external_ref)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"An external order reference must be unique per company."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This constraint protects the database even when two workers process the same reference simultaneously. Application-level checks can provide friendlier feedback, but a preliminary search alone cannot guarantee uniqueness under concurrency.&lt;/p&gt;

&lt;p&gt;If an integration retries a request after a timeout, use a stable external identifier as an idempotency key. Handle the resulting uniqueness violation according to the intended business behavior rather than blindly repeating the insert.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Separate Database Work From External Side Effects
&lt;/h3&gt;

&lt;p&gt;Database transactions cannot automatically roll back an email, a payment-provider request, or a message already delivered to an external queue.&lt;/p&gt;

&lt;p&gt;A practical architecture uses a transactional outbox:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create or update the business record and an outbox event in the same database transaction.&lt;/li&gt;
&lt;li&gt;Commit both records together.&lt;/li&gt;
&lt;li&gt;Let a background worker publish pending events.&lt;/li&gt;
&lt;li&gt;Mark events as delivered only after successful publication.&lt;/li&gt;
&lt;li&gt;Retry failures using bounded backoff and an idempotent consumer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach adds operational complexity because workers must track retries, duplicate deliveries, and permanently failing events. It is preferable to making a slow network request inside a database transaction when delayed delivery is acceptable. For immediate operations, use explicit timeouts and carefully defined failure handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;In an Odoo implementation project, the right engineering response to inconsistent order processing is to identify the failing transaction boundary, reproduce the concurrency pattern, and measure the fix under load. At Oodles, implementation work can include ERP configuration, custom module development, integration, and workflow validation, as described on the &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For an order-processing workflow, record baseline API latency, duplicate-order frequency, transaction failures, and queue backlog. Then repeat the same workload after introducing database constraints and asynchronous event delivery.&lt;/p&gt;

&lt;p&gt;Measurement note: No verified before-and-after performance figures for a specific Oodles project are available in the material used for this article, so numerical improvements should not be presented as client results. A reproducible load test provides defensible measurements for the actual deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Enforce business invariants at the model and database levels.&lt;/li&gt;
&lt;li&gt;Use stable external identifiers to make retries safe.&lt;/li&gt;
&lt;li&gt;Keep slow network calls outside database transactions.&lt;/li&gt;
&lt;li&gt;Benchmark concurrency, latency, and queue delays before and after changes.&lt;/li&gt;
&lt;li&gt;Test permissions, imports, scheduled jobs, and integrations alongside the user interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Discuss Your Implementation Approach
&lt;/h2&gt;

&lt;p&gt;How do you handle idempotency, concurrent stock reservations, or failed integration events in your Odoo projects? Share your approach in the comments.&lt;/p&gt;

&lt;p&gt;For technical discussions about &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;Odoo Implementation Services&lt;/a&gt;, connect with the Oodles team.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Odoo Implementation Services?
&lt;/h3&gt;

&lt;p&gt;Odoo Implementation Services cover ERP configuration, custom module development, data migration, integration, testing, deployment, and user training. Engineering teams should define business requirements, data ownership, security boundaries, and acceptance criteria before customizing standard Odoo workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How do you prevent duplicate orders in Odoo?
&lt;/h3&gt;

&lt;p&gt;Use a database uniqueness constraint on the appropriate external identifier and company scope. Handle uniqueness violations explicitly, and make integration retries idempotent. A preliminary ORM search can improve error messages, but it cannot replace database enforcement under concurrent requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How can developers improve Odoo performance?
&lt;/h3&gt;

&lt;p&gt;Profile slow requests, inspect PostgreSQL query plans, batch ORM operations, and review indexes before changing application code. Compare p50 and p95 latency under a representative workload. Avoid raw SQL unless necessary because it bypasses ORM security checks and framework behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Why should Odoo integrations use asynchronous processing?
&lt;/h3&gt;

&lt;p&gt;Asynchronous processing separates business transactions from slow or unavailable external systems. A transactional outbox preserves events alongside business changes, while background workers handle delivery and retries. Consumers must tolerate duplicate messages because successful delivery can occur more than once.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Which database supports Odoo, and why does transaction design matter?
&lt;/h3&gt;

&lt;p&gt;Odoo uses PostgreSQL as its database. The &lt;a href="https://survey.stackoverflow.co/2024/technology" rel="noopener noreferrer"&gt;2024 Stack Overflow Developer Survey&lt;/a&gt; reported PostgreSQL usage among 49% of surveyed developers, making it the survey's most-used database that year. Transaction design still matters because concurrent operations can violate business assumptions without appropriate constraints and synchronization.&lt;/p&gt;

</description>
      <category>odoo</category>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Inventory Management Services That Prevent Stock Drift</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Fri, 06 Nov 2026 04:29:53 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-inventory-management-services-that-prevent-stock-drift-10ic</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-inventory-management-services-that-prevent-stock-drift-10ic</guid>
      <description>&lt;p&gt;An order service reports 12 units available, but the warehouse can pick only 9. Meanwhile, two checkout requests have reserved the same final item. These failures often originate in systems where inventory updates, order processing, and warehouse operations use separate data stores without a clear consistency strategy.&lt;/p&gt;

&lt;p&gt;Inventory Management Services should maintain an authoritative view of stock while coordinating reservations, receipts, shipments, and cancellations. The challenge is not simply storing quantities. It is ensuring concurrent operations cannot silently create impossible inventory states.&lt;/p&gt;

&lt;p&gt;This article explains how to design an inventory service using transactional database updates, reservation records, and event-driven integration. For a broader ERP implementation context, explore &lt;a href="https://www.oodles.com/inventory-warehouse-management-?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_49" rel="noopener noreferrer"&gt;inventory and warehouse management solutions&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;An inventory service typically sits between the order management system, warehouse operations, purchasing workflows, and reporting infrastructure.&lt;/p&gt;

&lt;p&gt;A practical architecture includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API layer: Accepts stock adjustments, reservations, and fulfillment requests.&lt;/li&gt;
&lt;li&gt;Relational database: Stores inventory balances and reservation records.&lt;/li&gt;
&lt;li&gt;Message broker: Publishes committed inventory events to downstream systems.&lt;/li&gt;
&lt;li&gt;Background workers: Handle retries, reconciliation, and asynchronous processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PostgreSQL is a suitable choice when stock correctness depends on transactions and row-level locking. Redis can accelerate selected reads, but a cache should not independently authorize stock reservations.&lt;/p&gt;

&lt;p&gt;Consider a product with 20 units on hand and 6 already reserved. Its available quantity is 14, not 20.&lt;/p&gt;

&lt;p&gt;The PostgreSQL concurrency documentation explains how multiversion concurrency control supports concurrent database access while preserving data integrity. Developers still need to choose suitable transaction boundaries and constraints for their business rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Inventory Management Services Around Atomic Reservations
&lt;/h2&gt;

&lt;p&gt;The safest design treats stock reservation as a database operation, not a sequence of application-level checks. Inventory Management Services should reject requests that exceed available stock, even when multiple orders arrive simultaneously.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Separate physical stock from reserved stock
&lt;/h3&gt;

&lt;p&gt;Maintain separate fields for on-hand and reserved quantities. Calculate availability as:&lt;/p&gt;

&lt;p&gt;Available = On-hand - Reserved&lt;/p&gt;

&lt;p&gt;For each SKU and warehouse, enforce nonnegative quantities and use database constraints to reject invalid states. A reservation should also have a lifecycle, such as &lt;code&gt;PENDING&lt;/code&gt;, &lt;code&gt;CONFIRMED&lt;/code&gt;, &lt;code&gt;RELEASED&lt;/code&gt;, or &lt;code&gt;EXPIRED&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Reserve stock with a conditional update
&lt;/h3&gt;

&lt;p&gt;A common mistake is reading available stock into application memory, checking the quantity, and then updating it. Two concurrent requests can pass the same check.&lt;/p&gt;

&lt;p&gt;Instead, perform the availability check and reservation update in one SQL statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Reserve five units only when sufficient stock remains.&lt;/span&gt;
&lt;span class="k"&gt;UPDATE&lt;/span&gt; &lt;span class="n"&gt;inventory&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;reserved_qty&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reserved_qty&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;sku&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'SKU-104'&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;warehouse_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;on_hand_qty&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;reserved_qty&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;RETURNING&lt;/span&gt; &lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;on_hand_qty&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reserved_qty&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- No returned row means the reservation was rejected.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In production, bind the SKU, warehouse ID, and quantity as parameters rather than embedding constants. Validate that the requested quantity is positive, and create the reservation record in the same database transaction.&lt;/p&gt;

&lt;p&gt;Use a unique idempotency key for each reservation request so that a client retry after a timeout cannot reserve the same units twice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Publish inventory events safely
&lt;/h3&gt;

&lt;p&gt;A successful reservation may need to notify order processing, warehouse picking, and analytics. Publishing directly to a message broker after committing the database transaction creates a failure window.&lt;/p&gt;

&lt;p&gt;Use a transactional outbox:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update inventory and create the reservation.&lt;/li&gt;
&lt;li&gt;Insert an event into an outbox table within the same transaction.&lt;/li&gt;
&lt;li&gt;Commit both database changes together.&lt;/li&gt;
&lt;li&gt;Let a background worker publish pending events and retry failures.&lt;/li&gt;
&lt;li&gt;Make consumers idempotent because messages can be delivered more than once.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Trade-off: A synchronous database transaction is appropriate for protecting a single inventory record. An outbox adds operational complexity, but it avoids relying on a distributed transaction between the database and broker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;Inventory correctness should be verified with concurrency tests, not inferred from successful API responses. In an Oodles ERP implementation scenario, the engineering team can address stock mismatches by combining transactional reservations, idempotent commands, and asynchronous warehouse events.&lt;/p&gt;

&lt;p&gt;Consider a warehouse holding 100 units when 1,000 concurrent reservation requests each request one unit. The acceptance criteria are straightforward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exactly 100 units can be reserved.&lt;/li&gt;
&lt;li&gt;The remaining 900 requests are rejected for insufficient stock.&lt;/li&gt;
&lt;li&gt;Retrying an accepted request with the same idempotency key does not create another reservation.&lt;/li&gt;
&lt;li&gt;A broker outage does not erase committed inventory events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These figures describe a proposed stress-test scenario, not published Oodles client results. Measure actual throughput, p95 latency, lock waits, and event-delivery delay in your deployment before claiming performance improvements.&lt;/p&gt;

&lt;p&gt;For implementation patterns across ERP, integrations, and business applications, visit &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep one authoritative inventory balance per SKU and warehouse.&lt;/li&gt;
&lt;li&gt;Use conditional SQL updates to prevent concurrent overselling.&lt;/li&gt;
&lt;li&gt;Store reservation states and idempotency keys to support safe retries.&lt;/li&gt;
&lt;li&gt;Publish committed changes through a transactional outbox.&lt;/li&gt;
&lt;li&gt;Test concurrency, duplicate delivery, cancellation, and recovery under failure conditions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Continue the Discussion
&lt;/h2&gt;

&lt;p&gt;How does your inventory platform handle concurrent reservations across multiple warehouses? Share your architecture, database choice, or consistency challenges in the comments.&lt;/p&gt;

&lt;p&gt;For help designing or improving &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;Inventory Management Services&lt;/a&gt;, discuss your requirements with the Oodles team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Inventory Management Services in an ERP system?
&lt;/h3&gt;

&lt;p&gt;Inventory Management Services are software components that track stock quantities, warehouse locations, reservations, receipts, transfers, and shipments. They coordinate inventory changes with order processing and purchasing while enforcing business rules that prevent invalid stock balances.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How can developers prevent inventory overselling?
&lt;/h3&gt;

&lt;p&gt;Developers can prevent overselling by checking available stock and updating reserved quantities in one atomic database operation. Conditional SQL updates, appropriate transaction isolation, database constraints, and idempotency keys help protect inventory when concurrent requests or retries occur.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Should inventory systems use SQL or NoSQL databases?
&lt;/h3&gt;

&lt;p&gt;SQL databases are useful when inventory operations require transactions, constraints, and consistent updates across related records. NoSQL databases can suit particular access patterns and workloads, but developers must explicitly design concurrency control and conditional writes to preserve stock invariants.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How does event-driven architecture improve warehouse integration?
&lt;/h3&gt;

&lt;p&gt;Event-driven architecture allows inventory changes to notify warehouse, order, and reporting services asynchronously. A transactional outbox helps prevent lost notifications after database commits, while idempotent consumers and retry policies handle duplicate delivery and temporary downstream failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How should teams test Inventory Management Services under load?
&lt;/h3&gt;

&lt;p&gt;Teams should simulate concurrent reservations, duplicate requests, database failures, and message-broker outages. Verify that reserved quantities never exceed on-hand stock, retries do not duplicate reservations, and committed events eventually reach consumers. Measure throughput, p95 latency, lock contention, and recovery time.&lt;/p&gt;

</description>
      <category>erp</category>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Odoo Implementation Services for Safe Webhook Retries</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Thu, 05 Nov 2026 07:25:16 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/odoo-implementation-services-for-safe-webhook-retries-3ce7</link>
      <guid>https://dev.to/naresh_chandralohani/odoo-implementation-services-for-safe-webhook-retries-3ce7</guid>
      <description>&lt;p&gt;A webhook timeout does not tell the sender whether Odoo committed the transaction. It only tells the sender that a response did not arrive in time. If the sender retries, a naive integration can create duplicate orders, payments, or inventory operations.&lt;/p&gt;

&lt;p&gt;During &lt;a href="https://erpsolutions.oodles.io/odoo-implementation-services?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_48" rel="noopener noreferrer"&gt;Odoo implementation service overview&lt;/a&gt;, this failure often hides behind otherwise successful API calls. We can prevent it by giving every external event a stable identity and enforcing that identity inside PostgreSQL. This article builds that pattern for Odoo 18 and explains where it stops being sufficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Odoo 18.0 with a custom module.&lt;/li&gt;
&lt;li&gt;Python 3.12 and PostgreSQL 16, subject to verification against your deployed Odoo build.&lt;/li&gt;
&lt;li&gt;A basic understanding of Odoo models, recordsets, and database transactions.&lt;/li&gt;
&lt;li&gt;An external sender that supplies a stable event identifier.&lt;/li&gt;
&lt;li&gt;A development database for testing duplicate and concurrent deliveries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code below uses Odoo's ORM and PostgreSQL uniqueness constraints. Treat the snippets as fragments for a custom module, not as a complete installable repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the obvious approach fails
&lt;/h2&gt;

&lt;p&gt;A common first attempt checks whether an event already exists before creating a record. That works for sequential requests, but it does not protect against concurrent deliveries.&lt;/p&gt;

&lt;p&gt;Consider two workers receiving the same event nearly simultaneously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fragment: unsafe duplicate check
&lt;/span&gt;&lt;span class="n"&gt;existing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration.event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;existing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration.event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both transactions can search before either creates the record. Both searches return empty results, and both workers proceed.&lt;/p&gt;

&lt;p&gt;This is a time-of-check-to-time-of-use race. Adding another search or a Python lock does not reliably solve it across multiple Odoo workers or application servers.&lt;/p&gt;

&lt;p&gt;The database must enforce the invariant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Give every incoming event a stable identity
&lt;/h2&gt;

&lt;p&gt;Choose an identifier that remains unchanged across retries. A provider's event ID is preferable to a timestamp or a newly generated UUID, because the sender must reuse the same identity.&lt;/p&gt;

&lt;p&gt;If the provider does not supply a stable ID, derive one from a documented business-event identity. Do not hash an arbitrary payload without considering whether harmless field changes should represent a new event.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Enforce uniqueness in the Odoo model
&lt;/h2&gt;

&lt;p&gt;Create a dedicated model that records processed external events. The following fragment uses Odoo 18's model API and a SQL uniqueness constraint.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fragment: models/integration_event.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;odoo&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;IntegrationEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration.event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;_description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;External Integration Event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;event_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Selection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;received&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Received&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
        &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;received&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;_sql_constraints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration_event_key_unique&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;UNIQUE(event_key)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;This external event has already been registered.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The uniqueness constraint is the important part. PostgreSQL serializes conflicting inserts so that two transactions cannot commit the same non-null key.&lt;/p&gt;

&lt;p&gt;Keep the event key required. SQL uniqueness constraints generally allow multiple null values, so a nullable key would weaken this design.&lt;/p&gt;

&lt;p&gt;For multi-company systems or multiple external providers, decide the scope of uniqueness explicitly. You may need a composite key such as &lt;code&gt;(provider, company_id, event_key)&lt;/code&gt; instead of a globally unique event key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Handle a duplicate without breaking the transaction
&lt;/h2&gt;

&lt;p&gt;A uniqueness violation raises a database error. Catching it without a savepoint can leave the current transaction unusable until rollback.&lt;/p&gt;

&lt;p&gt;Use a savepoint around the insert, then retrieve the existing event if the insert conflicts. The following is a fragment for an Odoo model method; it assumes &lt;code&gt;event_key&lt;/code&gt; has already been validated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fragment: method on a model with access to env
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;psycopg2&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IntegrityError&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;register_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;Event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;integration.event&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;savepoint&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;IntegrityError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;event_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;)],&lt;/span&gt;
            &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The boolean indicates whether this call created the event. A conflicting insert is not automatically proof of a duplicate event: another constraint could have failed, so the code re-raises if no matching key exists.&lt;/p&gt;

&lt;p&gt;This method is a building block, not a complete webhook handler. Validate the request, authenticate its sender, and confirm the event's business scope before invoking it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Keep event registration and business changes atomic
&lt;/h2&gt;

&lt;p&gt;Idempotency is not complete if Odoo records an event as processed before creating its business record. A crash between those operations could cause a retry to be ignored even though the order was never created.&lt;/p&gt;

&lt;p&gt;Register the event, create or update the business record, and mark the event complete in the same database transaction. If the business operation fails, let the transaction roll back.&lt;/p&gt;

&lt;p&gt;A simplified orchestration fragment looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fragment: invoked within the request's Odoo transaction
&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;register_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;created&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;duplicate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_business_record&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;done&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;processed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;create_business_record&lt;/code&gt; represents application-specific logic that must be implemented and tested in your module. The example assumes that the event and business record use the same database transaction.&lt;/p&gt;

&lt;p&gt;If the process crashes before commit, both changes roll back. If the transaction commits but the HTTP response is lost, a retry finds the completed event instead of repeating the business operation.&lt;/p&gt;

&lt;p&gt;Do not call external services inside this transaction and assume their effects will roll back with PostgreSQL. An external payment, email, or shipping request may succeed even when the local transaction fails.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Test retries and concurrency
&lt;/h2&gt;

&lt;p&gt;A successful test should cover more than sending the same request twice in sequence. Test the case that caused the original bug, including simultaneous deliveries and failures around commit.&lt;/p&gt;

&lt;p&gt;At minimum, verify these scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two sequential requests with the same key create one business record.&lt;/li&gt;
&lt;li&gt;Two concurrent requests with the same key create one business record.&lt;/li&gt;
&lt;li&gt;Two different event keys create two independent records.&lt;/li&gt;
&lt;li&gt;An invalid payload creates no completed event.&lt;/li&gt;
&lt;li&gt;A business-operation failure rolls back event registration.&lt;/li&gt;
&lt;li&gt;A retry after a committed transaction but a lost response returns the existing result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a basic database-level check, inspect the stored keys after sending repeated test requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;integration_event&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;event_key&lt;/span&gt;
&lt;span class="k"&gt;HAVING&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output: zero rows. This query verifies that duplicates do not exist in the inspected table; it does not prove that every business side effect is idempotent.&lt;/p&gt;

&lt;p&gt;Use Odoo integration tests and independent transactions for concurrency testing. A single-threaded unit test cannot reproduce the race reliably.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trade-offs and limitations
&lt;/h2&gt;

&lt;p&gt;Database-backed idempotency adds a table, a uniqueness index, and a retention policy. Large integrations must decide how long to preserve event identities without making duplicate detection expire prematurely.&lt;/p&gt;

&lt;p&gt;It also assumes that retries reuse the same event key. If a sender generates a new key for every attempt, the database cannot recognize those requests as the same event.&lt;/p&gt;

&lt;p&gt;Finally, a local transaction cannot guarantee exactly-once effects across independent systems. Use an outbox pattern for reliable outbound messages, provider-side idempotency keys where supported, and reconciliation for operations whose outcomes remain uncertain.&lt;/p&gt;

&lt;p&gt;These are important boundaries in Odoo implementation services: database correctness, request handling, and external side effects need separate failure strategies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-world application
&lt;/h2&gt;

&lt;p&gt;We implemented this in... OODLES PROJECT REFERENCE NEEDED: identify an anonymized Odoo integration project where external retries or duplicate business events were a real constraint.&lt;/p&gt;

&lt;p&gt;The implementation should describe the external system, the event being processed, the original failure mode, and the transaction or constraint change. Add a measured outcome only after validating it against project records.&lt;/p&gt;

&lt;p&gt;For broader context on the delivery work around ERP configuration, integrations, and deployment, see the &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Odoo implementation service overview&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A pre-insert search cannot prevent concurrent duplicate creation.&lt;/li&gt;
&lt;li&gt;A stable external event ID gives retries a consistent identity.&lt;/li&gt;
&lt;li&gt;A database uniqueness constraint protects that identity across workers.&lt;/li&gt;
&lt;li&gt;A savepoint lets the application handle an expected conflict without abandoning the surrounding transaction.&lt;/li&gt;
&lt;li&gt;External side effects need their own idempotency, outbox, or reconciliation strategy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have encountered a different failure boundary in an Odoo integration, share the scenario and how you tested recovery. A small reproducible test is often more useful than a generic claim about reliability. &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;ContactUS&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I prevent duplicate webhook records in Odoo?
&lt;/h3&gt;

&lt;p&gt;Use a stable event ID and enforce its uniqueness in PostgreSQL. A pre-insert search alone is vulnerable to concurrent requests, so the database must enforce the invariant.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I use an Odoo constraint or a PostgreSQL constraint?
&lt;/h3&gt;

&lt;p&gt;Use a database uniqueness constraint when concurrent transactions must not create duplicate keys. Python-level validation remains useful for clearer business error messages, but it cannot replace database-enforced uniqueness.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens if the webhook sender retries after a timeout?
&lt;/h3&gt;

&lt;p&gt;The retry should return the result associated with the existing event when the original transaction committed. If the original transaction rolled back, the retry should be allowed to process the event again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does idempotency prevent duplicate payment charges?
&lt;/h3&gt;

&lt;p&gt;Not by itself. It prevents duplicate local processing only when the event identity and transaction boundaries are correct; payment providers may require their own idempotency keys and reconciliation logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  How should I handle Odoo integration events that fail repeatedly?
&lt;/h3&gt;

&lt;p&gt;Record enough information to diagnose the failure, apply bounded retries where appropriate, and separate permanent validation errors from transient failures. Use a durable queue or outbox when delivery must survive process restarts.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Build Production-Ready Agentic AI Development Services Using Python and FastAPI</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Wed, 04 Nov 2026 02:38:02 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-production-ready-agentic-ai-development-services-using-python-and-fastapi-3id5</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-production-ready-agentic-ai-development-services-using-python-and-fastapi-3id5</guid>
      <description>&lt;p&gt;An AI agent that repeatedly calls tools, loses conversation state, or executes the wrong action can create serious problems in production systems. These failures often occur when developers move from a single LLM request to workflows involving multiple tools, external APIs, and conditional execution.&lt;/p&gt;

&lt;p&gt;Building reliable Agentic AI Development Services requires more than connecting an LLM to a collection of functions. Developers need an execution architecture that controls agent decisions, validates tool calls, manages state, and handles failures.&lt;/p&gt;

&lt;p&gt;This article explains how to implement that architecture using Python, FastAPI, Redis, PostgreSQL, and Docker. It also covers the engineering decisions behind &lt;a href="https://www.oodles.com/agentic-ai?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_47" rel="noopener noreferrer"&gt;agentic AI development solutions&lt;/a&gt; for systems that must operate beyond experimental environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;A production agent typically consists of five components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;LLM: Interprets requests and proposes actions.&lt;/li&gt;
&lt;li&gt;Orchestrator: Controls execution order and stopping conditions.&lt;/li&gt;
&lt;li&gt;Tool registry: Exposes approved APIs and functions.&lt;/li&gt;
&lt;li&gt;State store: Maintains task history and execution checkpoints.&lt;/li&gt;
&lt;li&gt;Observability layer: Records decisions, latency, token usage, and failures.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consider an internal operations assistant that retrieves customer records, checks inventory, and creates service tickets. A conventional chatbot returns information. An agent can execute the complete workflow, provided each action passes authorization and validation.&lt;/p&gt;

&lt;p&gt;The evaluation challenge is significant. Stanford's 2025 AI Index reported that the top-performing model on VisualAgentBench achieved only 36.2% success. This demonstrates why model capability alone cannot establish production readiness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing Agentic AI Development Services with a Controlled Execution Loop
&lt;/h2&gt;

&lt;p&gt;A controlled execution loop separates reasoning from execution. The model proposes an action, the application validates it, and only then does the tool execute.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Explicit Agent Boundaries
&lt;/h3&gt;

&lt;p&gt;Start by defining what the agent can and cannot do.&lt;/p&gt;

&lt;p&gt;For example, an inventory agent might access product availability but should not modify pricing or customer permissions.&lt;/p&gt;

&lt;p&gt;Define each tool using a strict input schema. Avoid exposing unrestricted database connections or arbitrary shell execution to the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Implement a Validated Tool Execution Layer
&lt;/h3&gt;

&lt;p&gt;FastAPI provides a practical foundation for exposing agent workflows. The following example demonstrates a controlled inventory lookup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HTTPException&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Literal&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AgentRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Literal&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;check_inventory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;check_inventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: Keep tool execution inside application-controlled logic.
&lt;/span&gt;    &lt;span class="n"&gt;inventory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SKU101&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SKU102&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;inventory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/agent/tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AgentRequest&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: Reject unsupported actions before execution.
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;check_inventory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Invalid action&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Why: Validate identifiers before accessing business data.
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;422&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Missing product ID&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;product_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;available_stock&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;check_inventory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;product_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In production, add authentication, tenant-level authorization, structured error handling, and audit logging. The model should never determine its own permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Persist State and Control Retries
&lt;/h3&gt;

&lt;p&gt;Agents frequently need several execution steps to complete one task. Redis can store short-lived execution state, while PostgreSQL maintains durable records.&lt;/p&gt;

&lt;p&gt;A practical workflow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a unique execution ID.&lt;/li&gt;
&lt;li&gt;Store the initial request and current execution status.&lt;/li&gt;
&lt;li&gt;Save each tool invocation and its result.&lt;/li&gt;
&lt;li&gt;Retry transient failures using bounded exponential backoff.&lt;/li&gt;
&lt;li&gt;Stop after a defined iteration or token budget.&lt;/li&gt;
&lt;li&gt;Persist the final response and execution trace.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For distributed workloads, use a durable task queue rather than relying on an HTTP request to remain active throughout the entire workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Choose the Right Orchestration Strategy
&lt;/h3&gt;

&lt;p&gt;Not every workflow requires multiple autonomous agents.&lt;/p&gt;

&lt;p&gt;A single-agent architecture is easier to debug and monitor. A multi-agent architecture can separate research, validation, and execution responsibilities, but introduces additional communication, coordination, and failure points.&lt;/p&gt;

&lt;p&gt;For most business workflows, start with one orchestrator and specialized tools. Introduce multiple agents only when independent responsibilities justify the additional complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application: Engineering Agent Workflows at Oodles
&lt;/h2&gt;

&lt;p&gt;At Oodles, an important architectural consideration when designing Agentic AI Development Services is separating LLM reasoning from business-critical execution.&lt;/p&gt;

&lt;p&gt;Consider an enterprise operations workflow involving customer information retrieval, inventory verification, and ticket creation. A suitable implementation uses Python for orchestration, FastAPI for service endpoints, Redis for execution state, PostgreSQL for persistent records, and Docker for deployment.&lt;/p&gt;

&lt;p&gt;The workflow should record tool-call success rates, average execution latency, retry frequency, token consumption, and human escalation rates.&lt;/p&gt;

&lt;p&gt;These measurements provide a basis for evaluating whether the system improves operational performance. Actual project-specific performance figures should be reported only after validation against deployment telemetry.&lt;/p&gt;

&lt;p&gt;Explore &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt; for more information about its AI engineering capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Technical Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep LLM reasoning separate from application-controlled tool execution.&lt;/li&gt;
&lt;li&gt;Validate every tool input against explicit schemas and permissions.&lt;/li&gt;
&lt;li&gt;Use Redis for short-lived state and PostgreSQL for durable execution records.&lt;/li&gt;
&lt;li&gt;Introduce multi-agent coordination only when the workflow requires it.&lt;/li&gt;
&lt;li&gt;Evaluate agents using task completion, execution latency, failure rates, and operating cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Production agent engineering is fundamentally an exercise in controlling uncertainty, not simply improving prompts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Discuss Agent Architecture
&lt;/h2&gt;

&lt;p&gt;Are you implementing tool-calling workflows, multi-agent orchestration, or stateful AI applications? Share your architecture challenges and implementation questions in the comments.&lt;/p&gt;

&lt;p&gt;For technical discussions about &lt;a href="https://www.oodles.com/agentic-ai" rel="noopener noreferrer"&gt;Agentic AI Development Services&lt;/a&gt;, connect with the Oodles team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Agentic AI Development Services?
&lt;/h3&gt;

&lt;p&gt;Agentic AI Development Services involve engineering AI systems that can plan tasks, select tools, execute actions, and evaluate results. These solutions typically combine LLMs, orchestration frameworks, APIs, memory systems, and application-level security controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How is an AI agent different from a chatbot?
&lt;/h3&gt;

&lt;p&gt;A chatbot primarily generates conversational responses based on user input. An AI agent can execute multi-step workflows, interact with external services, retrieve information, and perform authorized actions while maintaining execution state.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Which Python frameworks are suitable for building AI agents?
&lt;/h3&gt;

&lt;p&gt;Python frameworks such as LangGraph and the OpenAI Agents SDK support agent orchestration and tool execution. FastAPI can expose application endpoints, while Redis and PostgreSQL support state management and persistence.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How do developers prevent AI agents from executing incorrect actions?
&lt;/h3&gt;

&lt;p&gt;Developers should implement schema validation, role-based authorization, tool allowlists, execution limits, audit logs, and human approval for sensitive operations. External actions should pass application-level checks before execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How long does it take to implement Agentic AI Development Services?
&lt;/h3&gt;

&lt;p&gt;Implementation time depends on workflow complexity, integrations, security requirements, and evaluation needs. A limited proof of concept may take weeks, while enterprise deployments generally require additional integration, testing, governance, and operational preparation.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Production-Ready ERP Workflows with Generative AI Development Services</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Tue, 03 Nov 2026 06:45:12 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-production-ready-erp-workflows-with-generative-ai-development-services-1e20</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-production-ready-erp-workflows-with-generative-ai-development-services-1e20</guid>
      <description>&lt;p&gt;Architecture Deep Dive | ERP | Generative AI | Backend Engineering&lt;/p&gt;

&lt;p&gt;An ERP assistant that generates a plausible answer but retrieves an outdated inventory count can create more problems than it solves. The issue is rarely just the language model. It is usually a combination of stale business data, missing authorization checks, poorly defined tool interfaces, and insufficient evaluation.&lt;/p&gt;

&lt;p&gt;Generative AI Development Services can help engineering teams integrate language models into ERP workflows without treating model output as a trusted source of business truth. The key is to separate reasoning from execution, validate every operation, and measure reliability at the workflow level.&lt;/p&gt;

&lt;p&gt;This article walks through a practical architecture for connecting an AI assistant to ERP data, handling structured tool calls, and controlling failure modes. For implementation options and integration patterns, explore &lt;a href="https://www.oodles.com/generative-ai?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_46" rel="noopener noreferrer"&gt;generative AI development solutions&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;An ERP-integrated AI assistant typically sits between a user interface and existing business services. It may answer questions about purchase orders, summarize invoices, or prepare inventory reports, but it should not bypass the ERP's existing business rules.&lt;/p&gt;

&lt;p&gt;A practical architecture contains five components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API layer: Authenticates users and validates incoming requests.&lt;/li&gt;
&lt;li&gt;Orchestration service: Selects tools and manages model interactions.&lt;/li&gt;
&lt;li&gt;Retrieval layer: Fetches relevant ERP records and documentation.&lt;/li&gt;
&lt;li&gt;Business service layer: Executes authorized, validated operations.&lt;/li&gt;
&lt;li&gt;Observability layer: Records latency, token consumption, tool failures, and output quality.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The need for these controls becomes clearer when looking at developer adoption. Stack Overflow's reported that 76% of respondents were using or planning to use AI tools in their development process. Adoption, however, does not establish that AI-generated results are safe for financial or operational workflows.&lt;/p&gt;

&lt;p&gt;For ERP systems, authorization, data freshness, and transaction integrity remain application responsibilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing the Workflow with Generative AI Development Services
&lt;/h2&gt;

&lt;p&gt;The safest approach is to let the model interpret requests while deterministic application services control business operations. This separation makes the system easier to test, audit, and maintain.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Explicit ERP Tools
&lt;/h3&gt;

&lt;p&gt;Start by exposing a small set of business operations rather than giving the model unrestricted database access.&lt;/p&gt;

&lt;p&gt;For example, an inventory assistant might expose &lt;code&gt;get_stock_level&lt;/code&gt;, &lt;code&gt;find_purchase_order&lt;/code&gt;, and &lt;code&gt;create_purchase_request&lt;/code&gt;. Each tool should have a defined input schema, authorization rules, and predictable error responses.&lt;/p&gt;

&lt;p&gt;Use retrieval-augmented generation (RAG) for questions requiring internal documentation, and structured tool calls for live ERP records. These approaches solve different problems and should not be treated as interchangeable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Validate Tool Calls Before Execution
&lt;/h3&gt;

&lt;p&gt;A model-generated tool call is a request, not permission to execute an operation. Validate parameters, verify the user's access, and enforce business rules before calling the ERP service.&lt;/p&gt;

&lt;p&gt;Here is a minimal Python example using Pydantic to validate a purchase request before it reaches the business layer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;decimal&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Decimal&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Field&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PurchaseRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;item_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;le&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Decimal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Field&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;prepare_purchase_request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: reject malformed model output before business execution.
&lt;/span&gt;    &lt;span class="n"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PurchaseRequest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;model_validate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Why: model output must never determine user permissions.
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;can_create_purchase_requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;PermissionError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Purchase request creation is not allowed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Why: return validated data; the ERP service applies its own rules.
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;item_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;item_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;quantity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unit_price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unit_price&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example validates structure and one authorization condition. A production implementation must also verify item existence, currency, budget limits, pricing rules, and tenant boundaries inside the authoritative ERP service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Control Latency and Failure Modes
&lt;/h3&gt;

&lt;p&gt;Generative AI workflows can become slow when retrieval, model inference, and ERP calls execute sequentially without need.&lt;/p&gt;

&lt;p&gt;Apply these controls:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set explicit timeouts for model and ERP requests.&lt;/li&gt;
&lt;li&gt;Cache stable reference data, not rapidly changing stock quantities.&lt;/li&gt;
&lt;li&gt;Retry transient failures with bounded exponential backoff and jitter.&lt;/li&gt;
&lt;li&gt;Use idempotency keys for operations that create or modify records.&lt;/li&gt;
&lt;li&gt;Limit tool-call counts and enforce a maximum end-to-end deadline.&lt;/li&gt;
&lt;li&gt;Track p50, p95, and p99 latency separately for retrieval, inference, and business operations.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Parallel execution can reduce latency when independent read operations are involved. However, dependent transactions must preserve their required execution order. Caching and retries also need careful design: stale data can mislead users, while careless retries can create duplicate purchase requests.&lt;/p&gt;

&lt;p&gt;For enterprise teams evaluating &lt;a href="https://www.oodles.com/" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt;, the architectural discussion should include ERP integration boundaries, data access controls, deployment requirements, and workload-specific evaluation criteria.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;Consider an ERP assistant that helps procurement teams investigate low-stock items and prepare purchase requests. The central engineering challenge is combining current inventory data with supplier information without allowing an LLM to invent quantities or execute unauthorized changes.&lt;/p&gt;

&lt;p&gt;A suitable implementation retrieves stock levels from the ERP, fetches approved supplier records, asks the model to summarize the evidence, and requires a separate validated action to create a purchase request.&lt;/p&gt;

&lt;p&gt;Measurement matters: I could not verify a published Oodles project report containing before-and-after latency figures for this exact workflow, so attributing a specific performance improvement to an actual Oodles engagement would be misleading.&lt;/p&gt;

&lt;p&gt;Instead, establish a baseline using representative ERP workloads. Record response latency, retrieval accuracy, invalid tool-call rate, authorization failures, and duplicate transaction count. Run the same test suite after each architectural change and report measured results with the workload, sample size, and test environment.&lt;/p&gt;

&lt;p&gt;This produces evidence that engineering teams can reproduce rather than relying on an unsupported performance claim.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep model reasoning separate from authoritative ERP operations.&lt;/li&gt;
&lt;li&gt;Validate tool arguments and enforce authorization in application services.&lt;/li&gt;
&lt;li&gt;Use RAG for internal knowledge and tool calls for live business data.&lt;/li&gt;
&lt;li&gt;Measure end-to-end latency and task correctness, not just model response speed.&lt;/li&gt;
&lt;li&gt;Test retries, stale data, duplicate requests, and permission boundaries before production deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Continue the Discussion
&lt;/h2&gt;

&lt;p&gt;How are you connecting LLMs to ERP systems while preserving transaction integrity? Share your architecture, testing strategy, or integration challenges in the comments.&lt;/p&gt;

&lt;p&gt;If your team is planning an ERP-integrated AI workflow, discuss your requirements through &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;Generative AI Development Services&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Generative AI Development Services in ERP systems?
&lt;/h3&gt;

&lt;p&gt;Generative AI Development Services help organizations integrate language models into ERP workflows, including document extraction, natural-language reporting, knowledge retrieval, and assisted transaction processing. Effective implementations connect models to authorized business services instead of granting unrestricted access to operational databases.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Should an ERP AI assistant use RAG or function calling?
&lt;/h3&gt;

&lt;p&gt;Use RAG when answers depend on internal documentation, policies, or indexed knowledge. Use function calling when the assistant needs current structured records or must request a business operation. Many ERP assistants combine both approaches, with authorization and validation enforced outside the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How do you prevent hallucinations in ERP applications?
&lt;/h3&gt;

&lt;p&gt;Retrieve authoritative data, constrain outputs with schemas, validate calculations in application code, and require confirmation for consequential actions. Log source records and tool results so incorrect answers can be investigated. These controls reduce risk but cannot guarantee that a language model will never generate an incorrect statement.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How can developers reduce latency in generative AI workflows?
&lt;/h3&gt;

&lt;p&gt;Profile each stage separately, reduce unnecessary model calls, retrieve only relevant records, and parallelize independent requests. Use bounded timeouts and cache only data whose freshness requirements permit it. Validate improvements using repeated tests and percentile latency measurements under representative load.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How should teams evaluate an ERP AI assistant before launch?
&lt;/h3&gt;

&lt;p&gt;Build an evaluation set covering common requests, ambiguous instructions, missing records, unauthorized access, and failed ERP calls. Measure task accuracy, groundedness, tool-call validity, latency, and cost. Run regression tests whenever prompts, models, retrieval settings, or business integrations change.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build a Scalable OTT App Development Architecture with Node.js and AWS</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Mon, 02 Nov 2026 06:01:07 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-a-scalable-ott-app-development-architecture-with-nodejs-and-aws-1kkb</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-a-scalable-ott-app-development-architecture-with-nodejs-and-aws-1kkb</guid>
      <description>&lt;p&gt;A streaming application can work perfectly during development and still fail when thousands of users start watching simultaneously. Common causes include overloaded playback APIs, inefficient video delivery, delayed authentication responses, and poor handling of network fluctuations.&lt;/p&gt;

&lt;p&gt;These problems become more difficult when an OTT platform supports live streaming, video-on-demand (VOD), subscriptions, and multiple device types.&lt;/p&gt;

&lt;p&gt;Successful ott app development requires more than building a video player and connecting it to a media server. It requires an architecture that separates content processing, playback authorization, user management, and video distribution.&lt;/p&gt;

&lt;p&gt;This guide explains how to design that architecture using Node.js and AWS, with practical implementation considerations for backend engineers and solution architects. For a broader implementation perspective, explore &lt;a href="https://www.oodles.com/video/ott?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_45" rel="noopener noreferrer"&gt;OTT video streaming development&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;An OTT application typically consists of five interconnected layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Client applications: Android, iOS, web browsers, Android TV, and Smart TVs.&lt;/li&gt;
&lt;li&gt;Backend services: Authentication, subscriptions, content discovery, and playback authorization.&lt;/li&gt;
&lt;li&gt;Media processing: Video transcoding, packaging, and thumbnail generation.&lt;/li&gt;
&lt;li&gt;Storage and delivery: Object storage and Content Delivery Networks (CDNs).&lt;/li&gt;
&lt;li&gt;Analytics: Playback monitoring, viewer engagement, and subscription events.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A practical AWS deployment can use Amazon S3 for media storage, AWS Elemental MediaConvert for transcoding, CloudFront for content distribution, and Node.js microservices for application APIs.&lt;/p&gt;

&lt;p&gt;Docker containers provide consistent deployment environments, while Redis supports caching frequently accessed metadata and session-related information.&lt;/p&gt;

&lt;p&gt;Performance monitoring is particularly important. Conviva's State of Streaming Q1 2022 report recorded a global average video startup time of 5.53 seconds and a buffering ratio of 0.3%. These figures demonstrate why playback startup and rebuffering should be measured independently rather than treating video delivery as a single performance metric.&lt;/p&gt;

&lt;p&gt;Source: Conviva, State of Streaming Q1 2022.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building an OTT App Development Architecture That Scales
&lt;/h2&gt;

&lt;p&gt;The architecture should separate playback control from actual video delivery. Application servers should authorize requests, while CDNs handle high-volume media traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Separate Media Processing from Application APIs
&lt;/h3&gt;

&lt;p&gt;Video files should not pass through ordinary application servers during playback.&lt;/p&gt;

&lt;p&gt;Instead, implement an asynchronous media-processing pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload the original video to an S3 ingestion bucket.&lt;/li&gt;
&lt;li&gt;Trigger a processing job when the upload completes.&lt;/li&gt;
&lt;li&gt;Use MediaConvert to generate multiple resolutions and bitrates.&lt;/li&gt;
&lt;li&gt;Package the output into HLS or MPEG-DASH formats.&lt;/li&gt;
&lt;li&gt;Store the generated segments and manifests in a delivery bucket.&lt;/li&gt;
&lt;li&gt;Distribute the packaged content through CloudFront.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This separation prevents video processing workloads from competing with authentication, subscription, and content-discovery requests.&lt;/p&gt;

&lt;p&gt;Adaptive Bitrate Streaming (ABR) is particularly important because the player can select an appropriate rendition based on available network bandwidth and device capabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Implement Secure Playback Authorization with Node.js
&lt;/h3&gt;

&lt;p&gt;Playback authorization should verify whether a subscriber can access a particular asset before issuing access to its media resources.&lt;/p&gt;

&lt;p&gt;A backend endpoint can validate subscription entitlements and generate a time-limited CloudFront URL.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;getSignedUrl&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@aws-sdk/cloudfront-signer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/playback/:contentId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Why: Authentication middleware identifies the current subscriber.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Why: Verify content access before issuing playback credentials.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allowed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkSubscription&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentId&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Subscription does not permit playback&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Why: Restrict access to an authorized CDN resource.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;playbackUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getSignedUrl&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CDN_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contentId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/master.m3u8`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;keyPairId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CLOUDFRONT_KEY_PAIR_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;privateKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CLOUDFRONT_PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;dateLessThan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;playbackUrl&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Why: Avoid exposing internal infrastructure details.&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unable to authorize playback&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example assumes that authentication middleware, &lt;code&gt;checkSubscription()&lt;/code&gt;, and environment configuration are already implemented.&lt;/p&gt;

&lt;p&gt;In production, validate content ownership, geographic restrictions, concurrent-device limits, and subscription status. Also consider signed cookies when a player needs access to multiple HLS segments rather than a single manifest URL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Optimize Delivery and Backend Performance
&lt;/h3&gt;

&lt;p&gt;The biggest architectural decision is avoiding unnecessary backend involvement during video playback.&lt;/p&gt;

&lt;p&gt;Consider these optimizations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CDN caching: Cache media segments close to viewers to reduce origin requests.&lt;/li&gt;
&lt;li&gt;Redis caching: Store frequently requested content metadata and category listings.&lt;/li&gt;
&lt;li&gt;Database indexing: Index content IDs, subscription records, and user identifiers used in common queries.&lt;/li&gt;
&lt;li&gt;Asynchronous processing: Move transcoding, notifications, and analytics processing into background queues.&lt;/li&gt;
&lt;li&gt;Horizontal scaling: Run stateless Node.js services in Docker containers with automated scaling.&lt;/li&gt;
&lt;li&gt;Playback telemetry: Record startup time, rebuffering ratio, bitrate changes, and playback failures.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A CDN-first approach is generally preferable to streaming video through application APIs because it separates media bandwidth consumption from transactional backend workloads.&lt;/p&gt;

&lt;p&gt;However, aggressive caching can introduce stale subscription or content information. Keep authorization decisions separate from long-lived media caching policies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application: Applying OTT Engineering Principles at Oodles
&lt;/h2&gt;

&lt;p&gt;At Oodles, OTT engineering involves considering the complete streaming lifecycle rather than focusing exclusively on the frontend player.&lt;/p&gt;

&lt;p&gt;A typical implementation scenario involves a multi-device streaming platform supporting content uploads, subscription-based access, adaptive playback, and centralized monitoring.&lt;/p&gt;

&lt;p&gt;The proposed technical approach includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js services for authentication, subscriptions, and playback authorization.&lt;/li&gt;
&lt;li&gt;AWS S3 and MediaConvert for media ingestion and transcoding.&lt;/li&gt;
&lt;li&gt;HLS packaging for adaptive video delivery.&lt;/li&gt;
&lt;li&gt;CloudFront for geographically distributed content delivery.&lt;/li&gt;
&lt;li&gt;Redis for frequently accessed application data.&lt;/li&gt;
&lt;li&gt;Docker-based deployment for consistent service environments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One important engineering decision is measuring playback performance separately from API performance.&lt;/p&gt;

&lt;p&gt;For example, API latency measures how quickly the backend authorizes playback, while video startup time measures how long viewers wait before the first frame appears.&lt;/p&gt;

&lt;p&gt;These metrics require separate instrumentation and optimization.&lt;/p&gt;

&lt;p&gt;Oodles shares its engineering and implementation capabilities through its &lt;a href="https://www.oodles.com/" rel="noopener noreferrer"&gt;official website&lt;/a&gt;. Project-specific performance improvements should be reported using verified production telemetry rather than assumed benchmarks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Technical Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Separate media processing, application APIs, and video delivery into independent architectural layers.&lt;/li&gt;
&lt;li&gt;Use HLS or MPEG-DASH with adaptive bitrate encoding to accommodate varying network conditions.&lt;/li&gt;
&lt;li&gt;Implement subscription validation and time-limited playback authorization before delivering protected content.&lt;/li&gt;
&lt;li&gt;Use Redis, CDN caching, asynchronous queues, and horizontal scaling to manage increasing workloads.&lt;/li&gt;
&lt;li&gt;Monitor startup time, rebuffering, bitrate, and playback failures as independent quality indicators.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Have Questions About OTT Architecture?
&lt;/h2&gt;

&lt;p&gt;Building a streaming platform involves architectural decisions around video processing, CDN selection, playback security, backend scalability, and multi-device compatibility.&lt;/p&gt;

&lt;p&gt;If you're evaluating an OTT platform or planning a new streaming product, discuss your technical requirements with the &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;OTT app development team&lt;/a&gt;. You can also share your architecture questions and implementation challenges in the comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What technologies are used for OTT app development?
&lt;/h3&gt;

&lt;p&gt;OTT app development commonly uses React Native, Swift, Kotlin, Node.js, Python, AWS, S3, CloudFront, Redis, and video protocols such as HLS and MPEG-DASH. The final stack depends on supported devices, streaming requirements, security policies, and expected concurrent viewers.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How does an OTT application deliver videos without buffering?
&lt;/h3&gt;

&lt;p&gt;An OTT application uses adaptive bitrate streaming, CDN distribution, optimized video segments, and playback buffering strategies. The player adjusts video quality according to available bandwidth, reducing interruptions when network conditions fluctuate.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Why is a CDN important for OTT platforms?
&lt;/h3&gt;

&lt;p&gt;A CDN distributes media content across geographically distributed edge locations. Viewers retrieve video segments from nearby delivery nodes instead of repeatedly requesting content from a centralized origin server, reducing origin traffic and network distance.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How can developers secure premium OTT content?
&lt;/h3&gt;

&lt;p&gt;Developers can combine authenticated APIs, subscription entitlement checks, signed CDN URLs or cookies, HTTPS, and Digital Rights Management (DRM). DRM solutions such as Widevine, FairPlay, and PlayReady provide additional protection for supported devices and content licensing requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Should an OTT platform use microservices or a monolithic architecture?
&lt;/h3&gt;

&lt;p&gt;A modular monolith can be suitable for an early-stage OTT platform because it reduces operational complexity. Microservices become useful when independent scaling, deployment ownership, and distinct workload requirements justify the additional infrastructure and monitoring overhead.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Build Production-Ready Agentic AI Systems with Agentic AI Development Services</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Fri, 30 Oct 2026 07:19:41 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-production-ready-agentic-ai-systems-with-agentic-ai-development-services-2hmj</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-production-ready-agentic-ai-systems-with-agentic-ai-development-services-2hmj</guid>
      <description>&lt;p&gt;An AI agent that generates a correct database query can still cause a production incident if it executes that query without validating permissions, checking the affected records, or handling transaction failures. These problems become harder to diagnose when multiple agents exchange intermediate results and invoke external services.&lt;/p&gt;

&lt;p&gt;Agentic AI Development Services address this engineering challenge by combining language models with controlled tool execution, state management, validation, and observability.&lt;/p&gt;

&lt;p&gt;For backend engineers, the key question is not how to make an agent autonomous. It is how to define the boundaries within which autonomy remains useful and predictable.&lt;/p&gt;

&lt;p&gt;This article explains how to build a multi-agent workflow using Python, FastAPI, and Docker, with a focus on task routing, execution controls, and failure recovery. Explore &lt;a href="https://www.oodles.com/agentic-ai?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_43" rel="noopener noreferrer"&gt;Oodles' agentic AI development services&lt;/a&gt; for additional architectural context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;A production agent system typically contains a coordinator, specialized agents, external tools, and a shared state store. The coordinator interprets requests, assigns tasks, and determines whether the workflow can finish.&lt;/p&gt;

&lt;p&gt;Consider an internal operations assistant that receives a request to investigate delayed orders. It must retrieve order records, inspect shipping events, identify exceptions, and prepare a report.&lt;/p&gt;

&lt;p&gt;A suitable architecture separates these responsibilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API layer: FastAPI authenticates requests and validates input.&lt;/li&gt;
&lt;li&gt;Orchestration layer: A coordinator manages execution state and routes tasks.&lt;/li&gt;
&lt;li&gt;Agent layer: Specialized agents analyze orders and shipping events.&lt;/li&gt;
&lt;li&gt;Tool layer: Permission-controlled functions access databases and internal APIs.&lt;/li&gt;
&lt;li&gt;Persistence layer: PostgreSQL or Redis stores workflow state, depending on durability requirements.&lt;/li&gt;
&lt;li&gt;Observability layer: Structured logs and traces record model calls, tool executions, and failures.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Docker provides consistent runtime environments, while AWS services can support deployment, secrets management, monitoring, and workload scaling.&lt;/p&gt;

&lt;p&gt;A useful benchmark for evaluating agentic systems is SWE-bench Verified. Its dataset contains 500 human-validated software engineering tasks, demonstrating how agent performance can be evaluated against concrete outcomes rather than subjective impressions. It is a task-resolution benchmark, not a direct measure of production latency or reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building a Controlled Workflow with Agentic AI Development Services
&lt;/h2&gt;

&lt;p&gt;The most maintainable design starts with explicit workflow boundaries. Introduce autonomous decisions only where the next action genuinely depends on information discovered during execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Agent Responsibilities and Permissions
&lt;/h3&gt;

&lt;p&gt;Each agent should have a narrow responsibility and a documented interface.&lt;/p&gt;

&lt;p&gt;For example, an order-analysis agent retrieves relevant records, while a shipping-analysis agent examines carrier events. Neither agent should receive unrestricted database access.&lt;/p&gt;

&lt;p&gt;Define each tool with explicit input schemas, authorization checks, timeouts, and output validation.&lt;/p&gt;

&lt;p&gt;For operations that modify business data, separate preparation from execution. An agent may propose an order cancellation, but a deterministic policy layer should verify permissions and business rules before the operation proceeds.&lt;/p&gt;

&lt;p&gt;This separation makes failures easier to investigate because the system can distinguish model reasoning errors from application-level validation errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Implement a Bounded Execution Loop
&lt;/h3&gt;

&lt;p&gt;A coordinator needs a maximum step count, explicit completion conditions, and structured results. The following Python example illustrates the control layer independently of any particular LLM provider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;

&lt;span class="n"&gt;MAX_STEPS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_workflow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Why: keep execution state explicit and inspectable.
&lt;/span&gt;    &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;task&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]}&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MAX_STEPS&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# Why: the planner must return a validated action.
&lt;/span&gt;        &lt;span class="n"&gt;action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;plan_next_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;finish&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;completed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;tool_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# Why: reject unknown tools before execution.
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;tool_name&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unsupported tool: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Why: enforce application permissions inside tool wrappers.
&lt;/span&gt;        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;action&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

        &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;step&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tool_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;result&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="c1"&gt;# Why: prevent unbounded loops and uncontrolled model costs.
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;limit_reached&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;results&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;plan_next_action()&lt;/code&gt; represents a planner that must validate its structured output. The supplied tool functions must enforce their own authorization, input validation, and timeout policies.&lt;/p&gt;

&lt;p&gt;This is a control-loop example rather than a complete runnable application. A production implementation also needs exception handling, cancellation, durable checkpoints, and redaction of sensitive data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Choose Between Sequential and Multi-Agent Execution
&lt;/h3&gt;

&lt;p&gt;Sequential workflows are appropriate when tasks have dependencies. For example, shipping analysis should not begin until the order lookup returns the relevant order identifiers.&lt;/p&gt;

&lt;p&gt;Independent tasks can run concurrently, but parallel execution introduces additional failure modes. One agent may time out while another succeeds, or two agents may attempt conflicting updates.&lt;/p&gt;

&lt;p&gt;Use asynchronous execution where it provides a clear benefit, and apply concurrency limits, idempotency keys, and explicit retry policies.&lt;/p&gt;

&lt;p&gt;For longer workflows, persist checkpoints so workers can resume after interruptions. Use a queue when tasks must survive API disconnections or run outside the request-response lifecycle.&lt;/p&gt;

&lt;p&gt;Frameworks such as LangGraph can help manage stateful graphs, conditional routing, and human approval checkpoints. A custom coordinator may be sufficient for a small workflow, but becomes harder to maintain as branching, persistence, and recovery requirements grow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;At Oodles, an agentic AI workflow for internal operations can be structured around a supervisor that delegates work to specialized agents and coordinates their results.&lt;/p&gt;

&lt;p&gt;Consider an order-investigation workflow as an implementation example. A retrieval agent gathers order data, an analysis agent identifies shipping exceptions, and a reporting agent prepares a summary. The coordinator tracks task status and routes failed operations for retry or human review.&lt;/p&gt;

&lt;p&gt;Python handles orchestration and business logic, while internal APIs expose narrowly scoped capabilities. Docker packages the application for deployment in controlled environments.&lt;/p&gt;

&lt;p&gt;The measurable acceptance criteria should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Task completion rate: Percentage of test scenarios completed correctly.&lt;/li&gt;
&lt;li&gt;Tool-call success rate: Percentage of authorized tool calls completed successfully.&lt;/li&gt;
&lt;li&gt;Recovery rate: Percentage of injected transient failures recovered without restarting the entire workflow.&lt;/li&gt;
&lt;li&gt;Latency: Median and 95th-percentile completion time.&lt;/li&gt;
&lt;li&gt;Cost per task: Total model and infrastructure cost for a completed workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For write operations, another useful metric is the percentage of unauthorized actions blocked by policy checks. The target should be 100% in the defined authorization test suite.&lt;/p&gt;

&lt;p&gt;These are proposed evaluation criteria, not reported Oodles production results. Establish a baseline and measure the implemented workflow before claiming performance improvements.&lt;/p&gt;

&lt;p&gt;For related engineering and implementation work, visit &lt;a href="https://www.oodles.com/" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Give every agent a defined responsibility, toolset, and permission boundary.&lt;/li&gt;
&lt;li&gt;Enforce execution limits, timeouts, and validated action schemas.&lt;/li&gt;
&lt;li&gt;Use sequential execution for dependent tasks and concurrency for independent tasks.&lt;/li&gt;
&lt;li&gt;Persist checkpoints and use idempotency controls for reliable recovery.&lt;/li&gt;
&lt;li&gt;Evaluate completed tasks, latency, cost, and policy violations against a reproducible test suite.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Have a Question About Your Agent Architecture?
&lt;/h2&gt;

&lt;p&gt;Are you building a multi-agent workflow, integrating AI with internal APIs, or deploying agents in a restricted environment? Share your architecture challenges and implementation questions in the comments.&lt;/p&gt;

&lt;p&gt;For a technical discussion about &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;Agentic AI Development Services&lt;/a&gt;, contact the Oodles team to discuss your requirements, deployment constraints, and evaluation strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Agentic AI Development Services?
&lt;/h3&gt;

&lt;p&gt;Agentic AI Development Services involve designing and implementing AI systems that can plan tasks, select tools, process results, and coordinate actions. Typical engineering components include orchestration, state persistence, API integrations, authorization, evaluation, and human approval for sensitive operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How is an AI agent different from a traditional chatbot?
&lt;/h3&gt;

&lt;p&gt;A traditional chatbot primarily generates conversational responses. An AI agent can also invoke tools, retrieve external information, maintain task state, and perform actions through application interfaces. Production agents require permission checks and execution controls to prevent unintended operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Should I use LangGraph or build a custom agent framework?
&lt;/h3&gt;

&lt;p&gt;LangGraph is useful for workflows that need state management, conditional transitions, checkpointing, or human approval. A custom implementation may suit a small, fixed workflow. Choose based on recovery requirements, observability, testing complexity, and the engineering effort required to maintain the system.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How do you secure multi-agent AI systems?
&lt;/h3&gt;

&lt;p&gt;Secure multi-agent systems through least-privilege tool access, server-side authorization, schema validation, secrets management, and network restrictions. Treat model outputs and retrieved documents as untrusted inputs. Require explicit approval for sensitive actions and log execution events without exposing confidential data.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How can businesses measure the success of Agentic AI Development Services?
&lt;/h3&gt;

&lt;p&gt;Measure task completion accuracy, tool-call reliability, p95 latency, cost per completed task, and recovery from simulated failures. Compare results against a baseline using representative test cases. Include security tests that verify agents cannot bypass permissions or execute unauthorized operations.&lt;/p&gt;

</description>
      <category>agentskills</category>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Inventory Management Services: Building Concurrency-Safe Stock APIs with Node.js and PostgreSQL</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Thu, 29 Oct 2026 12:44:26 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/inventory-management-services-building-concurrency-safe-stock-apis-with-nodejs-and-postgresql-3lkn</link>
      <guid>https://dev.to/naresh_chandralohani/inventory-management-services-building-concurrency-safe-stock-apis-with-nodejs-and-postgresql-3lkn</guid>
      <description>&lt;p&gt;A checkout API can confirm two orders for the same product even when the warehouse has only one unit left. This happens when concurrent requests read the same stock value before either request updates it. The result is overselling, incorrect availability, and reconciliation work for warehouse teams.&lt;/p&gt;

&lt;p&gt;Inventory Management Services need to solve this problem at the data layer, not just through frontend validation. A reliable implementation must coordinate stock reservations, order processing, warehouse movements, and retries across distributed systems.&lt;/p&gt;

&lt;p&gt;This guide explains how to build a stock reservation API using Node.js, PostgreSQL, and transactional database operations. It focuses on preventing race conditions while keeping the design practical for ecommerce platforms, distribution businesses, and multi-warehouse applications. For broader implementation requirements, explore &lt;a href="https://www.oodles.com/inventory-warehouse-management-?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_42" rel="noopener noreferrer"&gt;inventory and warehouse management services&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;An inventory service maintains the quantity of each SKU at a specific warehouse and determines how much stock can be promised to customers.&lt;/p&gt;

&lt;p&gt;Consider a system with the following components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API layer: Node.js with Express receives reservation requests.&lt;/li&gt;
&lt;li&gt;Inventory database: PostgreSQL stores stock balances and reservation records.&lt;/li&gt;
&lt;li&gt;Order service: Creates orders and coordinates payment workflows.&lt;/li&gt;
&lt;li&gt;Event processing: A message broker distributes committed inventory changes to downstream services.&lt;/li&gt;
&lt;li&gt;Monitoring: Metrics track failed reservations, database contention, and stock discrepancies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a basic implementation, Node.js, Express, PostgreSQL, and the &lt;code&gt;pg&lt;/code&gt; database driver are sufficient.&lt;/p&gt;

&lt;p&gt;Inventory accuracy is a business metric worth monitoring alongside API latency. APQC reports a median inventory accuracy of 95.0% across 8,660 companies in its Open Standards Benchmarking data. This figure provides operational context, although it does not measure API correctness or prove that a particular architecture will achieve the same result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing Inventory Management Services for Concurrent Requests
&lt;/h2&gt;

&lt;p&gt;The central design principle is to make stock reservation an atomic operation. Checking availability and decrementing stock must not become independent operations that competing requests can interleave.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define the Inventory Data Model
&lt;/h3&gt;

&lt;p&gt;Separate physical stock, reserved stock, and available stock conceptually.&lt;/p&gt;

&lt;p&gt;A simple inventory table can store the first two quantities:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;inventory&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;sku&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;warehouse_id&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;on_hand&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;on_hand&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;reserved&lt;/span&gt; &lt;span class="nb"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reserved&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;reserved&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;on_hand&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;warehouse_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Available stock is calculated as &lt;code&gt;on_hand - reserved&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The composite primary key prevents duplicate balance records for the same SKU and warehouse. The constraints also protect against negative quantities and reservations exceeding physical stock.&lt;/p&gt;

&lt;p&gt;For production systems, maintain a separate reservation table with unique reservation identifiers, expiration timestamps, and lifecycle states. This supports auditing and controlled reservation expiry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Reserve Stock Within a Database Transaction
&lt;/h3&gt;

&lt;p&gt;The API should reserve inventory only when sufficient unreserved stock remains.&lt;/p&gt;

&lt;p&gt;Install the required packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;express pg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following example assumes a configured PostgreSQL connection pool named &lt;code&gt;pool&lt;/code&gt;. It uses a transaction and row-level locking to prevent concurrent requests from reserving the same available units.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;reserveStock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;warehouseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Why: reject invalid quantities before opening a transaction.&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isInteger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Quantity must be a positive integer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;BEGIN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Why: serialize competing reservations for this inventory row.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`SELECT on_hand, reserved
       FROM inventory
       WHERE sku = $1 AND warehouse_id = $2
       FOR UPDATE`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;warehouseId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rowCount&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Inventory record not found&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;on_hand&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reserved&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="c1"&gt;// Why: reject reservations that exceed currently available stock.&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;on_hand&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;reserved&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Insufficient inventory&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`UPDATE inventory
       SET reserved = reserved + $1
       WHERE sku = $2 AND warehouse_id = $3`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;warehouseId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Why: expose the reservation only after the transaction commits.&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;COMMIT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;sku&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;warehouseId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;reserved&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ROLLBACK&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PostgreSQL documents that &lt;code&gt;SELECT ... FOR UPDATE&lt;/code&gt; prevents competing transactions from modifying or locking the selected rows until the current transaction ends. This makes it useful for coordinating concurrent stock reservations.&lt;/p&gt;

&lt;p&gt;The example illustrates the core transaction. A production API should also use typed errors, safe rollback handling, request validation, and a defined policy for retryable database failures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Add Idempotency and Reservation Expiry
&lt;/h3&gt;

&lt;p&gt;Database locking prevents competing transactions from claiming the same available units, but it does not prevent duplicate reservations when a client retries a request after a network timeout.&lt;/p&gt;

&lt;p&gt;Use an idempotency key for every reservation request.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Require a unique request identifier from the client.&lt;/li&gt;
&lt;li&gt;Store the identifier with the reservation record and enforce uniqueness in PostgreSQL.&lt;/li&gt;
&lt;li&gt;Return the existing reservation result when the same request is submitted again.&lt;/li&gt;
&lt;li&gt;Reject reuse of the same key with a different SKU or quantity.&lt;/li&gt;
&lt;li&gt;Expire abandoned reservations through a scheduled worker that releases stock transactionally.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An alternative is an atomic conditional update, such as &lt;code&gt;UPDATE ... WHERE on_hand - reserved &amp;gt;= quantity&lt;/code&gt;. This can be efficient for simple stock decrements, but reservation records and idempotency still need separate handling.&lt;/p&gt;

&lt;p&gt;Keep transactions short. Do not call payment gateways or external APIs while holding database locks. Commit the reservation first, then coordinate payment and order-state changes through an explicit workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;Inventory implementations become more difficult when multiple warehouses, order channels, and enterprise systems share stock data.&lt;/p&gt;

&lt;p&gt;At Oodles, inventory-related implementation work should be evaluated against concrete operational requirements, including stock synchronization, warehouse-level availability, ERP integration, and order-processing rules. The architecture above provides a practical baseline for addressing those requirements.&lt;/p&gt;

&lt;p&gt;For a client-facing case study, the implementation should document the actual system, the concurrency or synchronization problem, the technologies deployed, and measured outcomes. Useful metrics include reservation failure rates, p95 API latency, duplicate-order incidents, and inventory reconciliation discrepancies.&lt;/p&gt;

&lt;p&gt;No verified Oodles project measurements were provided for this article, so assigning a numerical improvement to a specific Oodles engagement would be misleading. Establish a baseline, run a representative load test, and report measured before-and-after results before publishing a performance claim. Learn more about &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Protect inventory at the database layer: Frontend checks cannot prevent concurrent reservation conflicts.&lt;/li&gt;
&lt;li&gt;Use transactions and appropriate locks: Make stock validation and reservation updates one atomic operation.&lt;/li&gt;
&lt;li&gt;Design for retries: Idempotency keys prevent duplicate reservations caused by network failures.&lt;/li&gt;
&lt;li&gt;Separate reservation from fulfillment: Model reservation expiry, payment failure, shipment, and cancellation as explicit state transitions.&lt;/li&gt;
&lt;li&gt;Measure real workloads: Track p95 latency, lock waits, reservation failures, and inventory accuracy before tuning the architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For implementation discussions, integration planning, or custom Inventory Management Services, &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;contact our team&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Inventory Management Services in software development?
&lt;/h3&gt;

&lt;p&gt;Inventory Management Services are software components that track stock quantities, warehouse locations, reservations, receipts, and stock movements. They expose inventory data to systems such as ecommerce platforms, ERP applications, order management tools, and warehouse operations software.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How do you prevent overselling in a Node.js application?
&lt;/h3&gt;

&lt;p&gt;Use database transactions and atomic stock updates. In PostgreSQL, &lt;code&gt;SELECT ... FOR UPDATE&lt;/code&gt; can serialize competing modifications to the same inventory row. Validate available stock inside the transaction, commit the reservation, and use idempotency keys to handle repeated requests safely.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Should inventory availability be stored in Redis or PostgreSQL?
&lt;/h3&gt;

&lt;p&gt;PostgreSQL is a strong choice for authoritative inventory balances because it supports transactions, constraints, and row-level locking. Redis can accelerate availability reads or coordinate supporting workflows, but a cache should not independently authorize reservations without a consistency strategy.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How should inventory be synchronized across multiple warehouses?
&lt;/h3&gt;

&lt;p&gt;Maintain stock balances by SKU and warehouse, and record transfers as explicit inventory movements. Use transactional updates for local changes and reliable event delivery for downstream synchronization. Define ownership, event ordering, retry handling, and reconciliation rules to detect discrepancies.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How do you measure inventory API performance?
&lt;/h3&gt;

&lt;p&gt;Track request throughput, p50 and p95 latency, database lock waits, transaction failures, reservation conflicts, and timeout rates. Pair these technical metrics with stockout incidents and physical-to-system inventory variance. Load tests should reproduce realistic SKU contention and concurrent order traffic.&lt;/p&gt;

</description>
      <category>inventory</category>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Build Video Streaming Development Services with Node.js and AWS</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Wed, 28 Oct 2026 05:48:20 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-video-streaming-development-services-with-nodejs-and-aws-2fc2</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-video-streaming-development-services-with-nodejs-and-aws-2fc2</guid>
      <description>&lt;p&gt;A video player can report successful HTTP responses while viewers experience frozen frames, delayed playback, or repeated buffering. These failures often originate outside the player, including inefficient transcoding, incorrect segment delivery, overloaded application servers, or poorly configured content delivery networks (CDNs).&lt;/p&gt;

&lt;p&gt;Video Streaming Development Services address these problems by designing the complete media delivery pipeline, from video ingestion to playback analytics. For backend engineers, the challenge is separating control-plane operations, such as authentication and playback authorization, from data-plane operations that deliver video segments.&lt;/p&gt;

&lt;p&gt;This guide explains how to build a production-oriented streaming architecture using Node.js, AWS, and Docker. It covers asynchronous transcoding, adaptive bitrate delivery, secure playback, and performance validation. Teams evaluating &lt;a href="https://www.oodles.com/video-streamingURL?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_01" rel="noopener noreferrer"&gt;video streaming development solutions&lt;/a&gt; can apply these principles to video-on-demand platforms, educational portals, and subscription-based streaming products.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;A scalable streaming platform separates application logic from media processing and delivery.&lt;/p&gt;

&lt;p&gt;Consider a video-on-demand application where users upload recordings that must become playable across mobile devices, browsers, and smart TVs. Processing every upload inside a synchronous API request creates unnecessary latency and ties application availability to encoding workloads.&lt;/p&gt;

&lt;p&gt;A practical architecture uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js: Handles authentication, upload authorization, job creation, and playback access.&lt;/li&gt;
&lt;li&gt;Amazon S3: Stores original uploads and transcoded media.&lt;/li&gt;
&lt;li&gt;AWS Elemental MediaConvert: Generates compatible video renditions and streaming packages.&lt;/li&gt;
&lt;li&gt;Amazon CloudFront: Distributes playlists and video segments through edge locations.&lt;/li&gt;
&lt;li&gt;Amazon SQS: Buffers transcoding jobs and decouples ingestion from processing.&lt;/li&gt;
&lt;li&gt;Docker: Packages application services consistently across development and deployment environments.&lt;/li&gt;
&lt;li&gt;CloudWatch: Collects logs, metrics, and operational alerts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apple's HTTP Live Streaming (HLS) authoring specification recommends target media segment durations of approximately six seconds for conventional HLS streams. This provides a useful starting point for packaging, although actual startup delay also depends on playlist loading, buffering policy, network conditions, and player behavior.&lt;/p&gt;

&lt;p&gt;Before implementation, configure an AWS account, an S3 bucket, a Node.js runtime, an SQS queue, and an appropriate MediaConvert service role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implement Video Streaming Development Services with an Asynchronous Pipeline
&lt;/h2&gt;

&lt;p&gt;The main design principle is to acknowledge uploads quickly and process media independently. This prevents expensive encoding operations from blocking API requests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Separate Uploads from Transcoding
&lt;/h3&gt;

&lt;p&gt;Create a workflow in which the backend authorizes an upload, the client sends the video directly to S3, and an event or queued job triggers processing.&lt;/p&gt;

&lt;p&gt;Use the following sequence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Authenticate the user and verify upload permissions.&lt;/li&gt;
&lt;li&gt;Generate a short-lived presigned S3 upload URL.&lt;/li&gt;
&lt;li&gt;Upload the source file directly to the designated bucket.&lt;/li&gt;
&lt;li&gt;Validate the uploaded object's metadata and expected file type.&lt;/li&gt;
&lt;li&gt;Submit a transcoding job to SQS or initiate processing through an S3 event.&lt;/li&gt;
&lt;li&gt;Update the asset's status when the processing workflow completes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Direct-to-S3 uploads avoid routing large media payloads through Node.js application servers. However, file-size limits, checksums, upload expiration, and tenant-specific object permissions still require enforcement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Create an Idempotent Job Submission Endpoint
&lt;/h3&gt;

&lt;p&gt;The API should create processing jobs without waiting for transcoding to finish. The following example uses Express and the AWS SDK to submit an SQS message.&lt;/p&gt;

&lt;p&gt;Install the dependencies with &lt;code&gt;npm install express @aws-sdk/client-sqs&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SQSClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;SendMessageCommand&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@aws-sdk/client-sqs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;randomUUID&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sqs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SQSClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AWS_REGION&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/videos/:id/process&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Require authentication and ownership checks in production.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;videoId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Use a stable asset ID to deduplicate processing requests.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;jobId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;videoId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:transcode:v1`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;sqs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SendMessageCommand&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;QueueUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;TRANSCODE_QUEUE_URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;MessageBody&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="nx"&gt;jobId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;videoId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;requestId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;}));&lt;/span&gt;

    &lt;span class="c1"&gt;// Return immediately instead of waiting for encoding.&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;jobId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;queued&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Log structured error details without exposing internals.&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Transcoding submission failed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;videoId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;503&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Processing unavailable&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This endpoint demonstrates queue submission, not a complete idempotency implementation. In production, enforce uniqueness through a database constraint or conditional write, and handle duplicate SQS deliveries safely. A database-backed job record also allows clients to query processing status.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Generate Adaptive Bitrate Renditions
&lt;/h3&gt;

&lt;p&gt;Adaptive bitrate streaming provides multiple versions of the same content so compatible players can select a rendition according to available bandwidth and device capability.&lt;/p&gt;

&lt;p&gt;Configure MediaConvert to produce an HLS master playlist and multiple video renditions. For example, a profile might include 360p, 720p, and 1080p outputs, with bitrates tuned to the source material and target devices.&lt;/p&gt;

&lt;p&gt;Three considerations influence the implementation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Segment alignment: Ensure renditions have compatible segment boundaries to support reliable switching.&lt;/li&gt;
&lt;li&gt;Delivery caching: Serve playlists and immutable media segments through CloudFront, using cache policies appropriate to live or on-demand content.&lt;/li&gt;
&lt;li&gt;Playback authorization: Restrict access through signed CloudFront URLs or cookies, with short-lived credentials and suitable origin protections.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;HLS is a practical choice for broad device support. WebRTC may suit interactive communication requiring very low latency, while specialized live workflows may require low-latency HLS or another streaming protocol. Select the protocol according to latency requirements rather than assuming one solution fits every workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;A useful Oodles implementation scenario is a training-video platform where large uploads compete with playback traffic for application resources.&lt;/p&gt;

&lt;p&gt;The architecture separates uploads, processing jobs, transcoded assets, and CDN delivery. Node.js manages application requests, SQS coordinates asynchronous work, MediaConvert generates renditions, and CloudFront serves the resulting media.&lt;/p&gt;

&lt;p&gt;For this scenario, validate three measurable outcomes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API responsiveness: Record p95 and p99 latency for upload authorization and job submission.&lt;/li&gt;
&lt;li&gt;Processing throughput: Measure completed transcodes per minute and queue waiting time.&lt;/li&gt;
&lt;li&gt;Playback quality: Track startup time, rebuffering ratio, playback failures, and rendition switches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At&lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt; can use this architecture as a starting point for evaluating streaming requirements and implementation trade-offs.&lt;/p&gt;

&lt;p&gt;Measurement note: No verified Oodles project metrics were provided for this article. Therefore, it would be misleading to claim a specific production improvement. Establish a baseline and report actual load-test or production measurements before publishing numerical results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Keep video uploads and transcoding outside synchronous application requests.&lt;/li&gt;
&lt;li&gt;Use queues and persistent job records to manage retries and duplicate processing safely.&lt;/li&gt;
&lt;li&gt;Generate adaptive bitrate renditions to accommodate different network conditions and devices.&lt;/li&gt;
&lt;li&gt;Use CDN caching, controlled playback authorization, and protected origins to improve delivery efficiency and access control.&lt;/li&gt;
&lt;li&gt;Evaluate performance using p95 API latency, processing throughput, startup time, and rebuffering ratio.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's Discuss Your Streaming Architecture
&lt;/h2&gt;

&lt;p&gt;Are you building a video-on-demand platform, a live-streaming application, or a media delivery pipeline? Share your architecture questions, scaling challenges, or implementation experience in the comments.&lt;/p&gt;

&lt;p&gt;For a technical discussion about Video Streaming Development Services, &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;contact Oodles&lt;/a&gt; to discuss your requirements, infrastructure choices, and performance objectives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are Video Streaming Development Services?
&lt;/h3&gt;

&lt;p&gt;Video Streaming Development Services cover the design and implementation of video ingestion, transcoding, media packaging, content delivery, playback, access control, and monitoring. They help organizations build video-on-demand, live-streaming, and subscription platforms around specific performance and business requirements.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Which AWS services are suitable for a video streaming platform?
&lt;/h3&gt;

&lt;p&gt;Amazon S3 stores source files and processed media, MediaConvert generates streaming renditions, CloudFront distributes content, and SQS coordinates asynchronous processing. Node.js can manage application APIs, while CloudWatch supports operational monitoring and alerting.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How does adaptive bitrate streaming reduce buffering?
&lt;/h3&gt;

&lt;p&gt;Adaptive bitrate streaming offers multiple renditions at different resolutions and bitrates. The player can switch to a suitable rendition as network throughput changes, reducing the likelihood that video delivery will consistently exceed available bandwidth.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How can developers secure video streaming APIs?
&lt;/h3&gt;

&lt;p&gt;Developers should authenticate users, authorize asset access, issue short-lived upload URLs, protect media origins, and use signed CDN URLs or cookies where appropriate. Rate limits, input validation, tenant isolation, and audit logs further reduce unauthorized access and abuse.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How should developers measure streaming performance?
&lt;/h3&gt;

&lt;p&gt;Measure startup time, rebuffering ratio, playback failure rate, video quality, and rendition-switch frequency. Also monitor API p95 latency, transcoding duration, queue age, CDN cache-hit ratio, and delivery errors. Segment these metrics by device, geography, and network type to identify recurring problems.&lt;/p&gt;

</description>
      <category>kafka</category>
      <category>ott</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Build ERP Development Services Around Reliable Node.js Integrations</title>
      <dc:creator>Naresh Chandra Lohani</dc:creator>
      <pubDate>Tue, 27 Oct 2026 05:16:28 +0000</pubDate>
      <link>https://dev.to/naresh_chandralohani/how-to-build-erp-development-services-around-reliable-nodejs-integrations-4739</link>
      <guid>https://dev.to/naresh_chandralohani/how-to-build-erp-development-services-around-reliable-nodejs-integrations-4739</guid>
      <description>&lt;p&gt;An ERP integration can report a successful API response while leaving inventory, invoices, or customer records inconsistent across systems. This happens when services process duplicate events, retry failed requests without idempotency checks, or update multiple business entities without a defined transaction strategy. These problems become harder to diagnose when an ERP connects with e-commerce platforms, accounting software, warehouse systems, and external APIs.&lt;/p&gt;

&lt;p&gt;Well-designed ERP Development Services address these risks at the architecture level, not just through custom screens and endpoints. This guide explains how backend engineers can build an integration layer using Node.js, PostgreSQL, queues, and AWS infrastructure. The focus is practical: establish data ownership, make operations retry-safe, and monitor failures before they affect business transactions. For teams evaluating custom ERP architecture, &lt;a href="https://www.oodles.com/custom-erp?utm_source=devto&amp;amp;utm_medium=referral&amp;amp;utm_campaign=backlink&amp;amp;utm_content=devto_article_40" rel="noopener noreferrer"&gt;custom ERP development&lt;/a&gt; provides additional context on implementation options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context and Setup
&lt;/h2&gt;

&lt;p&gt;An ERP integration layer connects business applications while preserving the integrity of shared operational data. Instead of allowing every external application to modify the ERP database directly, route changes through controlled APIs and asynchronous workers.&lt;/p&gt;

&lt;p&gt;Consider an order-processing workflow involving an online storefront, an ERP, a payment provider, and a warehouse management system.&lt;/p&gt;

&lt;p&gt;A practical architecture includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js API: Validates incoming requests and creates business operations.&lt;/li&gt;
&lt;li&gt;PostgreSQL: Stores transactional records, idempotency keys, and integration events.&lt;/li&gt;
&lt;li&gt;Message queue: AWS SQS distributes work to independent consumers.&lt;/li&gt;
&lt;li&gt;Worker services: Process inventory reservations, invoice creation, and fulfillment updates.&lt;/li&gt;
&lt;li&gt;Observability: CloudWatch collects logs, metrics, and operational alerts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Data migration deserves equal attention. A 2024 Wipro report on ERP data migration identifies data quality gaps, inadequate migration strategy, and stakeholder misalignment among the factors that can delay implementations or cause failure. These risks make validation and reconciliation essential parts of integration design.&lt;/p&gt;

&lt;p&gt;Before implementation, define which system owns each entity, how identifiers map between applications, and which operations require immediate consistency.&lt;/p&gt;

&lt;h2&gt;
  
  
  How ERP Development Services Can Prevent Duplicate Transactions
&lt;/h2&gt;

&lt;p&gt;Reliable ERP Development Services should make transaction processing predictable, even when requests arrive repeatedly or downstream systems become temporarily unavailable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Data Ownership and Transaction Boundaries
&lt;/h3&gt;

&lt;p&gt;Start by assigning a system of record to every critical entity. For example, the ERP might own inventory quantities and invoice status, while the storefront owns customer-facing cart data.&lt;/p&gt;

&lt;p&gt;Then define the consistency requirements for each workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Identify the authoritative system for each entity.&lt;/li&gt;
&lt;li&gt;Define which fields external services may update.&lt;/li&gt;
&lt;li&gt;Specify the transaction boundary for each business operation.&lt;/li&gt;
&lt;li&gt;Document retry rules and compensation actions.&lt;/li&gt;
&lt;li&gt;Establish reconciliation checks for records exchanged between systems.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For an order workflow, creating an order and recording its initial integration event should happen in one database transaction. Sending a message to another service should occur after that transaction commits.&lt;/p&gt;

&lt;p&gt;This separation prevents a common failure: the database commits successfully, but the application crashes before publishing the event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Implement Idempotent Operations
&lt;/h3&gt;

&lt;p&gt;Idempotency ensures that processing the same logical request multiple times does not create duplicate business effects. It is particularly important when clients retry requests after network timeouts.&lt;/p&gt;

&lt;p&gt;The following Node.js example uses Express and PostgreSQL to create an order with a unique idempotency key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;pg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Pool&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;connectionString&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DATABASE_URL&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/orders&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Idempotency-Key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;customerId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Reject requests without a stable retry identifier.&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Idempotency-Key is required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;BEGIN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// The unique key prevents duplicate logical orders.&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`INSERT INTO orders
         (idempotency_key, customer_id, amount)
       VALUES ($1, $2, $3)
       ON CONFLICT (idempotency_key) DO NOTHING
       RETURNING id`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;customerId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;orderId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Return the existing order after a retry.&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;existing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;`SELECT id FROM orders
         WHERE idempotency_key = $1`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="nx"&gt;orderId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;existing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;COMMIT&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;orderId&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Roll back partial database changes on failure.&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ROLLBACK&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Order creation failed:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Unable to process order&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;finally&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Always return the database connection to the pool.&lt;/span&gt;
    &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;release&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Implementation requirements: Create a database-level unique constraint on &lt;code&gt;idempotency_key&lt;/code&gt;, validate the request payload, and store a request fingerprint so that reusing a key with different order data is rejected. Production code should also handle connection failures and return the original response consistently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Separate Transactions from Asynchronous Processing
&lt;/h3&gt;

&lt;p&gt;Use a transactional outbox when a committed database change must reliably trigger downstream processing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Insert the order and an outbox event within the same database transaction.&lt;/li&gt;
&lt;li&gt;Run a worker that publishes pending events to SQS.&lt;/li&gt;
&lt;li&gt;Let consumers process events using their own idempotency checks.&lt;/li&gt;
&lt;li&gt;Retry transient failures with exponential backoff and jitter.&lt;/li&gt;
&lt;li&gt;Send repeatedly failing messages to a dead-letter queue for investigation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The transactional outbox avoids the dual-write problem, where a database update succeeds but message publication fails.&lt;/p&gt;

&lt;p&gt;It also introduces operational overhead: outbox polling, message retention, duplicate delivery, and eventual consistency must be managed. For smaller systems, a synchronous API may be simpler when immediate confirmation is essential and the transaction involves only one service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real-World Application
&lt;/h2&gt;

&lt;p&gt;Oodles' published ERP engagements demonstrate how these principles apply to existing business platforms.&lt;/p&gt;

&lt;p&gt;In the Centric Global project, the client needed better reporting and data migration within an IFS ERP environment. Oodles worked on SQL-based reports, migration job setup, CSV imports, field mapping, data validation, and ERP optimization. The implementation focused on improving reporting accuracy and simplifying data operations. The published case study does not disclose numerical latency or throughput improvements, so those figures should not be assumed.&lt;/p&gt;

&lt;p&gt;The engineering lesson is that migration and reporting are not isolated tasks. Field mapping, query design, validation, and reconciliation must work together to maintain trustworthy business data.&lt;/p&gt;

&lt;p&gt;For teams designing new integrations, &lt;a href="https://www.oodles.com" rel="noopener noreferrer"&gt;Oodles&lt;/a&gt; provides further information about its engineering capabilities and ERP implementation work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Assign data ownership: Define authoritative systems and permitted updates before building integration endpoints.&lt;/li&gt;
&lt;li&gt;Enforce idempotency: Use database constraints to prevent duplicate business transactions.&lt;/li&gt;
&lt;li&gt;Handle asynchronous failures: Combine a transactional outbox, retry policies, and dead-letter queues when reliable event delivery is required.&lt;/li&gt;
&lt;li&gt;Measure real workloads: Track API latency, queue age, retry counts, database contention, and reconciliation failures against a defined baseline.&lt;/li&gt;
&lt;li&gt;Validate migrated data: Test field mappings, financial totals, inventory quantities, and record counts before production cutover.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Discuss Your ERP Integration Challenges
&lt;/h2&gt;

&lt;p&gt;What has caused the most difficult integration failures in your systems: duplicate events, inconsistent master data, migration errors, or slow reporting queries? Share your architecture and lessons in the comments.&lt;/p&gt;

&lt;p&gt;For a technical discussion about ERP Development Services, custom integrations, or ERP modernization, &lt;a href="https://www.oodles.com/contact-us" rel="noopener noreferrer"&gt;contact Oodles for ERP Development Services&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently Asked Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. What are ERP Development Services?
&lt;/h3&gt;

&lt;p&gt;ERP Development Services cover the design, implementation, customization, integration, and maintenance of enterprise resource planning systems. They may include inventory management, financial workflows, reporting, API development, data migration, and connections to third-party applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. How do you prevent duplicate ERP transactions?
&lt;/h3&gt;

&lt;p&gt;Prevent duplicate transactions by requiring idempotency keys, enforcing unique database constraints, and storing the outcome of each logical operation. For asynchronous workflows, consumers must also track processed event identifiers because message brokers can deliver the same message more than once.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Should ERP integrations use synchronous APIs or message queues?
&lt;/h3&gt;

&lt;p&gt;Use synchronous APIs when the caller needs an immediate result and the operation can finish within an acceptable response-time budget. Use message queues for long-running workflows, traffic spikes, and independent downstream processing. Some systems need both approaches.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How can Node.js improve ERP integration architecture?
&lt;/h3&gt;

&lt;p&gt;Node.js supports API-driven integrations and asynchronous I/O, making it useful for coordinating multiple external services. However, performance depends on database queries, connection pooling, event-loop blocking, payload size, and downstream latency. CPU-intensive work may require worker processes or separate services.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. How should teams test custom ERP integrations before deployment?
&lt;/h3&gt;

&lt;p&gt;Test field mappings, validation rules, duplicate requests, concurrent updates, timeout handling, retry behavior, and reconciliation. Run representative load tests and compare results against explicit service-level objectives. Validate financial totals and inventory balances before migrating production transactions.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
