<?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>Forem: yograj Sikka</title>
    <description>The latest articles on Forem by yograj Sikka (@yograj_sikka_f82998baf58a).</description>
    <link>https://forem.com/yograj_sikka_f82998baf58a</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%2F3742553%2F2403fa82-bf27-48cf-bc2d-b50bcdce23bb.png</url>
      <title>Forem: yograj Sikka</title>
      <link>https://forem.com/yograj_sikka_f82998baf58a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yograj_sikka_f82998baf58a"/>
    <language>en</language>
    <item>
      <title>TCP and UDP with Proper Working</title>
      <dc:creator>yograj Sikka</dc:creator>
      <pubDate>Wed, 22 Apr 2026 11:21:32 +0000</pubDate>
      <link>https://forem.com/yograj_sikka_f82998baf58a/tcp-and-udp-with-proper-working-18n1</link>
      <guid>https://forem.com/yograj_sikka_f82998baf58a/tcp-and-udp-with-proper-working-18n1</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;In networking, data needs to be transferred from one device to another in a proper way. For this, different communication protocols are used. Two of the most important protocols at the transport layer are TCP and UDP.&lt;/p&gt;

&lt;p&gt;Both TCP and UDP are used to send data over a network, but they work in different ways depending on the requirement. Some applications need accurate and reliable data delivery, while others need fast communication with minimum delay. Because of this, both TCP and UDP are used in different situations.&lt;/p&gt;

&lt;p&gt;What is TCP&lt;/p&gt;

&lt;p&gt;TCP, which stands for Transmission Control Protocol, is a communication protocol used when data needs to be delivered reliably and in the correct order. It ensures that the data sent from one system reaches the other system without any loss or error.&lt;/p&gt;

&lt;p&gt;Before sending any data, TCP establishes a connection between the sender and the receiver. This makes sure that both sides are ready to communicate. Because of this connection-based approach, TCP is considered a reliable protocol.&lt;/p&gt;

&lt;p&gt;Working of TCP&lt;/p&gt;

&lt;p&gt;The working of TCP starts with a process called connection setup. In this process, the sender sends a request to the receiver to start communication. The receiver replies back, and then the sender confirms the response. After this, the connection is established successfully.&lt;/p&gt;

&lt;p&gt;Once the connection is set, TCP starts sending data in small packets. After each packet is received, the receiver sends an acknowledgment to confirm that the data has been received correctly. If any packet is lost, TCP detects it and sends it again.&lt;/p&gt;

&lt;p&gt;Another important feature of TCP is that it maintains the order of data. Even if packets arrive out of order, TCP rearranges them before delivering them to the application. Because of all these steps like connection setup, acknowledgments, and retransmission, TCP is slower but very reliable.&lt;/p&gt;

&lt;p&gt;What is UDP&lt;/p&gt;

&lt;p&gt;UDP, which stands for User Datagram Protocol, is another communication protocol used to send data over a network. Unlike TCP, UDP does not establish any connection before sending data. It simply sends the data directly to the receiver.&lt;/p&gt;

&lt;p&gt;UDP does not check whether the data is received or not, and it does not maintain the order of packets. Because of this, it is considered an unreliable protocol, but it is much faster than TCP.&lt;/p&gt;

&lt;p&gt;Working of UDP&lt;/p&gt;

&lt;p&gt;The working of UDP is simple and fast. The sender divides the data into packets and sends them continuously to the receiver without waiting for any response. There is no connection setup, no acknowledgment, and no retransmission of lost packets.&lt;/p&gt;

&lt;p&gt;Since UDP does not perform extra checks, it reduces delay and improves speed. However, if some packets are lost during transmission, they are not recovered. Also, the order of packets is not guaranteed.&lt;/p&gt;

&lt;p&gt;Even though UDP is not reliable, it is very useful in situations where speed is more important than accuracy.&lt;/p&gt;

&lt;p&gt;Difference Between TCP and UDP&lt;/p&gt;

&lt;p&gt;The main difference between TCP and UDP is how they handle data transmission. TCP focuses on reliability and correctness, while UDP focuses on speed and efficiency.&lt;/p&gt;

&lt;p&gt;TCP establishes a connection before sending data, while UDP does not. TCP ensures that all data is received correctly and in order, while UDP sends data without checking for errors or order. TCP is slower because of these extra steps, while UDP is faster because it skips them.&lt;/p&gt;

&lt;p&gt;In simple terms, TCP is careful and slow, while UDP is fast and less careful.&lt;/p&gt;

&lt;p&gt;Real Life Applications&lt;/p&gt;

&lt;p&gt;TCP is used in applications where accurate data delivery is important. This includes web browsing, file downloads, and emails. In these cases, even a small error in data can cause problems, so reliability is required.&lt;/p&gt;

&lt;p&gt;UDP is used in applications where speed is more important than perfect accuracy. This includes online gaming, video streaming, and voice calls. In these cases, small data loss is acceptable, but delay is not.&lt;/p&gt;

&lt;p&gt;Simple Way to Understand&lt;/p&gt;

&lt;p&gt;A simple way to understand the difference is to compare it with real life. TCP is like sending an important package where you need confirmation that it has been delivered. UDP is like sending a quick message without waiting for a reply.&lt;/p&gt;

&lt;p&gt;Both methods are useful, but they are used in different situations depending on the requirement.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;TCP and UDP are both important protocols in networking, but they serve different purposes. TCP ensures reliable and correct delivery of data, while UDP provides fast communication with less delay.&lt;/p&gt;

&lt;p&gt;Understanding how both protocols work helps in choosing the right method for data communication. In real-world applications, both TCP and UDP are widely used based on whether reliability or speed is more important.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>networking</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding the Four-Layer Backend Structure in Simple Terms</title>
      <dc:creator>yograj Sikka</dc:creator>
      <pubDate>Thu, 16 Apr 2026 16:07:08 +0000</pubDate>
      <link>https://forem.com/yograj_sikka_f82998baf58a/understanding-the-four-layer-backend-structure-in-simple-terms-607</link>
      <guid>https://forem.com/yograj_sikka_f82998baf58a/understanding-the-four-layer-backend-structure-in-simple-terms-607</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When we build a backend application, writing everything in one place can quickly become confusing and difficult to manage. As the project grows, it becomes harder to fix errors, add new features, or even understand the code.&lt;/p&gt;

&lt;p&gt;To solve this problem, developers divide the backend into different layers. One of the most common and useful structures is the 4-layer architecture. These layers are controller, service, repository, and database. Each layer has its own role, which helps keep the system clean and organized.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Controller Layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The controller layer is the first point where any request comes in. Whenever a user clicks a button, fills a form, or performs any action on the frontend, that request is sent to the controller.&lt;/p&gt;

&lt;p&gt;The controller does not do heavy work. Its main job is to receive the request, understand what the user is asking for, and pass that request to the service layer. Once the result comes back, the controller sends the response to the user.&lt;/p&gt;

&lt;p&gt;You can think of the controller like a receptionist. It listens to what the user wants and sends that request to the correct department without doing the actual work.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Service Layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The service layer is the most important part of the backend because it contains the main logic of the application.&lt;/p&gt;

&lt;p&gt;After receiving the request from the controller, the service layer decides what needs to be done. It can perform tasks like checking if the user details are correct, calculating values, applying rules, or preparing data before saving it.&lt;/p&gt;

&lt;p&gt;For example, if a user places an order, the service layer can check if the product is available, calculate the total price, and validate the order details.&lt;/p&gt;

&lt;p&gt;In simple terms, this layer acts like the brain of the system where all the important decisions are made.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Repository Layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repository layer is responsible for handling all the interactions with the database.&lt;/p&gt;

&lt;p&gt;Instead of writing database-related code in different places, everything related to storing and retrieving data is handled here. This includes saving new data, fetching existing data, updating records, or deleting them.&lt;/p&gt;

&lt;p&gt;This layer works as a bridge between the service layer and the database. It makes sure that the service layer does not directly deal with database queries, which keeps the code clean and easy to manage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Database Layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The database is the place where all the data is stored permanently.&lt;/p&gt;

&lt;p&gt;It contains important information like user accounts, product details, orders, and other records. The database itself does not communicate directly with the controller or service layer. All communication happens through the repository layer.&lt;/p&gt;

&lt;p&gt;This helps maintain proper structure and also improves security and control over data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How All Layers Work Together&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All these layers work step by step in a flow.&lt;/p&gt;

&lt;p&gt;First, the user sends a request from the frontend. The controller receives that request and passes it to the service layer. The service layer processes the logic and then asks the repository layer to interact with the database if needed. The database returns the required data, and the response travels back through the same layers to the user.&lt;/p&gt;

&lt;p&gt;In simple form, the flow looks like this:&lt;br&gt;
User → Controller → Service → Repository → Database → Response back to user&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why This Structure is Useful&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using this layered structure has many benefits. It keeps the code clean and organized, which makes it easier to understand. It also helps in fixing bugs quickly because each layer has a specific responsibility.&lt;/p&gt;

&lt;p&gt;It becomes easier to add new features without breaking existing functionality. Also, when multiple developers are working on the same project, this structure helps everyone work smoothly without confusion.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The 4-layer backend structure is a simple and effective way to build applications. By dividing the system into controller, service, repository, and database layers, developers can manage their code better and build scalable systems.&lt;/p&gt;

&lt;p&gt;Even though it might feel confusing at the beginning, once you understand how each layer works, it becomes much easier to design and develop backend applications in a proper way.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
