<?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"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://nkeerthikumar.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 10:14:45 GMT</lastBuildDate><atom:link href="https://nkeerthikumar.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to debug in Kubernetes]]></title><description><![CDATA[Debugging applications running in Kubernetes can be a bit more involved than debugging traditional applications, but there are several tools and techniques available to assist with this process. Here are some common methods for debugging in Kubernete...]]></description><link>https://nkeerthikumar.hashnode.dev/how-to-debug-in-kubernetes</link><guid isPermaLink="true">https://nkeerthikumar.hashnode.dev/how-to-debug-in-kubernetes</guid><category><![CDATA[Kubernetes]]></category><dc:creator><![CDATA[Keerthi Kumar N]]></dc:creator><pubDate>Mon, 25 Mar 2024 06:49:28 GMT</pubDate><content:encoded><![CDATA[<p>Debugging applications running in Kubernetes can be a bit more involved than debugging traditional applications, but there are several tools and techniques available to assist with this process. Here are some common methods for debugging in Kubernetes:</p>
<ol>
<li><p><strong>Logs</strong>:</p>
<ul>
<li><p>Access container logs using <code>kubectl logs &lt;pod_name&gt;</code> or <code>kubectl logs &lt;pod_name&gt; -c &lt;container_name&gt;</code> for multi-container pods.</p>
</li>
<li><p>You can also use a log aggregation tool like Elasticsearch, Fluentd, and Kibana (EFK) stack or Prometheus and Grafana for centralized logging and monitoring.</p>
</li>
</ul>
</li>
<li><p><strong>Exec into a container</strong>:</p>
<ul>
<li><p>Use <code>kubectl exec -it &lt;pod_name&gt; -- &lt;command&gt;</code> to execute a command inside a running container.</p>
</li>
<li><p>This is useful for inspecting the container's filesystem, running debugging tools, or attaching a debugger.</p>
</li>
</ul>
</li>
<li><p><strong>Attach a debugger</strong>:</p>
<ul>
<li><p>For applications that support debuggers, you can attach a debugger to a running container using <code>kubectl port-forward</code> to forward a local port to the container's debug port.</p>
</li>
<li><p>This allows you to use your local IDE or debugging tools to connect to the running application in the container.</p>
</li>
</ul>
</li>
<li><p><strong>Kubernetes Dashboard</strong>:</p>
<ul>
<li><p>The Kubernetes Dashboard provides a web-based UI for managing and monitoring your Kubernetes cluster.</p>
</li>
<li><p>It can be useful for visualizing the state of your pods, containers, and resources, as well as accessing logs and executing commands.</p>
</li>
</ul>
</li>
<li><p><strong>Debugging sidecar containers</strong>:</p>
<ul>
<li><p>You can add a debugging sidecar container to your pod that shares the file system with the main application container.</p>
</li>
<li><p>This sidecar container can be used to run debugging tools, inspect files, or even attach a debugger to the main application process.</p>
</li>
</ul>
</li>
<li><p><strong>Ephemeral debugging containers</strong>:</p>
<ul>
<li><p>You can create a new container in the same pod as your application container using <code>kubectl debug</code> (requires the EphemeralContainers feature gate to be enabled).</p>
</li>
<li><p>This debugging container can share the filesystem and network namespace with the application container, making it easier to inspect and debug the running application.</p>
</li>
</ul>
</li>
<li><p><strong>Remote debugging</strong>:</p>
<ul>
<li><p>For applications that support remote debugging, you can configure your application to expose a debugging port and use <code>kubectl port-forward</code> to access it from your local machine.</p>
</li>
<li><p>This allows you to use your preferred debugging tools and IDE to remotely debug the running application in the container.</p>
</li>
</ul>
</li>
<li><p><strong>Debugging Node.js applications</strong>:</p>
<ul>
<li><p>For Node.js applications, you can use the <code>node-inspect</code> or <code>--inspect</code> flag to enable the V8 inspector and attach a debugger to the running process.</p>
</li>
<li><p>You can then use tools like Chrome DevTools or Visual Studio Code to debug your Node.js application running in a Kubernetes container.</p>
</li>
</ul>
</li>
<li><p><strong>Debugging Java applications</strong>:</p>
<ul>
<li><p>For Java applications, you can enable remote debugging by passing the appropriate Java Virtual Machine (JVM) arguments to your application.</p>
</li>
<li><p>You can then use an IDE like IntelliJ IDEA or Eclipse to attach a remote debugger to the running Java process in the container.</p>
</li>
</ul>
</li>
<li><p><strong>Monitoring and tracing tools</strong>:</p>
<ul>
<li><p>Tools like Prometheus and Zipkin can help you monitor and trace your applications running in Kubernetes, providing valuable insights into their behavior and performance.</p>
</li>
<li><p>These tools can assist in identifying and debugging issues related to performance, latency, or distributed system interactions.</p>
</li>
</ul>
</li>
</ol>
<p>Remember that debugging in Kubernetes may require additional setup and configuration compared to traditional application environments. It's also a good practice to build debugging capabilities into your applications from the start, such as exposing health check endpoints, enabling logging, and supporting remote debugging.</p>
]]></content:encoded></item><item><title><![CDATA[Differences between indexing in Postgres and MySQL database]]></title><description><![CDATA[Introduction
Indexes are crucial components in database management systems (DBMS) that significantly improve query performance by providing efficient data retrieval mechanisms. They are used to speed up data access operations, such as searching, sort...]]></description><link>https://nkeerthikumar.hashnode.dev/differences-between-indexing-in-postgres-and-mysql-database</link><guid isPermaLink="true">https://nkeerthikumar.hashnode.dev/differences-between-indexing-in-postgres-and-mysql-database</guid><category><![CDATA[PostgreSQL]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[indexing]]></category><dc:creator><![CDATA[Keerthi Kumar N]]></dc:creator><pubDate>Fri, 22 Mar 2024 09:33:02 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Indexes are crucial components in database management systems (DBMS) that significantly improve query performance by providing efficient data retrieval mechanisms. They are used to speed up data access operations, such as searching, sorting, and joining tables. However, the implementation and behavior of indexes can vary across different DBMS platforms, leading to variations in performance and functionality.</p>
<p>This article focuses on exploring the differences between SQL indexes in two popular open-source relational database management systems: PostgreSQL and MySQL. By understanding these differences, database administrators and developers can make informed decisions when choosing the appropriate DBMS for their specific use cases and optimize their database systems for better performance.</p>
<h2 id="heading-index-fundamentals">Index Fundamentals</h2>
<p>An index is a data structure that stores a subset of data from a table in a specific order, allowing for faster data access and retrieval. Indexes are created on one or more columns of a table, and they maintain a sorted representation of the indexed column(s) along with pointers to the corresponding rows in the table.</p>
<p>Indexes improve query performance by reducing the amount of data that needs to be scanned during querying operations. Instead of scanning the entire table, the DBMS can use the index to quickly locate the relevant rows, significantly reducing the time and resources required for data retrieval.</p>
<h2 id="heading-index-features-in-postgresql"><strong>Index Features in PostgreSQL</strong></h2>
<p><strong>1. Multi column Indexes</strong>: PostgreSQL supports creating indexes on multiple columns, improving the performance of queries involving multiple columns in the <code>WHERE</code>, <code>JOIN</code>, or <code>ORDER BY</code> clauses.</p>
<p><strong>2. Partial Indexes</strong>: Also known as filtered indexes, partial indexes allow indexing a subset of a table's rows based on a specified condition. This can significantly reduce the index size and improve performance for specific query patterns.</p>
<p><strong>3. Index-Only Scans</strong>: In certain cases, PostgreSQL can satisfy a query by scanning the index itself without accessing the actual table data, further improving query performance.</p>
<p><strong>4. Index Locking and Concurrency Control</strong>: PostgreSQL implements sophisticated locking and concurrency control mechanisms to ensure data integrity and consistency while allowing concurrent access to indexes and tables.</p>
<p><strong>5. Index Bloat Management</strong>: PostgreSQL provides tools and mechanisms for monitoring and managing index bloat, which can occur due to frequent updates or deletions, leading to wasted disk space and potential performance degradations.</p>
<p><strong>6. Index Replication and Sharding:</strong> PostgreSQL supports advanced features like logical replication and sharding, allowing indexes to be replicated or distributed across multiple nodes for improved scalability and performance.  </p>
<h2 id="heading-index-features-in-mysql">Index features in MySQL</h2>
<p><strong>1. Multi-column Indexes:</strong> Similar to PostgreSQL, MySQL supports creating indexes on multiple columns, improving the performance of queries involving multiple columns in the <code>WHERE</code>, <code>JOIN</code>, or <code>ORDER BY</code> clauses.</p>
<p><strong>2. Prefix Indexes:</strong> MySQL allows indexing only a prefix of a column's value, which can be useful for reducing index size and improving performance for queries involving long string columns.</p>
<p><strong>3. Descending Indexes:</strong> MySQL supports creating indexes in descending order, which can be beneficial for certain query patterns involving range queries and sorting operations.</p>
<p><strong>4. Index Locking and Concurrency Control:</strong> MySQL implements locking and concurrency control mechanisms to ensure data integrity and consistency while allowing concurrent access to indexes and tables.</p>
<p><strong>5. Index Maintenance and Optimization:</strong> MySQL provides tools and utilities for monitoring, analyzing, and optimizing indexes, including index rebuild operations and online index creation.</p>
<p><strong>6. Index Replication and Sharding:</strong> Similar to PostgreSQL, MySQL supports advanced features like replication and sharding, allowing indexes to be replicated or distributed across multiple nodes for improved scalability and performance.</p>
<h2 id="heading-some-major-unknowns"><strong>Some Major Unknowns</strong></h2>
<p><strong>PostgreSQL</strong></p>
<ol>
<li><p>any index (primary/secondary) will directly point to the disk location. There is no intermediary step to fetch the data based on secondary indexes.</p>
</li>
<li><p>Any row update will update the associated indexes. Despite of this the reads are faster due to no intermediary step, and in the secondary indexes, the disk location is already accessible.</p>
</li>
</ol>
<p><strong>MySQL</strong></p>
<ol>
<li><p>Any secondary index points to a primary index and the primary index points to the disk row locations where the actual data is persisted. Any new index will point to the primary index (PK), not the disk.</p>
</li>
<li><p>Index reads are slower due to the extra process of reaching to primary index to get the disk location of the row.</p>
</li>
<li><p>Updates are faster as there is no need of updating all the related indexes.</p>
</li>
</ol>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Indexing is a critical aspect of database management and performance optimization. While PostgreSQL and MySQL share some similarities in their indexing capabilities, there are notable differences in terms of index types, features, and implementations.</p>
<p>PostgreSQL offers a more extensive range of index types, including specialized indexes for handling complex data types like spatial and full-text search data. It also provides advanced indexing features like covering indexes, expression indexes, and functional indexes, enabling efficient querying on derived or transformed data.</p>
<p>On the other hand, MySQL focuses primarily on B-Tree and Hash indexes but offers unique features like clustered indexes, index prefixes, and compressed indexes, which can be beneficial for specific workloads and storage considerations.</p>
<p>Both database management systems provide robust indexing capabilities, locking and concurrency control mechanisms, and tools for index maintenance and optimization. However, the choice between PostgreSQL and MySQL for a specific use case may depend on factors such as workload characteristics, data types, concurrency requirements, and performance considerations.</p>
]]></content:encoded></item></channel></rss>