<?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 Ega Saputra on Medium]]></title>
        <description><![CDATA[Stories by Ega Saputra on Medium]]></description>
        <link>https://medium.com/@egasa?source=rss-adc73b5a972------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gcnpU2L9AcrXE6FwQrz76Q.jpeg</url>
            <title>Stories by Ega Saputra on Medium</title>
            <link>https://medium.com/@egasa?source=rss-adc73b5a972------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 14:59:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@egasa/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[Looking for an IntelliJ Alternative Led to My First Open Source Contribution]]></title>
            <link>https://medium.com/@egasa/looking-for-an-intellij-alternative-led-to-my-first-open-source-contribution-04bf66682481?source=rss-adc73b5a972------2</link>
            <guid isPermaLink="false">https://medium.com/p/04bf66682481</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[jetbrains]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Ega Saputra]]></dc:creator>
            <pubDate>Fri, 06 Nov 2026 12:45:17 GMT</pubDate>
            <atom:updated>2026-11-06T12:45:17.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/712/0*ZLWw-80P_Qa_JL8w.png" /></figure><p>Hola, buongiorno. So, recently I started exploring alternatives to the JetBrains tools I use every day since our JetBrains subs expire this December and we’re not extending them (in this economy, bro). For web development, I’m comfortable switching from WebStorm to VS Code (I still use it sometimes, actually). But for Java and Kotlin, it’s a different story. I’ve spent years using IntelliJ IDEA, and I’m used to its shortcuts, navigation, and the JetBrains ecosystem. Moving away from it means changing habits I’ve built over time.</p><p>Talk about perfect timing. Just a few days ago, while scrolling through Threads, I noticed an account that actively shares FOSS (Free and Open-Source Software) projects. Coincidentally, they had just posted about OpenIDEA, an alternative to IntelliJ IDEA.</p><p>My first impression was: “Njir plek ketiplek karo Intellij”. In Javanese, plek ketiplek means something like “exactly alike.” That was how it felt to me: very familiar. Familiar enough that I wanted to give it a proper try. I downloaded OpenIDEA 0.1.33 for my Mac, opened my Java project, and started using it.</p><p>Things were going well until I found an unexpected error on a Java record using Lombok’s @Builder annotation. The constructor PaymentInquiryDto() is undefined. The same code worked in IntelliJ IDEA and compiled successfully with javac. Why was OpenIDEA reporting an error? That question became the starting point of my first open source contribution.</p><p>The investigation led to Lombok’s Eclipse handler, used by the Java tooling behind OpenIDEA. The issue involved a compact record constructor. Its parameters come implicitly from the record components, but the builder handler treated it as having no parameters.</p><p>It generated a call to a zero argument constructor that didn’t exist. Removing the constructor’s @Builder annotation avoided the error. But I wanted the original code to work unchanged.</p><p>The source fix was small, read the implicit constructor parameters from the record components. Making that fix ready to contribute involved more work. The PR included regression tests, an updated bundled Lombok agent, a checksum, and documentation explaining how to reproduce the build.</p><p>I ran the patched OpenIDEA on my laptop, opened the original code, and the error was gone. Then I opened a pull request.</p><p>That wasn’t quite the end. While the PR was open, another Lombok update landed on main, creating conflicts. Resolving them meant rebuilding the agent with both sets of fixes, so my change would preserve the improvements already merged upstream.</p><p>I also learned to check the contribution guide, create a linked issue, and document the commands and results used to verify the fix. A working change on my laptop was the starting point; the PR needed enough information for someone else to review it.</p><p>On November 6, 2026, my PR was merged into OpenIDEA. You can check it here <a href="https://github.com/l0ng-ai/openidea/pull/950">PR #950</a>.</p><p>My first open source contribution had become part of a project I was using for my own work.</p><p>I started this because I wanted to find an alternative IDE that suited my daily work. I didn’t begin with a plan to contribute to open source. I used a project, found a bug that affected me, and followed it far enough to share a fix.</p><p>Now, every time I open similar code without encountering the constructor error, I’m reminded of a small piece of the IDE that I helped improve. And man, that feeling is amazing mwehehehe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04bf66682481" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Backend to One-Man-Army: Handling Architecture and Deployment in a Small Squad]]></title>
            <link>https://medium.com/@egasa/from-backend-to-one-man-army-handling-architecture-and-deployment-in-a-small-squad-a8f057b3a3ed?source=rss-adc73b5a972------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8f057b3a3ed</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Ega Saputra]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 16:45:13 GMT</pubDate>
            <atom:updated>2025-12-12T16:45:13.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7xULp-YjRSEdJ67Cv8ehA.jpeg" /></figure><p>I recently watched a video by Pak Eko (Programmer Zaman Now) titled “Backend harus ngerti Devops?” (Must backend devs know DevOps?). In that video, Pak Eko argues that even in big companies with dedicated DevOps teams, the Backend engineer still owns the “software” side of deployment. DevOps might provide the Kubernetes cluster, but we “developers”, must write the Dockerfile, define the pipeline steps, and sets the resource limits, because the DevOps team doesn’t know how to build our specific application.</p><p>The video validated the modern backend skillset, but it also made me realize that my reality is very different.. In my team, there is no “departement”, we are that “department” itself. LOL. In my squad, there is no one else to set up the server or configure the runners. The line between Backend and DevOps doesn’t just blur, it disappears.</p><h4>The Squad</h4><p>To give you context, I am working on a <strong>freelance side project</strong> with a hyper-lean team of four:</p><ul><li><strong>The Business Analyst:</strong> Bridges the stakeholders and requirements.</li><li><strong>The UI/UX Designer:</strong> Crafts the visual experience.</li><li><strong>The Frontend Developer:</strong> Builds the client-side interface.</li><li><strong>The Backend Developer (Me):</strong> The engine room.</li></ul><p>With no Engineering Manager or System Architect, I couldn’t just “write code.” I had to become the System Analyst, the Architect, and the DevOps engineer all at once. (I owe a huge shout-out to Bapak Zaka for equipping me with the architectural mindset to pull this off). And here is how I set up a robust, automated system on a shoestring budget.</p><h4>Wearing the System Analyst Hat</h4><p>Before writing a single line of Go, I’ve to bridge the gap between the Business Analyst’s requirements and the actual code.</p><ul><li><strong>Database Design:</strong> I translate business rules into normalized database schemas.</li><li><strong>API Contracts:</strong> I define the endpoints early so the Frontend developer isn’t blocked. We agree on the JSON structure before implementation begins.</li><li><strong>Project Structure:</strong> I set up the initial repository structure for <em>both</em> Frontend and Backend to ensure we follow a consistent engineering standard.</li></ul><h4>The Architecture: DDD &amp; Clean Architecture on a Budget</h4><p>You might think Domain-Driven Design (DDD) is overkill for a one-man backend team. I disagree.</p><p>When you are the only one maintaining the backend, <strong>clarity is your best friend.</strong> If I come back to this code after a month, I need to know exactly where the business logic lives versus where the database queries are. I use <strong>Clean Architecture</strong> to enforce this separation.</p><h4>The Project Structure</h4><p>Here is how I organize the code to keep the “One-Man Army” sane:</p><pre>.<br>├── cmd/                  # Main entry points<br>│   ├── server/           # The REST API server<br>│   └── worker/           # The Background Job Processor (River)<br>├── internal/             # Private application code<br>│   ├── domain/           # The Core (Pure Go, No Dependencies)<br>│   │   ├── model/        # Entities (e.g., User, WasteReport)<br>│   │   └── repository/   # Interfaces (Contracts for DB access)<br>│   ├── application/      # The Business Logic<br>│   │   ├── dto/          # Data Transfer Objects<br>│   │   └── service/      # Use Cases (e.g., auth_service.go)<br>│   └── infrastructure/   # The Implementation Details<br>│       ├── persistence/  # Database implementations (pg_user_repo.go)<br>│       ├── web/          # HTTP Handlers and Routers<br>│       └── clients/      # 3rd Party (Firebase, MinIO, WhatsApp)<br>└── db/migrations/        # SQL Migrations</pre><p>Why this works for a solo dev?</p><ul><li><strong>Cognitive Load:</strong> When I need to fix a bug in how we calculate carbon footprints, I go straight to internal/application/service. I don&#39;t get distracted by HTTP routing or SQL queries.</li><li><strong>Swappable Infrastructure:</strong> My domain layer defines the <em>interface</em> (repository/waste_report_repository.go), but infrastructure provides the implementation (persistence/pg_waste_report_repository.go).<br><em>Scenario:</em> If we decide to switch the database or change the caching strategy later, I only rewrite the infrastructure layer. The core business logic remains untouched.</li><li><strong>Separation of Concerns:</strong> Notice cmd/server and cmd/worker. Both use the same internal logic, but they run independently. This allows me to scale the worker (heavy processing) separately from the API server that handles user traffic.</li></ul><p>For the stack, I chose <strong>Go (Golang)</strong> for one specific reason, <strong>Efficiency.</strong> We run on limited VPS resources. A Java/Spring Boot application might eat up 500MB+ of RAM just sitting idle. A Go binary takes a fraction of that, allowing us to handle high traffic without upgrading to an expensive server tier.</p><h4>Handling Complexity: The Transactional Outbox with River</h4><p>One of our core features is a gamification system, users earn badges and points for submitting waste reports. Doing this calculation synchronously (blocking the HTTP response) creates a sluggish user experience.</p><p>I solved this using <strong>River</strong>, a robust job queue for Go and Postgres, specifically implementing the <strong>Transactional Outbox Pattern</strong>.</p><p>Even in a monolith, using an external queue like Redis creates a <strong>“Dual-Write” risk</strong>. If you commit the report to Postgres but the Redis connection fails before you push the job, the user loses their points. The data becomes inconsistent.</p><p>River uses Postgres for the queue itself. This allows me to insert the UserReport and the RiverJob <strong>within the same database transaction</strong>. If the report fails to save, the job is never created. If the report saves, the job is guaranteed to exist. <strong>Atomicity</strong> is achieved without complex recovery logic.</p><p><strong>The Workflow</strong></p><ol><li>I built a dynamic rule engine where badge criteria are stored in Postgres and cached in Redis for speed.</li><li>When a user submits a report, the SaveReportTx method executes. It commits the report data <em>and</em> the background job row atomically.</li><li>A separate Go routine polls the river_job table. It fetches the user&#39;s stats, checks the cached rules, and awards badges asynchronously.</li></ol><p>This setup gives me the reliability of an enterprise system with the simplicity of a single database.</p><h4>The “Lazy” DevOps: GitLab CI/CD</h4><p>In Pak Eko’s video, he mentions that tools like Jenkins are powerful but require setup. For a solo dev that on a limited budget, Jenkins is too heavy. It require a JVM and significant RAM just to run the dashboard, resources I’d rather save for the application itself.</p><p>My goal was simple. <strong>I never want to SSH into the server to deploy code.</strong> Deployment should be a side effect of merging a Pull Request.</p><ol><li><strong>Push to Feature Branch:<br></strong>Triggers: go test ./...<br>Ensures I don’t break the build before asking for a review.</li><li><strong>Merge to Staging Branch:<br></strong>Action: Automatically builds the Go binary, SCPs it to the Staging VPS, and restarts the service using systemd.<br>Result: The Business Analyst can test the new feature immediately.</li><li><strong>Merge to Main Branch:<br></strong>Action: Similar deploy process, but targets the Production server.</li></ol><p>By the time I mark a ticket as “Done” on our board, the code is already live. This automation frees me up to focus on what matters: solving the next problem.</p><h3>Conclusion: Embracing the Chaos</h3><p>Being the “One-Man-Army” in a small squad is daunting. You are responsible for the code quality, the database integrity, the server uptime, and the deployment pipeline. There is no one to blame if the server runs out of RAM or if the build fails. But this constraint is also a superpower. By choosing efficient tools and automating the “boring stuff”, I was able to build a system that feels enterprise-grade on a freelance budget.</p><p>As Pak Eko said, backend engineers need to understand DevOps. In my case, I didn’t just have to understand it, I had to live it. And honestly? It has made me a much better developer. I now write code knowing exactly how it will run, how it will fail, and how it will be deployed.</p><p>If you are a backend developer in a small team, don’t wait for a “DevOps Department” to appear. <strong>You are the department.</strong> Embrace it, automate it, and ship it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8f057b3a3ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimization Journey — Part 1: Materialized View Implementation]]></title>
            <link>https://medium.com/@egasa/optimization-journey-part-1-materialized-view-implementation-b29b899a800b?source=rss-adc73b5a972------2</link>
            <guid isPermaLink="false">https://medium.com/p/b29b899a800b</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ega Saputra]]></dc:creator>
            <pubDate>Wed, 06 Aug 2025 15:12:09 GMT</pubDate>
            <atom:updated>2025-08-06T15:12:09.848Z</atom:updated>
            <content:encoded><![CDATA[<h3>Optimization Journey — Part 1: Materialized View Implementation</h3><p>I recently faced a challenging task: a critical report generation process in our application was taking over 50 seconds to complete, severely impacting the user experience. This is the story of how my cell lead and I tackled the problem, the solutions I implemented, and the lessons learned along the way.</p><h3>Uncovering the Bottlenecks</h3><p>My first task, assigned by my cell lead, was to dive in and understand <em>why</em> the process was so slow. The report required complex JOIN operations across several large tables, along with on-the-fly computations. My investigation led me to a classic performance killer: the <strong>N+1 query problem</strong>.</p><p>I discovered the code was looping through a list of items and then making a separate database call inside the loop for each one to fetch related data.</p><p>I addressed this by creating a new data source method that fetched all the necessary data in a single, bulk query using a list of IDs. This <strong>batch fetching</strong> eliminated the loop of individual queries and immediately shaved about 4 seconds off the processing time. It was a good start, but it wasn&#39;t enough to meet our performance target. The core database query was still too heavy.</p><h3>Introducing Materialized Views</h3><p>My cell lead then suggested I research and implement a <strong>materialized view (MV)</strong>. So, what is it?</p><p>Think of a standard database VIEW as a stored, named query. When you query the view, the database runs the underlying complex query every single time. A MATERIALIZED VIEW, on the other hand, is like a snapshot. It runs the complex query once and stores the results in a physical table. Querying the materialized view is then as fast as querying a simple table, because all the expensive joins and calculations are already done.</p><p>This approach seemed perfect for our situation. The report data didn&#39;t need to be real-time down to the millisecond; a slight delay was acceptable. I could offload the heavy lifting to a background process that would periodically update this &quot;snapshot.&quot;</p><h3>The Implementation and Initial Results</h3><p>I created a materialized view that contained the pre-joined and pre-calculated data for our agent performance report. Then, I simplified the application code, which previously ran a heavy JOIN query, to perform a basic SELECT from the new MV.</p><p>A key part of the strategy was the refresh mechanism. I used PostgreSQL&#39;s REFRESH MATERIALIZED VIEW CONCURRENTLY. The CONCURRENTLY keyword is crucial because it updates the view&#39;s data <strong>without locking it for reads</strong>. This ensures that while the refresh is happening in the background (which took about 20-25 seconds in my testing), users can still generate reports without interruption.</p><p>To automate this, I set up a <strong>Quartz scheduler</strong> to trigger the refresh job every minute. The results were dramatic. Report generation time plummeted from over <strong>50 seconds to under 10 seconds</strong>. It felt like a massive win for performance.</p><h3>A New Challenge: The Cost of Refreshing</h3><p>My solution worked beautifully for a single report type, so it was deployed to production. However, my victory was short-lived. We soon discovered a new problem stemming from our multi-tenant architecture.</p><p>My initial implementation triggered a refresh for all tenants simultaneously. With millions of rows to process, this single job consumed a huge number of database connections. This led to <strong>connection pool exhaustion</strong>, where other tenants and services were starved of connections and couldn&#39;t access the database, causing system-wide failures.</p><p>I had optimized the report generation, but at the cost of system stability.</p><h3>Refining the Refresh Strategy</h3><p>The solution, provided by my cell lead, was to make the refresh process “tenant-aware” and spread the load. Instead of one massive job, the new strategy was to refresh the data for one tenant at a time.</p><p>My cell lead modified the scheduled job to perform the following steps:</p><ol><li>Fetch a list of all active tenants.</li><li>Iterate through the list of tenants.</li><li>Inside the loop, trigger the REFRESH command for <strong>only the current tenant&#39;s data</strong>.</li><li>Include try-catch error handling within the loop, so if the refresh fails for one tenant, it logs the error and continues to the next, preventing the entire job from crashing.</li></ol><p>Here is a simplified pseudocode of the improved job:</p><pre>// Scheduled Job Execution<br>fun execute() {<br>    // 1. Get all tenants from the master service<br>    val tenants = masterClient.getAllTenants()<br><br>    // 2. Loop through each tenant<br>    for (tenant in tenants) {<br>        try {<br>            log.info(&quot;Starting MV refresh for tenant: ${tenant.key}&quot;)<br><br>            // 3. Call the refresh function for one tenant<br>            callClient.refreshMVForTenant(tenant.key)<br><br>            log.info(&quot;Successfully refreshed MV for tenant: ${tenant.key}&quot;)<br>        } catch (e: Exception) {<br>            // 4. Log error and continue to the next tenant<br>            log.error(&quot;Failed to refresh MV for tenant ${tenant.key}&quot;, e)<br>        }<br>    }<br>}</pre><p>This sequential approach ensures the job never overwhelms the database connection pool, maintaining system stability.</p><p>To complement this change, my cell lead also adjusted the scheduler’s timing. Since refreshing tenants one-by-one takes longer than the original one-minute interval, he increased the time between jobs to <strong>every few minutes</strong>. This prevents a new job from starting before the previous one has finished, avoiding potential conflicts and ensuring the process remains robust.</p><h3>Conclusion: An Effective Short-Term Fix</h3><p>By implementing a materialized view and the critical fix to the refresh strategy implemented by my cell lead, we successfully achieved the goal of drastically reducing report generation time. This solution is now stable in production.</p><p>However, we view this as a powerful <strong>short-term solution</strong>. It effectively patches the performance issue, and we are already exploring a more robust, event-driven architecture for the long term. Stay tuned for Part 2!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b29b899a800b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello World]]></title>
            <link>https://medium.com/@egasa/hello-world-fb89f31b6f0d?source=rss-adc73b5a972------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb89f31b6f0d</guid>
            <category><![CDATA[introduction]]></category>
            <dc:creator><![CDATA[Ega Saputra]]></dc:creator>
            <pubDate>Sat, 03 May 2025 13:46:19 GMT</pubDate>
            <atom:updated>2025-05-03T14:28:04.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*FXXnZGZZID4Gmo2IyVEBcQ.png" /></figure><p>Hola amigos, before I begin, I would like to introduce myself, I am Ega. This is the first time in my life to writing an article. Actually, I dunno what I want to write, and you might wonder why I write something if I don’t even know what I want to write. I write this coz my lecturer asked me to write something, so i’m trying to write something here. I’m from Indonesia, and here there is a proverb that says “tak kenal maka tak sayang”, it’s kinda weird if you tried to translate it to english because of our different culture, but I think it means something like this “you cant’t love something which you don’t know”. Of course I don’t expect or want you to love me lol. I was at lost for where to start, so I’m making that my cue to begin with an introduction.</p><h3>Who Am I?</h3><p>I’m a final year undergraduate student in Information Systems, which I leverage in my role as a Software Engineer. My background in Information systems has given me a strong foundation in understanding complex systems, and I love applying that knowledge to solve real-world problems through software development. Currently I also working on a project and maybe I will write about it here later.</p><p>Beyond the world of code, I also love gaming. It’s all started when i was a kid, fueled by my dad’s old Atari, my big bro’s Nintendo and also exposure of playstation. I’ve also developed several games before, which has given me a fascinating perspective on the mechanics and artistry behind the games I enjoy.</p><p>Speaking of favorites, music is another big part of my life. I occasionally pick up the guitar and bass, because thats the only musical instrument that I can play (read: skill issue). My taste leans heavily towards classic rock and older tunes, a direct result of my older sibling’s influence. You’ll often find me listening to the iconic sounds of Muse, Led Zeppelin, AC/DC, Guns N’ Roses, Black Sabbath, Dream Theater, and countless other legendary bands.</p><p>So, as you can see, my interests span from the logical precision of software engineering to immersive worlds of gaming and powerful energy of rock music. This blend of technical and creative pursuits shapes how I see the world and, hopefully, will bring a unique perspective to the topics I explore here on Medium. Stay tuned for more insights into my projects, thoughts on technology, and perhaps even some reflections on the games and music that inspire me or anything in my mind that comes up.</p><p>Adios</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb89f31b6f0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>