<?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: Muhammad Azis Husein</title>
    <description>The latest articles on DEV Community by Muhammad Azis Husein (@muhammadazis).</description>
    <link>https://dev.to/muhammadazis</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1272532%2F7ad16231-f677-49ca-8650-f7733c5fd06f.jpg</url>
      <title>DEV Community: Muhammad Azis Husein</title>
      <link>https://dev.to/muhammadazis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muhammadazis"/>
    <language>en</language>
    <item>
      <title>Showcase Your Dev.to Articles in Style</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Thu, 24 Jul 2025 02:21:41 +0000</pubDate>
      <link>https://dev.to/muhammadazis/showcase-your-devto-articles-in-style-1770</link>
      <guid>https://dev.to/muhammadazis/showcase-your-devto-articles-in-style-1770</guid>
      <description>&lt;p&gt;Have you ever written an article on Dev.to that you were particularly proud of? I have. And naturally, I wanted to feature it prominently on my GitHub profile README. I searched for a simple tool to create a nice-looking, dynamic card for my post, but I couldn't quite find what I was looking for.&lt;/p&gt;

&lt;p&gt;So, as many of us developers do when faced with a missing tool, I decided to build the solution myself.&lt;/p&gt;

&lt;p&gt;Today, I'm happy to share the result with you all: Dev.to Badge, an open-source project that lets you generate beautiful SVG badges for your articles.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does It Look Like?
&lt;/h2&gt;

&lt;p&gt;You can create a clean, modern-looking card that automatically pulls information from your post. Here is an example:&lt;/p&gt;

&lt;p&gt;With this tool, you can display:&lt;/p&gt;

&lt;p&gt;🖼️ The article's cover image&lt;br&gt;
📝 The title and a short description&lt;br&gt;
👤 Your author information&lt;br&gt;
❤️ The number of reactions and comments&lt;br&gt;
🕒 The estimated reading time&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Use It
&lt;/h2&gt;

&lt;p&gt;Using it is simple. You just need to embed an image in your Markdown file with the provided API.&lt;/p&gt;
&lt;h3&gt;
  
  
  Using URL:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![Dev.to Article](https://devto-badge.vercel.app/api?url=https://dev.to/YOUR_DEVTO_USERNAME/YOUR_ARTICLE_SLUG)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Using username &amp;amp; slug:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![Dev.to Article](https://devto-badge.vercel.app/api?username=YOUR_DEVTO_USERNAME&amp;amp;slug=YOUR_ARTICLE_SLUG)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can easily embed it in your Markdown file (like a GitHub README). Here the example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;![Example](https://devto-badge.vercel.app/api?username=muhammadazis&amp;amp;slug=3-main-aspects-to-boost-life-career-35h4&amp;amp;theme=dark)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it! Your profile will now proudly display your featured articles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpinst3wewbe2ttn50ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpinst3wewbe2ttn50ts.png" alt="Example Post" width="770" height="644"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 To see a full documentation about it. Please check out the project on GitHub: &lt;a href="https://github.com/azis14/devto-badge" rel="noopener noreferrer"&gt;https://github.com/azis14/devto-badge&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  An Invitation to Collaborate
&lt;/h2&gt;

&lt;p&gt;This project is in its early chapters, and history is best written together. It is completely open source, and contributions are very welcome.&lt;/p&gt;

&lt;p&gt;Whether you are interested in fixing bugs, adding new themes, improving the documentation, or suggesting new features, your help would be invaluable. Please feel free to check out the "Issues" tab on the repository to see where you can jump in.&lt;/p&gt;

&lt;p&gt;I hope this tool helps you showcase your hard work. Let me know what you think in the comments below!&lt;/p&gt;

</description>
      <category>devto</category>
      <category>opensource</category>
      <category>github</category>
      <category>markdown</category>
    </item>
    <item>
      <title>AI in The Context of Learning</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Tue, 15 Jul 2025 17:06:06 +0000</pubDate>
      <link>https://dev.to/muhammadazis/ai-in-the-context-of-learning-2jfa</link>
      <guid>https://dev.to/muhammadazis/ai-in-the-context-of-learning-2jfa</guid>
      <description>&lt;p&gt;A few days before publishing this post, I read two of my friend’s post on LinkedIn about his experience on being ‘slowing down’ in the rapid current of AI. While he find it beneficial for learning, I found myself contemplating it further. No, I’m not in disagree stance with his statements, but I was thinking about my own experience. That’s absolutely effective, but is it efficient? &lt;/p&gt;

&lt;p&gt;If the purpose of learning is to get a strong fundamental understanding of certain subject and mastering it along the way, I’m definitely agree and encourage to do it the hard way! But for some instance, sometimes the purpose of my learning experience isn’t about mastering the subject from the bottom to the top. It’s more about broadening my perspective on other subjects that are closely related to my area of expertise. So the target is to have a sufficient knowledge about the new subject and pragmatically implement it along with my expertise.&lt;/p&gt;

&lt;p&gt;In that case, taking the the hard path might be not the right choice. As we have time constraint and might lose opportunity if we take too long to learn. It would be more efficient to utilize AI to take care about our known unknowns on a real case.&lt;/p&gt;

&lt;p&gt;“So it would be better to just let AI handle the known unknowns and we just focus on what we could?”&lt;/p&gt;

&lt;p&gt;I consider to say no. It’s correct that AI could be used to assist us handle lot of things so we could just focus on the things that matter most. But the keyword is to ‘assist’, not to ‘replace’.  In terms of learning, let AI brings all things to the chat room means you are not studying, you just vibe studying while AI do studying. Just to make it clear, in my POV, study or learn isn’t just about getting descriptive information. It’s about shaping idea, connecting the dots, reasoning, and more.&lt;/p&gt;

&lt;p&gt;Okay, I don’t want this blog going out of scope so you can think about ‘what is learning’ later. But the point is, have some new descriptive information from AI might not considered as learning. However, if you brainstorm with AI, develop your own ideas, challenge the AI's responses, and implement the new knowledge in your own way, then I would say that is learning!&lt;/p&gt;

&lt;p&gt;Back to my context, in case of my learning experience, I try to utilize AI to brainstorm and giving me a clear context about the new subject and it’s relation with my expertise. Along the way, I try to probe AI to guide me further to the subject I wanna learn.&lt;/p&gt;

&lt;p&gt;To optimize my learning experience, Instead of start from the bottom (fundamental) and go up stairs (implementation), I tried to do it top down. Means I start from the real case implementation, then iterate to learn deeper by hands on and extra curiosity to ask AI about more fundamental concepts. I don’t think it would match for everyone. But as I already have a professional experience and I love to learn by doing, this approach while utilize AI could escalate my learning process.&lt;/p&gt;

&lt;p&gt;Let me give an example to demonstrate my approach:&lt;/p&gt;

&lt;p&gt;I’m a Software Engineer who focused on Backend and I’m curious to learn about generative AI. I tried to got some context about it and found about RAG (Retrieval Augmented Generation). It’s interesting to me because it has intersection with my current expertise and it’s possible to create a project which implement RAG as part of my learning by doing.&lt;/p&gt;

&lt;p&gt;Initially, I still need to read some sufficient context about generative AI, LLM, RAG, etc. After I have sufficient information to relate it with my expertise (from unknown unknowns to known unknowns), I start my first RAG project. I setup the project as usual. When it comes to the specific RAG parts, I took more time. Instead of just asking the AI for the implementation, I probed it for the 'why' and the 'how’. This led me to become more curious about deeper concepts and fundamentals, comparison of different implementation methods, other subjects to cover more advance project, and so on.&lt;/p&gt;

&lt;p&gt;By using that approach, my learning process became more efficient while still maintain the effectiveness aspect. Yeah, it’s not as effective as taking the hard path. But back to the premise, it’s more than enough if the purpose is to just have sufficient context of subject related to our expertise.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>softwareengineering</category>
      <category>rag</category>
    </item>
    <item>
      <title>Hexagonal Architecture in A Nutshell</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Sun, 01 Jun 2025 08:40:12 +0000</pubDate>
      <link>https://dev.to/muhammadazis/hexagonal-architecture-in-a-nutshell-22bd</link>
      <guid>https://dev.to/muhammadazis/hexagonal-architecture-in-a-nutshell-22bd</guid>
      <description>&lt;p&gt;Over the last few weeks, I've seen many people posting about &lt;strong&gt;Hexagonal Architecture&lt;/strong&gt;, which sparked my curiosity. I decided to read up on it and even consulted AI to understand it better. Here's a summary of what I've learned!&lt;/p&gt;

&lt;p&gt;Hexagonal Architecture, also known as &lt;strong&gt;Ports and Adapters Architecture&lt;/strong&gt;, has a primary goal: to isolate the main business logic (the "inside" or "core") from external concerns like databases, user interfaces, or third-party services (the "outside"). This concept might sound familiar if you know about the principle of separation of concerns. Indeed, the aim is to decouple the core logic from these external dependencies.&lt;/p&gt;

&lt;p&gt;So, how does the outside logic communicate with the inside logic? The answer lies in its other name: &lt;strong&gt;Ports and Adapters&lt;/strong&gt;. The inside logic provides &lt;strong&gt;ports&lt;/strong&gt;, which are essentially interfaces. These interfaces are then implemented by &lt;strong&gt;adapters&lt;/strong&gt; in the outside logic. Let’s discuss ports and adapters in more detail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Ports?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine your laptop is the inside (core) logic, and it has several ports (like USB, HDMI, etc.). Your laptop itself doesn't know what specific devices will be plugged into these ports—it could be an external mouse, a keyboard, a monitor, or something else. However, your laptop provides a set of rules or protocols for these ports. Whatever you plug in must follow these protocols to communicate correctly.&lt;/p&gt;

&lt;p&gt;In software terms, a port is like an interface defined by the core logic. This interface acts as a contract, ensuring that any external component (adapter) interacting with the core through this port adheres to the defined methods and data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Adapters?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As their name suggests, &lt;strong&gt;adapters&lt;/strong&gt; are like translators or connectors. They are the components in the outside logic that implement the ports (interfaces) provided by the core. This allows external systems or components, which might have different technologies or APIs, to communicate with the core logic in a standardized way.&lt;/p&gt;

&lt;p&gt;There are two main types of adapters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Primary Adapters (Driving Adapters)&lt;/strong&gt;: These adapters drive the application. They are the ones that initiate interaction with the core logic. Think of a user interface, a REST API controller, or automated tests. They take user input or external requests and send commands to the application's core through its ports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secondary Adapters (Driven Adapters)&lt;/strong&gt;: These adapters are driven by the application. The core logic uses these adapters to interact with external systems or tools, such as databases, message queues, or third-party APIs. The core defines a port (an interface like &lt;code&gt;SaveUserRepository&lt;/code&gt;), and the secondary adapter (e.g., &lt;code&gt;PostgresUserRepositoryAdapter&lt;/code&gt;) implements this interface to perform the actual saving.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can think of these as inbound (primary) and outbound (secondary) interactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Revisiting the Laptop Analogy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's use the laptop analogy again. Imagine you open a note-taking application on your laptop.&lt;/p&gt;

&lt;p&gt;Your 'inside' (the application's core logic) has a protocol (a &lt;strong&gt;port&lt;/strong&gt;) for actions like "type a sentence" or "move cursor."&lt;br&gt;
Now, you can plug in an external keyboard or mouse. These physical tools are like &lt;strong&gt;primary adapters&lt;/strong&gt;. As long as they "implement" the laptop's input protocols (e.g., USB HID standards), you can use them to type and move the cursor. The keyboard sends signals &lt;em&gt;to&lt;/em&gt; the laptop's core.&lt;/p&gt;

&lt;p&gt;After you finish typing your note, you want to save it. Your 'inside' (the application's core logic) also has a protocol (another &lt;strong&gt;port&lt;/strong&gt;) for "save data."&lt;/p&gt;

&lt;p&gt;This saving operation can then be handled by a &lt;strong&gt;secondary adapter&lt;/strong&gt;. For instance, you could plug in an external HDD or SSD to save the file locally, or the application might use an adapter to upload it to cloud storage. In this case, the laptop's core &lt;em&gt;initiates&lt;/em&gt; the action of saving &lt;em&gt;through&lt;/em&gt; the adapter to an external system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Makes It Great?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As mentioned earlier, the great thing about this architecture is that we can maintain and modify multiple external components (adapters) without needing to alter the core business logic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Independence&lt;/strong&gt;: The core logic remains independent of external technologies or changes in those technologies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: New adapters can be added to support new databases, UI frameworks, or external services without touching the core.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testability&lt;/strong&gt;: The core business logic can be tested in isolation, without needing real databases or UIs, by using mock adapters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability&lt;/strong&gt;: It can help prevent major bugs originating from the main business logic from affecting unrelated parts and can make it easier to trace and monitor issues by localizing them to specific adapters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;When to Be Cautious&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Despite these benefits, there's no one-size-fits-all solution in software architecture.&lt;/p&gt;

&lt;p&gt;Hexagonal Architecture might be too complicated for straightforward and simple systems. Some applications have simple enough functionality that it would be faster to develop them using a more traditional layered architecture rather than strictly separating the core logic from all external concerns.&lt;/p&gt;

&lt;p&gt;This architecture tends to be more suitable for systems with significant or complex domain logic that has unique calculations, rules, or methods that you want to protect and evolve independently of infrastructure concerns.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>designpatterns</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your app is too slow? What should you do?</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Mon, 31 Mar 2025 15:43:51 +0000</pubDate>
      <link>https://dev.to/muhammadazis/your-app-is-too-slow-what-should-you-do-10fm</link>
      <guid>https://dev.to/muhammadazis/your-app-is-too-slow-what-should-you-do-10fm</guid>
      <description>&lt;p&gt;In our day-to-day lives as Software Engineers, the question in the title might sound familiar. As we strive to deliver numerous features/products within tight deadlines, we sometimes leave things unoptimized, which impacts our app's loading time. So, what should we do to address this situation?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Identify the slowest API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We can use monitoring tools to help us identify the most frequently accessed APIs. Some monitoring tools can even trace which queries contribute the most to our response time. With this data, we can analyze what's causing our app to be slow and prioritize the issues we need to solve first. We should check the APIs with the slowest average response time and then trace any queries that might be called repeatedly or have long response times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimize queries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Try to optimize query response time by restructuring the query logic or checking index effectiveness. We can analyze this by running &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; to see a detailed breakdown of how the database processes our query. From the &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; output, we can redefine our query structure, such as filter arrangement, join logic, index usage, etc. If using PostgreSQL, comparing sequence scans and index scans can be done using &lt;code&gt;pg_stat_user_tables&lt;/code&gt; and &lt;code&gt;pg_stat_user_indexes&lt;/code&gt;. Further information about query optimization will be covered in another post!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Optimize business logic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Try to identify any logic that potentially causes performance issues. Common culprits include the N+1 problem, redundant query calls, fetching unused data, calling external APIs within loops, inefficient caching strategies, and synchronous large processes. Further explanation of these common issues will also be covered in another post!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check client-side logic&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes, we don't need to fetch all the data at once before the screen initializes. Try to determine which data is needed before the screen initializes and which data can be fetched asynchronously after the user can interact with the main content. Also, there are client-side optimizations that can be performed, but I can't delve too deeply into this topic because I'm not an expert in client-side code.&lt;/p&gt;

&lt;p&gt;I believe there are many more things we can do to optimize our app that aren't mentioned in this article. But hopefully, it will be useful to some of us. Thanks for reading!&lt;/p&gt;

</description>
      <category>database</category>
      <category>programming</category>
      <category>learning</category>
      <category>performance</category>
    </item>
    <item>
      <title>Array, ArrayList, &amp; LinkedList</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Sat, 01 Mar 2025 15:44:06 +0000</pubDate>
      <link>https://dev.to/muhammadazis/array-arraylist-linkedlist-2k9</link>
      <guid>https://dev.to/muhammadazis/array-arraylist-linkedlist-2k9</guid>
      <description>&lt;p&gt;Have you ever wondered about the difference between Array, ArrayList, and LinkedList?&lt;/p&gt;

&lt;p&gt;Let’s answer that with a simple explanation!&lt;/p&gt;

&lt;p&gt;Imagine you and four of your friends want to book seats for a movie at the cinema. You need to choose the seat numbers you want to book.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhvow61l7ui9t130jqd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhvow61l7ui9t130jqd4.png" alt="Image description" width="800" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Array
&lt;/h2&gt;

&lt;p&gt;Your friends require you to find seats that are connected in a row. So, you need to check which 5 seats in a row are available. Oh, you find it! Seats A1 to A5 are still available and can be booked for 5 people in a row. So, you book the seats and get the tickets.&lt;/p&gt;

&lt;p&gt;Then, another one of your friends wants to join the movie. Since A6 is already taken, you need to rearrange the allocation to make sure the booked seats can accommodate 6 people in a row. So, you find B1 to B6.&lt;/p&gt;

&lt;p&gt;It’s a bit cumbersome to allocate the seats each time someone wants to join the movie. But the good side is that it’s easy to check who is the &lt;em&gt;n-th&lt;/em&gt; person. It’s easy because we know where the first person’s seat is, and we know they are all seated in order.&lt;/p&gt;

&lt;h2&gt;
  
  
  ArrayList
&lt;/h2&gt;

&lt;p&gt;Your friends require you to find seats that are connected in a row, and you know there are still some other friends who might want to join. So, instead of booking just 5 seats, you reserve 20 seats in a row. So, each time another person wants to join, as long as it doesn’t exceed 20, you don’t need to reallocate the seats.&lt;/p&gt;

&lt;p&gt;This can prevent excessive reallocation operations. But remember that the remaining seats might be unused and can’t be utilized by other people outside your group!&lt;/p&gt;

&lt;h2&gt;
  
  
  LinkedList
&lt;/h2&gt;

&lt;p&gt;Your friends don’t care if they are not all seated in a row, so you just pick up the available seats without worrying about allocating 5 or 10 seats together. To help them remember where their friends’ seats are, each person remembers the seat of the next friend. For example, you sit in A1, then you need to remember that the 2nd person sits in B2, and the 2nd person needs to remember the 3rd person’s seat, and so on.&lt;/p&gt;

&lt;p&gt;This makes the process easier if someone wants to join, since you don’t need to worry about reallocation. But, it will be difficult if we want to know where the last seat is. Since we need to ask each person starting from the first person.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tldr;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data must be allocated in contiguous memory addresses.&lt;/li&gt;
&lt;li&gt;Fixed size; requires reallocation if the next address after the last index is occupied.&lt;/li&gt;
&lt;li&gt;Fast access to the &lt;em&gt;n-th&lt;/em&gt; index.&lt;/li&gt;
&lt;li&gt;Ideal for storing fixed-size data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ArrayList&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Essentially an Array with pre-allocated memory beyond the current data size.&lt;/li&gt;
&lt;li&gt;Reduces the need for frequent memory reallocation during data appending.&lt;/li&gt;
&lt;li&gt;Unused pre-allocated memory cannot be used by other data.&lt;/li&gt;
&lt;li&gt;Suitable for storing variable-size data when random access to specific indices is still needed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;LinkedList&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data can be stored in non-contiguous memory addresses, as each element stores the address of the next element.&lt;/li&gt;
&lt;li&gt;Efficient data appending.&lt;/li&gt;
&lt;li&gt;Slower access to the last index, as it requires traversing the list from the beginning.&lt;/li&gt;
&lt;li&gt;Optimal for storing data that is primarily accessed sequentially.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>softwareengineering</category>
      <category>java</category>
      <category>oop</category>
    </item>
    <item>
      <title>Pull Vs Rebase</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Sun, 23 Feb 2025 02:25:07 +0000</pubDate>
      <link>https://dev.to/muhammadazis/pull-vs-rebase-ikb</link>
      <guid>https://dev.to/muhammadazis/pull-vs-rebase-ikb</guid>
      <description>&lt;p&gt;Pull and rebase are two common Git commands used to manage changes from different branches. If both of them serve a similar purpose, why are they different? Let me share my insights! 💡&lt;/p&gt;

&lt;p&gt;First, let's look at the definitions of both commands. The git pull command is used to fetch and merge changes from another branch into your target branch. Meanwhile, the git rebase command is used to reapply your commits on top of the base branch's commits. From the definitions themselves, we can see that both have the same purpose (to synchronize changes between branches) but with different methods.&lt;/p&gt;

&lt;p&gt;In short, the pull method merges changes from another branch into your target branch by appending a single merge commit after your last commit. If there's a conflict during the merging process, it won't be merged, and you'll need to resolve it on your local branch first.&lt;/p&gt;

&lt;p&gt;On the other hand, the rebase method reapplies your commits onto the base branch's latest commit. If conflicts arise, you'll need to resolve the conflict for each commit that applies your changes. You'll need to use &lt;code&gt;git rebase --continue&lt;/code&gt; after resolving the conflicts in each individual commit.&lt;/p&gt;

&lt;p&gt;So, when should you use which? To be honest, I think it depends on your own preferences. But for me, I use pull to merge from the base branch to my feature branch for simple updates, especially if it's okay to add an additional merge commit. Then, I use rebase when I think it's important to keep the commit sequence in order, especially if the feature branch has complex changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qk0mft6vzue6kajpgwc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qk0mft6vzue6kajpgwc.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>git</category>
      <category>programming</category>
      <category>programmers</category>
    </item>
    <item>
      <title>The Better Approach To Learn New Things</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Sat, 08 Feb 2025 14:01:52 +0000</pubDate>
      <link>https://dev.to/muhammadazis/the-better-approach-to-learn-new-things-a92</link>
      <guid>https://dev.to/muhammadazis/the-better-approach-to-learn-new-things-a92</guid>
      <description>&lt;p&gt;I wrote this because lately, I have too much on my wishlist to learn. Maybe it's because I've seen so many kinds of opportunities, and I think I need to prepare for all of those opportunities at one time. But later on, I realized that with this approach, it feels like "the more we chase, the further away the goals."&lt;/p&gt;

&lt;p&gt;So I took a breath for a while and started questioning, "Why is my progress stuck even after wasting so much time learning all of this?" Then, finally, my brain came up with some conclusions. Let me elaborate on them one by one!&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn in Order
&lt;/h2&gt;

&lt;p&gt;The most essential thing that is frequently missed when learning something is checking the prerequisites! Before deciding to learn something, we have to list the related things. Then, we can categorize these things as mandatory to learn first, or things that can be learned along the way.&lt;/p&gt;

&lt;p&gt;In general, when we learn new material, it often has terms or logic that aren't explained in detail. This is because these terms or logic are assumed to have been learned beforehand. There are also some terms or logic that, while not explained in detail, don't directly block understanding of the material's essence. These can be learned along the way.&lt;/p&gt;

&lt;p&gt;Learning in order helps us understand the materials more easily because our brains don't need to process too much new information at once, as some of it has already been imprinted. Basically, it reduces the learning curve, making it appear less steep. Just imagine an elementary school student having to learn linear algebra before learning how to solve linear equations! It would be so frustrating!&lt;/p&gt;

&lt;h2&gt;
  
  
  Consider Capacity
&lt;/h2&gt;

&lt;p&gt;Our brains can learn and memorize many things, but they have a limited capacity for processing information at any given time. It's like the analogy of storage and memory. Our brain storage might be nearly unlimited, but the memory capacity for processing data at one time is limited.&lt;/p&gt;

&lt;p&gt;The more focused our brains are on learning a single thing, the more likely they are to achieve optimal results. If we learn too many things simultaneously, it overloads our brains, leading to suboptimal outcomes. Think back to your college days. It's easier to get A's in all subjects when taking only 12 credits rather than 24. This is because our brains have a limit to the amount of data they can process and learn before it's saved in our brain's storage.&lt;/p&gt;

&lt;p&gt;This point relates to the first point. If we learn something without first learning the prerequisites, our brains actually need more capacity to process and learn the information, as we also need to figure out the terms or logic mentioned in the material. So, it's more efficient if we already know the prerequisites, as our brains have already memorized some terms and logic, without needing to process them again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repetition
&lt;/h2&gt;

&lt;p&gt;After discussing storage and memory, we now come to the processor! As normal humans, we sometimes face things that we find too hard to understand. Even after learning the prerequisites and allocating dedicated capacity to learn it, it can still be confusing. This is perfectly normal; in fact, it's a good sign that we're learning!&lt;/p&gt;

&lt;p&gt;But how do we deal with this? I guess you already know the answer. Yes, learn it over and over again. Some things have another level of difficulty for our brains to process. This means our brains need more time to process the learning.&lt;/p&gt;

&lt;p&gt;Give your brain routine exercise to process the learning material. Don't try to cram too much exercise at once; just do enough exercise, but routinely. Our brains need rest to function optimally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prioritize What to Learn
&lt;/h2&gt;

&lt;p&gt;Since we already know that it's not easy to master new things, prioritize wisely what to learn. Because the time we spend is valuable. We might think that the more things we learn, the more opportunities will come. This is true, but if it's too much, the opportunity might be smaller, as we're learning just for the opportunity, not to master the skills.&lt;/p&gt;

&lt;p&gt;First, consider the workload. Make sure the list of things you want to learn is still manageable by your brain's capacity. For most people, 4-6 subjects in a term are considered optimal for effective learning. If there are more than 6 subjects you want to learn, wait for the first ones to be completed (or at least wait until your brain considers the earlier things easy).&lt;/p&gt;

&lt;p&gt;Try to prioritize by questioning the necessity of the things. Is it necessary to learn them? The most necessary things on my list are the skills that directly impact my day-to-day job. But I know sometimes my brain says that everything is important for my job. So, I try to prioritize by pre-knowledge or familiarity. Because the more familiar our brains are with the subjects, the easier and faster they can likely be learned.&lt;/p&gt;

&lt;p&gt;Last but not least, also consider which skills could lead you to the nearest good opportunities. This consideration requires prediction, and sometimes it's wrong. But it's better to have a 50% chance than to learn everything and have only a 10% chance!&lt;/p&gt;

</description>
      <category>learning</category>
      <category>study</category>
      <category>randomthought</category>
      <category>improvement</category>
    </item>
    <item>
      <title>3 Main Aspects To Boost Life &amp; Career</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Fri, 06 Sep 2024 11:09:05 +0000</pubDate>
      <link>https://dev.to/muhammadazis/3-main-aspects-to-boost-life-career-35h4</link>
      <guid>https://dev.to/muhammadazis/3-main-aspects-to-boost-life-career-35h4</guid>
      <description>&lt;p&gt;As humans, our nature is to constantly strive for a better life. We try various approaches in our daily routines, facing many trials and errors along the way. But what truly matters to us? To be honest, I don't have a definitive answer. Perhaps it's unique for each person. Here, I'll share my insights based on what I've learned so far.&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 Continuous Learnings
&lt;/h2&gt;

&lt;p&gt;When I think about improving my life, the first thing that comes to mind is learning. I believe we can't have a better life if we don't make ourselves better. So, I'm always looking for ways to learn and grow each day. It's not always easy, but I keep reminding myself that it's worth it. Every new thing I learn feels like a small step towards a better future. It's like slowly building a better version of myself, one lesson at a time.&lt;/p&gt;

&lt;p&gt;There are several approaches to learning something new. I'll share some of my approaches here. My first approach to trying to learn a new thing or find out what I should learn is by engaging with educational content. Whether it's an Instagram account sharing today's tech, tech professionals on Twitter sharing their thoughts, or someone on YouTube giving free courses. All of these may not help me learn something deeply, but in my case, they're great triggers to fill my daily life with educational content. We're more likely to be reminded to learn if we often see educational content, right?&lt;/p&gt;

&lt;p&gt;Reading is at the heart of my self-improvement journey. I've discovered that surrounding myself with interesting content keeps my mind curious and ready to learn. It started with subscribing to free newsletters about topics that fascinate me. From there, I found myself diving into articles and research papers, exploring ideas that catch my attention. To keep the momentum going, I always have an ebook on hand – thanks to Google Play Books, I can learn something new during my commute or before bed. It's amazing how these small reading habits add up, constantly feeding my brain with fresh knowledge and perspectives.&lt;/p&gt;

&lt;p&gt;Learning isn't just about absorbing information – it's about putting it into practice. That's why I make sure to balance my reading with hands-on exercises. To keep my mind sharp, I've made LeetCode problems part of my daily routine. Sure, I stick to the easy ones for now, but hey, we all start somewhere, right? The real fun begins when I take on mini projects. There's something incredibly satisfying about building something that uses the concepts I've just learned. It's like watching my knowledge come to life right before my eyes. These practical challenges not only reinforce what I've learned but also boost my confidence. After all, there's no better way to prove you understand something than by actually doing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  🫧 Broaden Connections
&lt;/h2&gt;

&lt;p&gt;Okay, let's say we have learned a lot of things and dug very deep, then what? Our value will stay hidden if we don't make it public. That's why we need to build a social presence and try to reach more people to make them aware of and consider our value. Not only that, being connected with many people can also enrich our knowledge. They could give us hidden insights, share advice, and provide many other benefits.&lt;/p&gt;

&lt;p&gt;Building a social presence doesn't have to be daunting – it's all about starting small and being genuine. The simplest way to begin is by engaging with content that resonates with you. See a post you like? Give it a thumbs up or a heart. Found something particularly insightful? Don't hesitate to share it with your network. As you grow more comfortable, try leaving thoughtful comments on posts related to topics you're familiar with or currently learning about. This could mean expressing agreement or disagreement (always respectfully, of course), adding your own insights to the discussion, or even offering constructive feedback when you have relevant expertise. Remember, the goal isn't to show off, but to contribute meaningfully to the conversation. Each interaction is a chance to learn, share, and connect. Before you know it, you'll find yourself part of a vibrant community of like-minded learners and thinkers.&lt;/p&gt;

&lt;p&gt;Once you've found your footing in the community, it's time to take the next exciting step: sharing your own thoughts. Think of it as giving back to the community that has enriched your learning journey. Don't worry about being an expert or writing groundbreaking analyses – the most valuable content often comes from personal experiences. Share your "aha!" moments, the challenges you've overcome, or even the questions you're still grappling with. Your learning journey, with all its ups and downs, could be exactly what someone else needs to read. Remember, every expert was once a beginner, and your perspective as a learner is uniquely valuable. As you start sharing, you'll likely find that articulating your thoughts helps solidify your own understanding. It's true what they say: the more you share, the more you learn. So go ahead, add your voice to the conversation – you never know who you might inspire or what new insights you might gain in return.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Set a Clear Goals
&lt;/h2&gt;

&lt;p&gt;It's natural to feel overwhelmed sometimes on this journey of constant learning. After years of absorbing new information and expanding my network globally, I hit a wall. I found myself wondering, "Why does the list of things to learn seem to grow endlessly?" It felt like I was running on a treadmill that kept speeding up. But then, I took a step back and realized something crucial: I needed to revisit my goals. In the excitement of learning, it's easy to lose sight of why we started in the first place. Taking the time to reflect and clarify my objectives was like finding a compass in a sea of information. It helped me understand which knowledge truly mattered for my personal and professional growth, and which could take a backseat. This clarity didn't make the world of knowledge any smaller, but it did make navigating it much more manageable and purposeful. Sometimes, the key to moving forward is pausing to ensure you're still on the right path.&lt;/p&gt;

&lt;p&gt;Having a clear vision and mission is like having a powerful magnifying glass for your learning journey. It helps you focus your energy on what truly matters, saving you from the exhaustion of trying to learn everything at once. Think of it as creating a personalized roadmap for your growth. With this clarity, you can prioritize which skills to develop and which connections to nurture. It's about working smarter, not harder. To make this process even more effective, consider employing tried-and-true mental models. The 80/20 principle, for instance, might help you identify the 20% of skills that will yield 80% of your desired results. First principles thinking can help you break down complex topics into fundamental truths, making learning more manageable. And the SMART method ensures your goals are Specific, Measurable, Achievable, Relevant, and Time-bound. By combining your clear vision with these powerful tools, you're not just learning – you're strategically investing in your future self. Remember, the goal isn't to know everything, but to know the right things that align with your personal and professional aspirations.&lt;/p&gt;

&lt;h2&gt;
  
  
  📙 Do It On Your Own Pace
&lt;/h2&gt;

&lt;p&gt;Take a deep breath and relax. Learning is a marathon, not a sprint, so there's no need to exhaust yourself trying to reach the finish line overnight. Remember to give yourself permission to rest and recharge. Your brain needs downtime to process all that amazing information you're absorbing. Think of your learning journey as a scenic road trip rather than a race. Enjoy the view, take detours when something interesting catches your eye, and don't forget to make pit stops. And here's a crucial tip: resist the urge to compare your chapter 1 to someone else's chapter 20. Everyone's learning path is unique, with its own twists, turns, and timing. Your pace is perfect for you. So, kick back, relax, and celebrate how far you've come. After all, the joy is in the journey, not just the destination. Keep growing, but do it at a rhythm that feels right for you. Your future self will thank you for the balanced approach!&lt;/p&gt;

</description>
      <category>career</category>
      <category>learning</category>
      <category>softwareengineering</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Learn Software Engineering for Beginner</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Fri, 16 Aug 2024 12:11:03 +0000</pubDate>
      <link>https://dev.to/muhammadazis/learn-software-engineering-for-beginner-2pj1</link>
      <guid>https://dev.to/muhammadazis/learn-software-engineering-for-beginner-2pj1</guid>
      <description>&lt;p&gt;Aspiring programmers often ask me which programming language they should learn first or which tech stack is easiest for beginners. To be honest, there's no one-size-fits-all answer to these questions, as everyone has different experiences, goals, and learning styles. Factors like your background, career aspirations, and available time can all influence the best choice for you. However, I'll share my perspective, which might align with your learning style and help you make an informed decision. Happy reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  🏴 Nothing Perfect
&lt;/h2&gt;

&lt;p&gt;Before we delve deeper, it's crucial to remember that there's no perfect tech stack or programming language. Each has its own set of trade-offs to consider. It's similar to choosing a knife for cooking – while a chef's knife is versatile for many tasks, a paring knife excels at precision work, and a bread knife is unmatched for slicing loaves. Just as different knives serve various purposes in the kitchen, different programming languages and tech stacks are designed to solve different types of problems.&lt;/p&gt;

&lt;p&gt;Learning approaches differ significantly from person to person. My journey, for instance, began with mathematical logic, which I later translated into pseudocode. When it came to actual programming languages, I started with C++ for competitive programming. Subsequently, I revisited programming fundamentals using Python, before advancing my skills with Java. This varied experience taught me an important lesson: there are numerous paths to becoming a proficient programmer.&lt;/p&gt;

&lt;p&gt;As we explore various options, consider: What type of "cutting" do you want to do in the world of programming? Are you aiming for algorithmic problem-solving, web development, data analysis, or something else? Keep these questions in mind as we delve into some popular choices for beginners.&lt;/p&gt;

&lt;h2&gt;
  
  
  👣 Learning Path
&lt;/h2&gt;

&lt;p&gt;Learning programming and software engineering is a journey that requires patience and dedication. There are no shortcuts; it takes time to progress through each step, from mastering the fundamentals to implementing complex systems. Even after gaining proficiency, all software engineers must continue learning throughout their careers. Technology evolves rapidly – languages like Python release new versions, frameworks like React update frequently, and entirely new tools emerge regularly. When you decide to enter the world of software engineering, you're embarking on an exciting adventure of constant growth. It's like tending a garden; you plant the seeds of knowledge, nurture them over time, and continually adapt to new conditions. This commitment to lifelong learning is challenging, but it's also what makes this field so rewarding and dynamic.&lt;/p&gt;

&lt;p&gt;Given the vast and deep scope of learning, I'll focus on the path from understanding fundamentals to basic implementation of software engineering. There are essentially three main steps: learning a basic programming language, exploring other software engineering tools, and understanding tech stacks. However, each of these steps contains numerous subtopics. Let's examine them one by one.&lt;/p&gt;

&lt;h3&gt;
  
  
  👩‍💻 Basic Programming Language
&lt;/h3&gt;

&lt;p&gt;The first step is to understand the basics. Familiarize yourself with one programming language and learn its fundamental logic and concepts. For beginners, I recommend &lt;strong&gt;Python&lt;/strong&gt; as your first programming language. Its syntax is quite simple and flexible. You'll likely enjoy working with basic programming logic such as assigning variables, branching, looping, and creating functions.&lt;/p&gt;

&lt;p&gt;If you've enjoyed working with the basics, you could then start learning one of the programming paradigms. The most familiar one is object-oriented programming (OOP). For this, I recommend starting with &lt;strong&gt;Java&lt;/strong&gt;. Familiarize yourself with basic OOP concepts such as classes, objects, inheritance, and polymorphism.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 Basic Markup Language and Styling
&lt;/h3&gt;

&lt;p&gt;This path can be learned either after mastering a basic programming language or in parallel with it. In this approach, you'll learn how to visualize content using Hypertext Markup Language (&lt;strong&gt;HTML&lt;/strong&gt;) and style it with &lt;strong&gt;CSS&lt;/strong&gt;. In my experience, it’s more effective to practice directly rather than just reading or watching tutorials. Trial and error will shape your understanding as you progress. Also, you might learn about &lt;strong&gt;JavaScript&lt;/strong&gt; usage to handle particular case on your practice.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗃 Basic Database
&lt;/h3&gt;

&lt;p&gt;This part is also essential to learn. At the very least, you should familiarize yourself with basic query language syntax. I suggest starting with &lt;strong&gt;PostgreSQL&lt;/strong&gt; or &lt;strong&gt;SQLite&lt;/strong&gt;. There's no need to dive too deeply at first; understanding the basic logic of storing, updating, and retrieving data is sufficient. It's also beneficial to have some knowledge of query optimization, but you can learn that as you go.&lt;/p&gt;

&lt;h3&gt;
  
  
  🕸 Basic Concepts of Web Programming
&lt;/h3&gt;

&lt;p&gt;Once you're familiar with the basics, you can try working on a mini project that requires a programming language, a markup language, and a database. However, before starting, it's important to understand the basic concepts of web programming. Even if your goal is to build mobile apps, it's better to learn web programming first. To simplify your learning experience, I suggest using Flask or Django, as these two frameworks are lightweight and easy to use for small-scale projects.&lt;/p&gt;

&lt;p&gt;You could start by crafting a simple to-do list app that runs on your local device. Begin by defining the database table, or you could use migrations from the framework’s ORM. Next, build the logic to store and retrieve to-do items. Finally, render your HTML using a library like Mako Template or a similar tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  ☁ Version Control
&lt;/h3&gt;

&lt;p&gt;By completing a few mini projects, you'll gain a better understanding of how everything works. You might even come up with ideas to enhance your previous projects to further improve your skills. However, you may feel hesitant to modify your code base because of the risk of introducing errors. This is why it's important to learn about version control.&lt;/p&gt;

&lt;p&gt;From this point on, you'll focus more on practical tasks. There will be some trial and error along the way. Next, you should learn about Git, a tool commonly used for version control. You can also try platforms like GitHub or GitLab to store your code in the cloud, both of which use Git.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙ Frameworks
&lt;/h3&gt;

&lt;p&gt;Finally, you'll explore modern frameworks and technologies that can help you build more advanced projects. In fact, you've already encountered some of these. When you used Flask, Django, or similar tools in your earlier mini projects, you were already working with frameworks. So, you should now be familiar with the concept of frameworks.&lt;/p&gt;

&lt;p&gt;For this part, I have to admit that I'm unsure which framework to recommend you learn first. My advice is to research the most common frameworks used by people around you. It’s also beneficial if you have someone who can answer your questions while you're learning about a specific framework.&lt;/p&gt;

&lt;p&gt;As you progress in your learning journey, it's crucial to understand the distinction between backend (BE) and frontend (FE) development, and how to use frameworks for specific purposes. Here's a suggested learning path:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with a simplified full-stack approach:
Initially, I recommended using Django with Mako Templates for HTML rendering to simplify your learning process.&lt;/li&gt;
&lt;li&gt;Transition to decoupled architecture:
Now, it's time to separate your BE and FE. For the backend:

&lt;ul&gt;
&lt;li&gt;Use Django Rest Framework to build a REST API&lt;/li&gt;
&lt;li&gt;This decouples your backend logic from the frontend presentation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Modernize your frontend:
Convert your frontend to a more modern framework like React or Vue.js. This allows for a more dynamic and responsive user interface.&lt;/li&gt;
&lt;li&gt;Integration:
Learn to integrate your decoupled BE (Django Rest Framework API) with your new FE (React/Vue.js).&lt;/li&gt;
&lt;li&gt;Expand your knowledge:
While working on these steps, familiarize yourself with:

&lt;ul&gt;
&lt;li&gt;API architectures&lt;/li&gt;
&lt;li&gt;HTTP protocols&lt;/li&gt;
&lt;li&gt;Other common concepts in software development&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This approach guides you from a simpler, monolithic structure to a more modern, decoupled architecture. It exposes you to a range of technologies and concepts crucial in today's software development landscape, preparing you for real-world scenarios.&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 Keep Learning and Stay Motivated
&lt;/h2&gt;

&lt;p&gt;As emphasized earlier, being a software engineer requires an unending eagerness to learn. To grow in this field, you should both deepen your expertise in specific areas and broaden your knowledge across various domains. After mastering the basics, I recommend the following progression:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Revisit and strengthen your understanding of data structures. This foundational knowledge is crucial for efficient problem-solving and algorithm design.&lt;/li&gt;
&lt;li&gt;Learn about design patterns. These tried-and-true solutions to common programming challenges will elevate the quality and maintainability of your code.&lt;/li&gt;
&lt;li&gt;Study system design. This will expand your scope in engineering, enabling you to architect robust, scalable solutions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Beyond these steps, there's a vast landscape of topics to explore - from cloud computing and DevOps to machine learning and cybersecurity. The key is to be patient and progress at your own pace. Remember, software engineering is a marathon, not a sprint.&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>My Segari Experience</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Fri, 09 Aug 2024 07:02:36 +0000</pubDate>
      <link>https://dev.to/muhammadazis/my-segari-experience-378p</link>
      <guid>https://dev.to/muhammadazis/my-segari-experience-378p</guid>
      <description>&lt;h2&gt;
  
  
  👋 Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyzcpuyjsarp5edls5r9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsyzcpuyjsarp5edls5r9.png" alt="LinkedIn DM" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was in my 7th semester of college when someone messaged me on LinkedIn and convinced me to apply to their company. At that time, I still had an internship contract with another company and needed to work on my thesis. Regarding the situation, I told him my concerns, especially about needing to focus on my thesis to earn my bachelor's degree. He quickly responded, saying I shouldn't worry about the thesis as he understood I was in my final year. He also mentioned that a few of their candidates were final-year students as well.&lt;/p&gt;

&lt;p&gt;Knowing this, I became interested in pursuing the opportunity. The hiring process took less than two weeks, consisting of two technical interviews and one HR call. They extended an offer in mid-January, inviting me to join immediately. As I wanted to prepare for my thesis first, I suggested starting at the beginning of March. They agreed with my proposal, and we signed the offer.&lt;/p&gt;

&lt;h2&gt;
  
  
  🏁 Kick Start The Journey
&lt;/h2&gt;

&lt;p&gt;On March 1st, I officially joined the company as a full-stack engineer. Initially, the engineering team wasn't divided into squads. We had daily meetings with a large number of engineers. However, after about a month, the team was finally separated into several squads, and I was assigned to the Conversion Squad.&lt;/p&gt;

&lt;p&gt;From that point on, I focused on customer-related products. Specifically, I regularly work on features aimed at increasing the conversion rate and average order value. We use Java Spring Boot, ReactJS, and Flutter as our tech stack.&lt;/p&gt;

&lt;p&gt;I still remember my first task on my third day at the company: changing the styling of payment options in the mobile apps. It was a very simple and straightforward task, but it marked my first time using Flutter. As time went on, the tasks became more challenging and complex, reflecting my growing understanding and improvement.&lt;/p&gt;

&lt;p&gt;Perhaps the most challenging problem I've solved was delivering a system to dynamically arrange product ordering across various sections. It was complex to ensure not only that the functionality worked well, but also that performance wasn't compromised. I'm pleased that in the end, this system was used not only for my features but also extended to various features developed by other engineers.&lt;/p&gt;

&lt;h2&gt;
  
  
  📈 A Glimpse of Segari
&lt;/h2&gt;

&lt;p&gt;From my perspective, each day at this company is a continuous learning experience. From the moment I started until now, I've encountered countless opportunities that I likely couldn't have found elsewhere. Over the past two and a half years, I've worked on projects ranging from simple, small-scale tasks to complex, core initiatives. I'm incredibly grateful for this learning journey and the growth it has provided. I'm not saying I've become an excellent engineer now, but I'm confident that I've improved significantly since my first day.&lt;/p&gt;

&lt;p&gt;What also encourages me to keep improving are the people around me. The other engineers, the leads, and teammates across departments are all very constructive and open-minded. We can discuss technical issues, seek career advice, and talk about various other topics.&lt;/p&gt;

&lt;p&gt;Despite some drawbacks the company has (I believe every place has its pros and cons), I still think this is a great place to learn. They trusted me to join with zero experience and have allowed me to grow alongside the company's growth.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⏰ Closing Statements
&lt;/h2&gt;

&lt;p&gt;I don't want to make this too long, so I'll wrap up here. I'd like to express my gratitude to all my colleagues who have worked and learned alongside me. Even though we're no longer at the same company, I hope we can stay connected in our personal lives. I've learned so much from all of you and am eager to continue learning. Here's to future success—and once again, thank you very much!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;— Muhammad Azis Husein&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>softwareengineering</category>
      <category>learning</category>
      <category>growing</category>
      <category>career</category>
    </item>
    <item>
      <title>Enabling AI to Boost Coding Productivity</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Wed, 17 Apr 2024 05:06:12 +0000</pubDate>
      <link>https://dev.to/muhammadazis/enabling-ai-to-boost-coding-productivity-4jai</link>
      <guid>https://dev.to/muhammadazis/enabling-ai-to-boost-coding-productivity-4jai</guid>
      <description>&lt;p&gt;In the artificial intelligence (AI) era, nearly every sector of life could be assisted by a machine, including the software engineering sector. In the past, when encountering programming problems, we would often browse solutions on Stack Overflow or similar sources. With the advent of large language models (LLMs), the way we seek solutions has shifted. Engaging in discussions and brainstorming with AI would be the closest approach when encountering any problems, whether they're related to programming or otherwise.&lt;/p&gt;

&lt;p&gt;There may be pros and cons to using AI to assist with programming tasks. However, in this case, I would rather not discuss the pros and cons. It's your right to choose based on your own considerations. But here, I want to share a step by step guide to enabling and using AI to boost our productivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Ollama
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to Ollama download page &lt;a href="https://ollama.com/download/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download according to our operating system (for linux, we could try to fetch using &lt;code&gt;curl -fsSL https://ollama.com/install.sh | sh&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install it and wait until it's active&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F624sfxxhgw25oia2zgn5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F624sfxxhgw25oia2zgn5.png" alt="Ollama Starter Page" width="688" height="872"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NB: After it's activated, it might suggest that we pull the first model. We could skip this step if we want to pull another model. In my case, I don't use the suggested model. Instead, I pull another model.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Model
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;We could find any open sources models on Ollama library &lt;a href="https://ollama.com/library" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After we decide which models we want to install, just pull it on our terminal. Exmaple: &lt;code&gt;ollama pull dolphin-mistral:latest&lt;/code&gt; (I try to pull dolphin mistral model with the latest version) --  note: it might takes a bit long depends on our bandwidth&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Error: max retries exceeded: ...&lt;/code&gt; if the error like this appear, it means our connection was disconnected. Just try to pull it again, It will continue the last percentage instead of start from zero&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After succeed, try to run it with &lt;code&gt;ollama run dolphin-mistral&lt;/code&gt; (adjust the model name according the model we pull before)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At this time, we already could discuss with the AI model inside our terminal. Even when we go offline, it still could be accessed because it's already on our local machine. But, to optimize our productivity, let's make it connected to our IDE our code editor. In this case, Because I wanna connect it to JetBrains editor (IntelliJ, PyCharm, WebStorm), I'll use &lt;a href="https://github.com/continuedev/continue" rel="noopener noreferrer"&gt;&lt;em&gt;Continue&lt;/em&gt;&lt;/a&gt; plugin. As far as I know, it also could be integrate to VSCode. But you could use another plugin like &lt;a href="https://github.com/rjmacarthy/twinny" rel="noopener noreferrer"&gt;&lt;em&gt;Twinny&lt;/em&gt;&lt;/a&gt; or otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Plugin and Connect to IDE
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Follow the steps to download on the plugin pages (in my case: &lt;a href="https://github.com/continuedev/continue" rel="noopener noreferrer"&gt;&lt;em&gt;Continue&lt;/em&gt; Repo&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the IDE (I tried using IntelliJ)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;Settings&lt;/code&gt; and go to &lt;code&gt;Plugins&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find &lt;code&gt;Install plugin from disk&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose the file we download before&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wait it until installed then apply&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After we restart our IDE, the feature will appear on the right side bar (or somewhere else on different editor)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For the first time, the default model that used might be the free trial version of some LLMs (GPT, Claude, Mixtral, etc). To use the model that we had before, we could go to &lt;code&gt;config.json&lt;/code&gt; to add our model (click on plus &lt;code&gt;+&lt;/code&gt; button and find &lt;code&gt;Open Config&lt;/code&gt; on the models options)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add our model to the models list on the first index (also we could remove another models if we want)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"models"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Ollama Dolphin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"provider"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ollama"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dolphin-mistral:latest"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Save it and restart our IDE, then we could discuss with our model inside our IDE and even ask our model to modify our code&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Muhammad Azis Husein&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>coding</category>
      <category>productivity</category>
      <category>ai</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Few Ways to Optimize API Response Time</title>
      <dc:creator>Muhammad Azis Husein</dc:creator>
      <pubDate>Thu, 29 Feb 2024 01:30:31 +0000</pubDate>
      <link>https://dev.to/muhammadazis/few-ways-to-optimize-api-response-time-p3f</link>
      <guid>https://dev.to/muhammadazis/few-ways-to-optimize-api-response-time-p3f</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Over the past few months, I've encountered significant challenges in accelerating API response times. This journey began as our company expanded its data volume substantially. It became apparent that numerous legacy codes in our backend could benefit from optimization, not only to cut costs but also to enhance response times. Our objective revolves around streamlining query expenses and backend logic. After implementing these optimizations, I feel compelled to document the process. This serves the dual purpose of raising awareness among my colleagues and potentially eliciting fresh insights that may have eluded me during the optimization process. Dive into the content and glean any valuable insights it may offer!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Left Out Unnecessary Join Query
&lt;/h2&gt;

&lt;p&gt;Before delving into the first approach, it's crucial to prioritize optimizing indexing usage. Effective indexing plays a pivotal role in mitigating time complexity within our queries. However, it's imperative to exercise caution as indexing entails increased memory allocation. Therefore, meticulous management of indexing is paramount to ensure optimal performance.&lt;/p&gt;

&lt;p&gt;If we assume that indexing has already been optimized but queries still suffer from lengthy processing times, it's prudent to scrutinize our query structure. Complex logic, especially when it necessitates relationships between numerous tables, can significantly inflate the cost of join queries. Therefore, it's essential to examine the intricacies of our query logic and identify potential areas for simplification or optimization. Imagine we have a database like this (it maybe oversimplified):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodbfiidy0j1tjvv3qgkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodbfiidy0j1tjvv3qgkv.png" alt="DB Schema Example" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let say we need to get &lt;code&gt;persons&lt;/code&gt; data that have a detailing about their &lt;code&gt;pets&lt;/code&gt; and who is the &lt;code&gt;vet&lt;/code&gt;. Also, the data would be filtered only &lt;code&gt;persons&lt;/code&gt; that have a specific condition (just say it condition A). Then it need to be ordered by their (in example) distance to their company. Finally the data would serve as a pagination in case 40 item per page. From the case, we maybe think out about the query like this:&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;p&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;c&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="n"&gt;json_agg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;json_build_object&lt;/span&gt;&lt;span class="p"&gt;(...))&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;pets_owned&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;persons&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; 
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;companies&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;company_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; 
&lt;span class="k"&gt;LEFT&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;pets&lt;/span&gt; &lt;span class="n"&gt;pt&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pt&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="k"&gt;WHERE&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt; 
&lt;span class="k"&gt;OFFSET&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_size&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;page_number&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;ROWS&lt;/span&gt; 
&lt;span class="k"&gt;FETCH&lt;/span&gt; &lt;span class="k"&gt;NEXT&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_size&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;ROWS&lt;/span&gt; &lt;span class="k"&gt;ONLY&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As the dataset grows to millions of records or more, and our operational scope expands, we find ourselves needing to join numerous related tables and implement increasingly complex logic. At this stage, the cost of JOIN operations becomes exorbitant, often with a time complexity of O(n) for each JOIN statement (potentially lower if sequential scans are not employed). Notably, we frequently do not require the joined data for all rows, particularly since our typical practice involves fetching only 40 items per page.&lt;/p&gt;

&lt;p&gt;In addressing this scenario, we can selectively exclude JOIN queries that are not directly utilized in the main logic. For instance, consider a situation where we intend to join the pets table to access its data, but there's no immediate need to examine that data within our current logic. In such cases, we can omit the join to reduce complexity and subsequently retrieve the data through a separate query call when necessary. This approach enables us to circumvent the process of looping over a million records to perform joins before filtering. Instead, we conserve time by only iterating over the curated set of 40 records. It's important to note that certain relation tables cannot be omitted, particularly those crucial for main logics such as tables containing columns used for ordering or filtering.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Avoid N+1 Issue
&lt;/h2&gt;

&lt;p&gt;When handling complex data, there are instances where certain data needs to be queried subsequently. However, if we're not cautious, this can result in the N+1 problem. In essence, the N+1 problem arises from excessive round trips to the database for the same query logic.&lt;/p&gt;

&lt;p&gt;Let's revisit our previous scenario. Suppose we've successfully retrieved the queried data discussed earlier in our backend. However, as we require additional missing data, we need to make another query call. For instance, if we're coding in Java, the code might look like these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pagePersons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;personRepository&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findCuratedDataPagable&lt;/span&gt;&lt;span class="o"&gt;(...);&lt;/span&gt;
&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;PersonProjection&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;listPersons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pagePersons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getContent&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PersonProjection&lt;/span&gt; &lt;span class="n"&gt;personProjection&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;listPersons&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="n"&gt;person&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;Person&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="c1"&gt;//assign data from Projection to Object&lt;/span&gt;
    &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Pet&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;petRepository&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findAllPetByPersonId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPetList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pets&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="c1"&gt;//another logic until it could be returned as response&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="p"&gt;...&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;pets&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; 
&lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;maybe&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;another&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;logic&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;person_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;personId&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the provided sample, it's evident that each execution of this function necessitates approximately 40 round trips to our database. While this number may not seem significant initially, it can escalate considerably during peak server traffic. Moreover, if we have multiple additional datasets to retrieve, the issue becomes even more pronounced. Therefore, it would be advantageous to circumvent querying inside the loop to enhance efficiency.&lt;/p&gt;

&lt;p&gt;To optimize this process, we can employ techniques such as eager loading or batching queries to retrieve all necessary data in fewer round trips, reducing the strain on our database and improving overall performance. Additionally, caching frequently accessed data can further alleviate the burden on the database and mitigate the need for repetitive queries. These strategies ensure smoother operation, particularly during periods of heightened server activity.&lt;/p&gt;

&lt;p&gt;Can we leverage the lessons learned in Data Structures and Algorithms classes to greatly enhance efficiency in this context? Recognizing that the data being fetched are similar but for different person IDs, it's beneficial to attempt fetching it collectively prior to entering the loop. Subsequently, we can assign it iteratively within the loop. To execute this strategy, we employ memoization to store the fetched data in the appropriate relation, such as which pets are owned by which person. The code implementation might resemble the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;pagePersons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;personRepository&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findCuratedDataPagable&lt;/span&gt;&lt;span class="o"&gt;(...);&lt;/span&gt;
&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;PersonProjection&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;listPersons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pagePersons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getContent&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Long&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;personIds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;listPersons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;Person:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;                                    
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Collectors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toList&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Long&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Pet&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mappingPets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;petRepository&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findAllPetByPersonIds&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;personIds&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Collectors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;groupingBy&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;Pet:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;getPersonId&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PersonProjection&lt;/span&gt; &lt;span class="n"&gt;personProjection&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;listPersons&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="n"&gt;person&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;Person&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="c1"&gt;//assign data from Projection to Object&lt;/span&gt;
    &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setPetList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mappingPets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getOrDefault&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;personProjection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getId&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;ArrayList&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;gt;());&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="c1"&gt;//another logic until it could be returned as response&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="p"&gt;...&lt;/span&gt; 
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;pets&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; 
&lt;span class="p"&gt;...&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;maybe&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;another&lt;/span&gt; &lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;logic&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;person_id&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;personIds&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By reducing the number of database queries through collective data fetching and utilizing memoization for efficient access within the loop, we not only enhance performance but also alleviate strain on the database. For note, the process of converting List to Map only take O(n) and the process to get the value by key only take O(1).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Use Batching on Bulk Insert Massive Data
&lt;/h2&gt;

&lt;p&gt;In addition to data retrieval, we must also address the efficient storage of data in the database. While handling a single record is straightforward, dealing with massive datasets requires careful consideration of performance implications. Efficient storage mechanisms are essential to ensure optimal performance and scalability&lt;/p&gt;

&lt;p&gt;We can draw an analogy to illustrate this scenario. Let's envision the data we aim to store as parcels that require transportation from one location to another. When dealing with a single parcel, there's little need to strategize for efficient delivery. However, when faced with thousands of parcels, several factors come into play:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Time required for the courier to travel from the origin to the destination.&lt;/li&gt;
&lt;li&gt;Increasing the number of parcels may lead to heavier loads for the courier, potentially resulting in overweight issues.&lt;/li&gt;
&lt;li&gt;Conversely, reducing the number of parcels per trip might necessitate additional trips, increasing the overall delivery time.
Considering these factors, we must determine the optimal number of parcels the courier can carry during each trip to strike a balance between load weight, travel time, and trip frequency. This optimization ensures efficient data storage and retrieval processes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptwxcyfklbwe1av1db7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptwxcyfklbwe1av1db7c.png" alt="illustration round trips" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Based on that illustration, it's evident that meticulous management of the data storage mechanism is paramount, particularly when dealing with bulk insertion of massive datasets. More or less, a sample approach that worth to try could be like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;startIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;batchSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;startIndex&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;listData&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;endIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;min&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;startIndex&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;batchSize&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;listData&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;                    
    &lt;span class="n"&gt;bulkInsert&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;listData&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;subList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;startIndex&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;endIndex&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
    &lt;span class="n"&gt;startIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;endIndex&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example provided, batch processing involves inserting data in groups, with each batch containing 1,000 records. Therefore, if we have 10,000 data points to store, the process will iterate 10 times to complete the round trips.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Ultimately, these approaches represent just a few strategies that I've explored. It's important to recognize that there may be numerous other methods and insights yet to be discovered. It's crucial to remain open-minded, understanding that every approach carries its own set of trade-offs, and every problem warrants a unique solution. I'm grateful for any additional insights or suggestions that may further enhance our approach to these issues.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Muhammad Azis Husein&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>softwareengineering</category>
      <category>programming</category>
      <category>query</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
