<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gamini Sharma on Medium]]></title>
        <description><![CDATA[Stories by Gamini Sharma on Medium]]></description>
        <link>https://medium.com/@gamini782?source=rss-176183298225------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mQQOSi6fkb6lnx41s9p_9Q.jpeg</url>
            <title>Stories by Gamini Sharma on Medium</title>
            <link>https://medium.com/@gamini782?source=rss-176183298225------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:23:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gamini782/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Batch Bottlenecks to Real-Time
Streams]]></title>
            <link>https://medium.com/@gamini782/from-batch-bottlenecks-to-real-time-streams-3386f86f2e6a?source=rss-176183298225------2</link>
            <guid isPermaLink="false">https://medium.com/p/3386f86f2e6a</guid>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[batch-processing]]></category>
            <dc:creator><![CDATA[Gamini Sharma]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 13:31:21 GMT</pubDate>
            <atom:updated>2026-07-22T06:48:35.623Z</atom:updated>
            <content:encoded><![CDATA[<h3>From Batch Bottlenecks to Real-Time<br>Streams: Optimizing Databricks-to-RDS Inventory Pipeline with Apache Kafka</h3><p>In modern manufacturing systems, inventory data is more than just a database table — it drives production planning, warehouse operations, order fulfillment, procurement, and supply chain visibility. As organizations scale, keeping operational databases synchronized with analytical platforms becomes increasingly challenging.</p><p>Recently, I worked on a project where a traditional batch synchronization approach had served us well for years. However, as our inventory grew beyond 11 million records, the architecture began to show its limits.</p><p>This article walks through how we evolved from a scheduled Lambda-based batch pipeline to an event-driven architecture powered by Apache Kafka, dramatically improving scalability, latency, and operational efficiency.</p><h3>Existing Architecture</h3><p>Our source of truth was a <strong>Databricks Delta Lake</strong> containing a master inventory table. This dataset encapsulates exhaustive records of machine parts, multi-dimensional physical dimensions, localized warehouse stocking levels, and deeply nested structural specifications. We have an AWS Lambda function which is triggered in every 5 hours which pulls the entire inventory table out of Databricks having more than 11 millions of records. The extracted data is written out and processed from .avro files. The records are then parsed from Avro, transformed, and updated in the relevant records of an <strong>Amazon RDS</strong> instance powering real-time order fulfillments and supply chain tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SplL5OA144XL0g6RXGK1Q.png" /></figure><p>The solution worked well while the dataset remained relatively small. Once the inventory crossed tens of millions of records, scaling became increasingly difficult. Several bottlenecks emerged simultaneously.</p><ul><li><strong>Lambda Timeouts and OOM Risks:</strong> As the machine parts inventory grows, pulling the entire dataset causes the extraction Lambda to edge closer to its 15-minute execution timeout limit and hit memory ceilings.</li><li><strong>Downstream Database Exhaustion:</strong> Every 5 hours, the ingestion Lambda floods Amazon RDS with massive, concurrent write spikes. Connection pools fill instantly, CPU utilization hits ceilings, and operational applications querying the database face transactional timeouts.</li><li><strong>Redundant Processing &amp; Storage I/O:</strong> Running a full sync means paying to process millions of identical rows repeatedly, even if only 1% of the machine parts changed their stock levels or specifications within those 5 hours. Regenerating, writing, and parsing massive .avro files every 5 hours creates severe, unnecessary storage I/O and compute overhead.</li><li><strong>Stale Operational Data:</strong> Inventory visibility is chronically out of sync. A component checked out of a warehouse at 10:00 AM will not reflect in RDS until the next 5-hour window executes, leading to frequent material allocation conflicts.</li></ul><h3>The Kafka-Optimized Solution</h3><p>Instead of repeatedly asking: <em>“Has anything changed?”, </em>we wanted the system to answer: <em>“Here’s exactly what changed.”</em></p><p>That shift in thinking led us to an <strong>event-driven architecture</strong>. Rather than polling the entire dataset, we decided to stream only incremental changes from the source. Apache Kafka became the backbone of this new design.</p><p>We replaced the periodic Lambda pull model with a continuous, event-driven stream by introducing <strong>Apache Kafka</strong> (or AWS MSK) as an asynchronous streaming buffer. Instead of scanning the physical table blocks every 5 hours, the system transitions to a continuous push model driven by Change Data Feed(CDF). The optimized workflow functions via three distinct operational layers:</p><h4>1. Change Data Feed (CDF) at the Source</h4><p>Instead of triggering an extraction Lambda every 5 hours, we enable <strong>Delta Change Data Feed(CDF)</strong> directly on the Databricks table. A lightweight Spark Structured Streaming job runs continuously (or via cost-effective micro-batches) to monitor the Delta transaction log. It isolates row-level additions, value shifts, or spec updates instantly without scanning the whole table space:</p><pre># Streaming change capture from Databricks Delta log<br>df = (spark.readStream <br>      .format(&quot;delta&quot;) <br>      .option(&quot;readChangeFeed&quot;, &quot;true&quot;) <br>      .load(&quot;/mnt/inventory/machine_parts&quot;))</pre><h4>2. Keyed Message Distribution to Kafka</h4><p>Instead of writing static .avro files to a landing zone, the Spark streaming job serializes mutated rows directly into Avro byte arrays using a <strong>Kafka Schema Registry</strong> (such as Confluent Schema Registry or AWS Glue Schema Registry).</p><p>The stream publishes these records immediately to a dedicated Kafka topic named inventory.parts. We enforce the unique machine_part_id as the <strong>Kafka Message Key</strong>. This guarantees that all state histories and updates regarding a specific engine component are routed to the exact same Kafka partition, ensuring absolute chronological sequence preservation.</p><h4>3. Throttled Serverless Ingestion</h4><p>The downstream processing and ingestion Lambdas are no longer triggered by a cron timer. Instead, the processing Lambda is configured as an <strong>Event Source Mapping for Apache Kafka</strong>.</p><p>AWS Lambda natively handles polling the Kafka topic, batching records dynamically based on your configuration (e.g., maximum batch size or windowing), and invoking your processing function. The Lambda processes only the changed rows and applies precise UPSERT commands directly to Amazon RDS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUiUAWQeZ0NrYEHQpxBxrQ.png" /></figure><p>One of the biggest takeaways from this project was that scaling isn’t always about adding more compute — it’s often about changing the data movement pattern.</p><p>Batch processing remains an excellent choice for many workloads. However, when datasets grow into the tens or hundreds of millions of records and downstream systems require timely updates, continuously moving only the changes becomes far more efficient than repeatedly moving everything.</p><p>By combining <strong>Databricks Delta Change Data Feed</strong>, <strong>Apache Kafka</strong>, and <strong>event-driven AWS Lambda consumers</strong>, we transformed a periodic synchronization process into a resilient streaming architecture. The system now handles growth more gracefully, keeps operational data fresh, and minimizes unnecessary processing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3386f86f2e6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Producer Deep Dive]]></title>
            <link>https://medium.com/@gamini782/kafka-producer-deep-dive-b8cc6031d540?source=rss-176183298225------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8cc6031d540</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[kafka-producer]]></category>
            <dc:creator><![CDATA[Gamini Sharma]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 16:51:09 GMT</pubDate>
            <atom:updated>2026-07-08T01:45:36.949Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern applications generate millions of events every second — from payment transactions and user clicks to IoT sensor updates. Sending every event individually would overwhelm the network and significantly reduce throughput. Apache Kafka solves this challenge through an intelligent producer architecture that batches messages, compresses data, retries transient failures, and prevents duplicates, allowing applications to publish millions of messages efficiently and reliably.</p><p>To appreciate why Kafka Producers are so efficient, let’s follow the complete lifecycle of a message — from the moment your application calls send() until the broker acknowledges successful delivery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdeXBPIKVeqBTvElzzTujQ.png" /><figcaption><strong>Kafka Producer Workflow</strong></figcaption></figure><p>When an application invokes the asynchronous send()method, the Kafka Producer first creates a <strong>ProducerRecord </strong>object<strong> </strong>containing the topic, key, value, and optional headers. The producer then serializes the key and value into bytes, determines the target partition using the configured partitioner (typically based on the message key), and stores the record in the <strong>RecordAccumulator, </strong>an in-memory buffer that groups records destined for the same partition. Instead of sending each message individually, Kafka waits until enough records accumulate to form an efficient batch, dramatically reducing network requests and improving throughput. These batches can be configured to accumulate up to a fixed size (e.g., 64 KB) or wait for a bounded latency (e.g., 10 ms). This approach reduces the number of I/O operations on servers and maximizes throughput. Once a batch reaches the configured batch.size or the linger.ms timeout expires, a dedicated <strong>Sender</strong> thread compresses the batch (if compression is enabled) and asynchronously sends it to the leader broker of the target partition. The leader appends the messages to its log and replicates them to the <strong>In-Sync Replicas (ISR). </strong>After the required acknowledgements (acks=0, acks=1, or acks=all) are received, the broker returns a response containing metadata such as the topic, partition, and offset. Finally, the producer completes the associated Future or invokes the configured callback, allowing the application to confirm successful delivery or handle any errors, while retries and idempotence ensure reliable and duplicate-free message delivery even during transient failures.</p><p>ProducerRecord represents a message sent to Kafka. It contains the destination topic, optional partition, key, value, headers, and timestamp. If a valid partition number is specified that partition will be used when sending the record. If no partition is specified but a key is present a partition will be chosen using a hash of the key. If neither a key nor a partition is specified, the default partitioner typically uses sticky partitioning to maximize batching efficiency before switching to another partition. Note that partition numbers are 0-indexed. The record also has an associated timestamp. If the user did not provide a timestamp, the producer will stamp the record with its current time. The timestamp eventually used by Kafka depends on the timestamp type configured for the topic.</p><ul><li>If the topic is configured to use <a href="https://kafka.apache.org/43/javadoc/org/apache/kafka/common/record/TimestampType.html#CREATE_TIME">CreateTime</a>, the timestamp in the producer record will be used by the broker.</li><li>If the topic is configured to use <a href="https://kafka.apache.org/43/javadoc/org/apache/kafka/common/record/TimestampType.html#LOG_APPEND_TIME">LogAppendTime</a>, the timestamp in the producer record will be overwritten by the broker with the broker local time when it appends the message to its log.</li></ul><p>Below snippet shows Java implementation for Kafka producer:</p><pre>import org.apache.kafka.clients.producer.KafkaProducer;<br>import org.apache.kafka.clients.producer.ProducerRecord;<br>import org.apache.kafka.clients.producer.ProducerConfig;<br>import org.apache.kafka.common.serialization.StringSerializer;<br><br>import java.util.Properties;<br><br>public class SimpleProducer {<br>    public static void main(String[] args) {<br>        // 1. Define configuration properties<br>        Properties props = new Properties();<br>        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, &quot;localhost:9092&quot;);<br>        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());<br>        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());<br><br>        // 2. Initialize the KafkaProducer<br>        try (KafkaProducer&lt;String, String&gt; producer = new KafkaProducer&lt;&gt;(props)) {<br>            <br>            // 3. Create a record (Topic, Key, Value)<br>            ProducerRecord&lt;String, String&gt; record = new ProducerRecord&lt;&gt;(&quot;my-topic&quot;, &quot;key-1&quot;, &quot;Hello World!&quot;);<br><br>            // 4. Send the data asynchronously<br>            producer.send(record, (metadata, exception) -&gt; {<br>                if (exception == null) {<br>                    System.out.printf(&quot;Message sent successfully to partition %d with offset %d%n&quot;, <br>                            metadata.partition(), metadata.offset());<br>                } else {<br>                    exception.printStackTrace();<br>                }<br>            });<br><br>            // 5. Force flush buffered records before automatic close<br>            producer.flush();<br>        }<br>    }<br>}</pre><p>Let’s explore the Kafka Producer in depth and understand the optimizations that enable its impressive throughput.</p><p>Producer also maintains a pool of buffer space for each partition, holding records that have not yet been transmitted. The send() method when invoked, it adds the record to the buffer and immediately returns. This enables batching of individual records for efficiency. The acks configuration determines when a request is considered complete, and if a request fails, the producer can automatically retry.</p><p>The producer will attempt to batch records together into fewer requests whenever multiple records are being sent to the same partition. This helps performance on both the client and the server. This configuration controls the default batch size in bytes. No attempt will be made to batch records larger than this size. Requests sent to brokers will contain multiple batches, one for each partition with data available to be sent.</p><p>A small batch size will make batching less common and may reduce throughput (a batch size of zero will disable batching entirely). A very large batch size may use memory a bit more wastefully as we will always allocate a buffer of the specified batch size in anticipation of additional records.</p><p>By default, records are sent immediately, even if the buffer has unused space. However, the linger.ms setting allows the producer to wait for a short period before sending, increasing the chance of filling a batch. Under heavy load, batching occurs naturally regardless of this configuration. If buffer space is exhausted, additional send() calls block until space becomes available. The maximum blocking time is controlled by max.block.ms, after which a BufferExhaustedException is returned.</p><p>Kafka producers support two advanced modes:</p><ul><li><strong>Idempotent Producer </strong>: Prevents duplicate records caused by producer retries.</li><li><strong>Transactional Producer</strong>: Allows atomic writes across multiple partitions, enabling applications to maintain consistency in complex workflows.</li></ul><p><a href="https://kafka.apache.org/43/javadoc/org/apache/kafka/clients/producer/ProducerConfig.html#%3Cinit%3E(java.util.Map)"><strong>ProducerConfig</strong></a>(<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html"><strong>Map</strong></a>&lt;<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html"><strong>String</strong></a>,<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html"><strong>Object</strong></a>&gt; props) Constructs a new ProducerConfig object with the given configuration map. Below are the majorly used producer configuration:</p><ul><li><strong>Key.serializer </strong>: Serializer class for key that implements the org.apache.kafka.common.serialization.Serializer interface.</li><li><strong>Value.serializer</strong> : Serializer class for value that implements the org.apache.kafka.common.serialization.Serializer interface.</li><li><strong>Compression.type</strong> : The compression type for all data generated by the producer. The default is none (i.e. no compression). Valid values are none, gzip, snappy, lz4, or zstd.</li><li><strong>Retries</strong> : Number of times to retry a request that fails with a transient error</li><li><strong>Batch.size </strong>: This configuration controls the default batch size in bytes. No attempt will be made to batch records larger than this size.</li><li><strong>Connections.max.idle.ms </strong>: Close idle connections after the number of milliseconds specified by this config.</li><li><strong>Delivery.timeout.ms </strong>: An upper bound on the time to report success or failure after a call to send() returns.</li><li><strong>Client.id </strong>: An id string to pass to the server when making requests</li><li><strong>Max.in.flight.requests.per.connecion</strong> : Controls how many produce requests can be sent without waiting for acknowledgements</li><li><strong>Buffer.memory</strong> : Defines the total memory available for buffering unsent records.If the buffer becomes full, new send() operations may block until space is available or fail after max.block.ms.</li><li><strong>Linger.ms</strong> : Specifies how long the producer waits to accumulate additional records before sending a partially filled batch.</li></ul><h3><strong>Best Practices</strong></h3><ul><li><strong>Batch Size &amp; Linger</strong>: Tune batch.size and linger.ms together. Larger batches improve throughput but increase latency. For low-latency systems, keep linger.ms small; for throughput-heavy pipelines, allow slightly larger values.</li><li><strong>Compression</strong>: Use lz4 or zstd for high throughput with good compression ratios. gzip offers better compression but higher CPU cost.</li><li><strong>Retries &amp; Idempotence</strong>: Always enable idempotence (enable.idempotence=true) to avoid duplicates when retries occur. Configure retries and retry.backoff.ms to handle transient broker/network failures gracefully.</li><li><strong>Delivery Timeout</strong>: Set delivery.timeout.ms to a reasonable bound to prevent indefinite retries. This ensures failed records are surfaced quickly.</li><li><strong>Track producer JMX metrics</strong> withrecord-send-rate (throughput), record-error-rate (failure detection) andbuffer-available-bytes (backpressure monitoring). Integrate these metrics into observability platforms (Prometheus, Grafana) for proactive alerting.</li><li><strong>Acks Setting</strong>: Use acks=all for strongest durability guarantees, ensuring replication to all in-sync replicas. For lower latency, acks=1 may suffice, but at the cost of durability.</li><li><strong>Buffer Management</strong>: Monitor buffer usage to avoid BufferExhaustedException. Adjust buffer.memory and max.block.ms to balance throughput and application responsiveness.</li><li><strong>Error Handling</strong>: Always implement callbacks to log or handle failures, rather than ignoring them.</li></ul><p><strong>Production Tip:</strong> If your service sends thousands of small messages per second, increasing linger.ms from 0 ms to 5–10 ms can significantly improve throughput with minimal impact on latency.</p><p>By mastering Kafka Producer configurations and best practices, you can can build highly reliable, high-throughput messaging pipelines and lay the foundation for exactly-once processing when combined with Kafka transactions and appropriately configured consumers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8cc6031d540" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python vs Java in AWS Lambda: A Deep Dive into Bulk SQL Insertions]]></title>
            <link>https://medium.com/@gamini782/python-vs-java-in-aws-lambda-a-deep-dive-into-bulk-sql-insertions-cdf0640a11f3?source=rss-176183298225------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdf0640a11f3</guid>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-libraries]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Gamini Sharma]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 14:13:55 GMT</pubDate>
            <atom:updated>2025-07-24T14:13:55.756Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When your lambda function needs to handle bulk database inserts, language choice can dramatically influence performance, deployment simplicity, and cost. In AWS Lambda, Python and Java are two common picks — but they behave quite differently in this context. This post unpacks the nuances of Python’s executemany() versus Java’s JDBC batch inserts and explains which is better.</p><h3>Python’s executemany() — Lightweight and Fast</h3><p>Python’s executemany() method allows you to submit multiple SQL insert statements in one go. It’s concise, efficient, and a favorite for quick data operations in serverless setups.</p><p><strong>Advantages:</strong></p><ul><li>Rapid cold starts (typically under 300ms)</li><li>Minimal code with easy readability</li><li>Ideal for short, bursty tasks and log ingestion</li></ul><p><strong>Code Sample:</strong></p><pre>import psycopg2<br>from psycopg2 import extras</pre><pre>def lambda_handler(event, context):<br>    conn = psycopg2.connect(...)<br>    cursor = conn.cursor()</pre><pre>   data = [(&quot;Java&quot;, 1995), (&quot;Python&quot;, 1991)]<br>   extras.execute_values(cursor, &quot;INSERT INTO langtable(name, year) VALUES %s&quot;, data)</pre><pre>   conn.commit()<br>   cursor.close()<br>   conn.close()</pre><pre>return {&quot;statusCode&quot;: 200, &quot;body&quot;: &quot;Success&quot;}</pre><h3>Java JDBC Batch Inserts — Robust and Scalable</h3><p>Java’s JDBC API supports batch processing with addBatch() and executeBatch(). While Java Lambdas have a slower cold start due to the JVM, they’re incredibly powerful for heavier workloads once warmed.</p><p><strong>Advantages:</strong></p><ul><li>Strong error handling and transaction control</li><li>More granular performance tuning via JVM settings</li><li>Great for compute-intensive functions and persistent workloads</li></ul><p><strong>Code Sample:</strong></p><pre>public class InsertHandler implements RequestHandler&lt;Map&lt;String,Object&gt;, String&gt; {<br>    public String handleRequest(Map&lt;String,Object&gt; event, Context context) {<br>      Connection conn = DriverManager.getConnection(...);<br>      PreparedStatement stmt = conn.prepareStatement(&quot;INSERT INTO      langtable(name, year) VALUES (?, ?)&quot;);</pre><pre>      stmt.setString(1, &quot;Java&quot;); <br>      stmt.setInt(2, 1995); <br>      stmt.addBatch();<br>      stmt.setString(1, &quot;Python&quot;);   <br>      stmt.setInt(2, 1991); <br>      stmt.addBatch();<br>      stmt.executeBatch();<br>      conn.close();<br>      return &quot;Success&quot;;<br>    }<br>}</pre><h3>Performance Breakdown</h3><h4><strong>Python: executemany()</strong></h4><ul><li><strong>Cold Start:</strong> Super fast (100ms)</li><li><strong>Runtime:</strong> I/O-optimized, perfect for short-lived data tasks</li><li><strong>Deployment:</strong> Easy via .zip or Lambda Layer</li><li><strong>Complexity:</strong> Very readable and compact</li><li><strong>Ideal For:</strong> Event ingestion, lightweight ETL, logging</li></ul><h4>Java: JDBC Batch</h4><ul><li><strong>Cold Start:</strong> Sluggish (~1–3s), due to JVM initialization</li><li><strong>Runtime:</strong> Excels for CPU-bound and persistent jobs</li><li><strong>Deployment:</strong> Requires .jar, build tools, and setup configuration</li><li><strong>Complexity:</strong> Verbose but powerful</li><li><strong>Ideal For:</strong> Enterprise ETL, batch reporting, compute-intensive ops</li></ul><h3>Tuning Tips</h3><ul><li><strong>Python</strong>: Use Lambda Layers for dependency management and keep deployment size minimal.</li><li><strong>Java</strong>: Consider SnapStart or compiling to native binaries with GraalVM to reduce latency.</li><li><strong>Both</strong>: Use parameterized queries to protect against SQL injection and improve efficiency.</li></ul><h3>Conclusion</h3><p>For most quick-hit Lambda insert operations, Python’s simplicity and agility give it a clear edge. It’s easier to deploy, snappier to start, and performs well with moderate loads. If you’re building real-time data sinks, event loggers, or quick analytics jobs, Python is a perfect match.</p><p>However, Java brings undeniable muscle to the table — especially for enterprises handling complex transactions or working within JVM-dominant environments. It requires more setup but rewards that effort with scalability and fine-tuned control. Though its cold starts are slower, its performance scales gracefully, making it ideal for large datasets, complex workflows, and enterprise applications.</p><p>Python when used for real time data with insertion of 9+ millions of records would take nearly 70sec. However, Java on the other hand would take more than 15 min for the same sample records for real time data processing. Java is win-win solution when working with large and complex datasets. Both tools are powerful — it just depends on what kind of workload you’re optimizing for.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdf0640a11f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>