<?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 Aishwarya Pansare on Medium]]></title>
        <description><![CDATA[Stories by Aishwarya Pansare on Medium]]></description>
        <link>https://medium.com/@aishpansare?source=rss-4735f76cb01d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zGG-SP-9FCDAmtXrKpihDg.jpeg</url>
            <title>Stories by Aishwarya Pansare on Medium</title>
            <link>https://medium.com/@aishpansare?source=rss-4735f76cb01d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 17:05:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aishpansare/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[Building a Generic Audit Table for All Database Operations]]></title>
            <link>https://medium.com/villa-plus-engineering/building-a-generic-audit-table-for-all-database-operations-99cf1cfa18c5?source=rss-4735f76cb01d------2</link>
            <guid isPermaLink="false">https://medium.com/p/99cf1cfa18c5</guid>
            <category><![CDATA[audit-logging-system]]></category>
            <category><![CDATA[generic-audit-table-sql]]></category>
            <category><![CDATA[build-generic-audit-table]]></category>
            <category><![CDATA[centralized-audit-logging]]></category>
            <dc:creator><![CDATA[Aishwarya Pansare]]></dc:creator>
            <pubDate>Thu, 30 Apr 2026 05:06:00 GMT</pubDate>
            <atom:updated>2026-04-30T05:06:00.454Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern applications, tracking data changes is just as important as storing the data itself. Whether it’s a small app or a large system, knowing what changed, when it changed, and who made the change helps with debugging, accountability, and meeting compliance needs.</p><p>There are different ways to track data changes, such as Application Insights or system-versioned temporal tables. However, these approaches have some limitations. For example, in Application Insights, understanding a complete change often requires joining multiple logs or tables, which can be complex. Also, while these methods can show what data changed over time, they usually don’t clearly capture who performed the action.</p><p>That’s why using a custom audit table becomes important. It gives you full control to track not just the data changes, but also the user responsible for those changes, all in one place.</p><p><strong>What is an Audit Table?</strong></p><p>An audit table stores a history of important actions performed on your system’s data, typically Create, Update, and Delete operations.</p><p>A well-designed audit system should answer:</p><ul><li>Who performed the action?</li><li>What changed?</li><li>When did it happen?</li><li>What was the previous vs. new state?</li></ul><p><strong>How an Audit Table Works</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*7aEqamYnywOxAjRfd5buIg.jpeg" /></figure><p><strong>Step-by-step flow:</strong></p><ol><li>A user performs an action (Create / Update / Delete)</li><li>The application processes the request</li><li>A database transaction begins</li><li>Two operations happen <strong>together</strong>:</li></ol><ul><li>Data is modified in the main table</li><li>An audit record is inserted into the audit table</li></ul><p>5. The transaction commits → both succeed or both fail</p><p><strong>Designing the Audit Table</strong></p><p>A flexible and generic audit table should be capable of handling records across multiple entities while remaining simple, scalable, and easy to query.</p><p>Here is a clean and effective baseline structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*19KJBEQya1SHArFGWBB7Dw.png" /></figure><p><strong>Field Breakdown</strong></p><ul><li><strong>Id</strong>: Unique identifier for each audit record</li><li><strong>EntityName</strong>: Name of the main table or entity where the operation was performed (e.g., User, Order, Product)</li><li><strong>EntityID</strong>: Identifier of the record in the main table</li><li><strong>Details</strong>: JSON representation of the latest state of the entity</li><li><strong>ActionedBy</strong>: JSON containing user details and timestamp of the action</li></ul><p><strong>Why JSON for Details and ActionedBy?</strong></p><p>Using JSON provides flexibility and scalability:</p><ul><li>Store complex object structures without frequent schema changes</li><li>Easily serialize and deserialize application objects</li><li>Adapt to evolving data models without database redesign</li><li>No indexing is required</li></ul><p><strong>Implementing Audit Logging in Code</strong></p><p>To ensure consistency, audit logging must be part of the <strong>same database transaction</strong> as the main operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_-KI68nZhdPCp7kgpKxTA.png" /></figure><p><strong>Key Takeaways from the Code</strong></p><ul><li><strong>Transactional Integrity</strong><br> Audit and data operations succeed or fail together</li><li><strong>Batch Processing</strong><br> Efficiently handles multiple records in one operation</li><li><strong>Reusable Design</strong><br> A generic audit model works across different entities</li></ul><p><strong>Conclusion</strong></p><p>A well-designed audit table is a cornerstone of robust application architecture. It improves visibility into system operations while enhancing reliability, traceability, and trust.</p><p>By implementing a <strong>generic, transaction-safe audit mechanism</strong>, you can scale your application confidently while maintaining full control over your data history.</p><p>Whether you are debugging production issues or meeting compliance requirements, an audit trail ensures you are never in the dark about what happened in your system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99cf1cfa18c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/villa-plus-engineering/building-a-generic-audit-table-for-all-database-operations-99cf1cfa18c5">Building a Generic Audit Table for All Database Operations</a> was originally published in <a href="https://medium.com/villa-plus-engineering">Villa Plus Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>