<?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: Nishant Keshav</title>
    <description>The latest articles on DEV Community by Nishant Keshav (@nishant_keshav).</description>
    <link>https://dev.to/nishant_keshav</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%2F1547655%2F8a3fec63-c312-46ad-9871-45c659ca51d6.jpg</url>
      <title>DEV Community: Nishant Keshav</title>
      <link>https://dev.to/nishant_keshav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nishant_keshav"/>
    <language>en</language>
    <item>
      <title>Server Driven UI</title>
      <dc:creator>Nishant Keshav</dc:creator>
      <pubDate>Mon, 07 Jul 2025 07:03:56 +0000</pubDate>
      <link>https://dev.to/nishant_keshav/server-driven-ui-3l0p</link>
      <guid>https://dev.to/nishant_keshav/server-driven-ui-3l0p</guid>
      <description>&lt;p&gt;So, Everyone must be wondering what a server-driven UI is (no, it is not CSS files stored on the Backend Part). Let me explain in detail below.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;What is Server Driven UI (SDUI)?&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In traditional &lt;strong&gt;&lt;em&gt;software Development&lt;/em&gt;&lt;/strong&gt;, whenever we want to push new design or business logic changes in the frontend part, we need to rewrite the whole design as if we want to change the UI/UX of a Payment app, so we need to change the whole structure of the design and business logic. That means rolling out a new App Update and hoping users to update the app(which usually does not happen).&lt;/p&gt;

&lt;p&gt;This is where &lt;strong&gt;&lt;em&gt;SDUI (Server Driven UI)&lt;/em&gt;&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;Instead of &lt;strong&gt;&lt;em&gt;hardcoding UI elements&lt;/em&gt;&lt;/strong&gt; in the mobile/frontend app, you &lt;strong&gt;&lt;em&gt;send UI definitions from the backend&lt;/em&gt;&lt;/strong&gt; (server) in &lt;strong&gt;&lt;em&gt;JSON&lt;/em&gt;&lt;/strong&gt;or other formats.&lt;/p&gt;

&lt;p&gt;The client app becomes a renderer that reads the &lt;strong&gt;&lt;em&gt;UI structure sent by the server&lt;/em&gt;&lt;/strong&gt; and displays it accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's go into a detailed explanation:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Without SDUI (Traditional writing way)&lt;br&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%2F0ra8t7qld2myxjaty2sr.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%2F0ra8t7qld2myxjaty2sr.png" alt="Image description" width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With SDUI (Server-Based)&lt;br&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%2Fcitu3e0mdwgq65metg1s.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%2Fcitu3e0mdwgq65metg1s.png" alt="Image description" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Server-driven UI (SDUI)&lt;/em&gt;&lt;/strong&gt; is an emerging technique used by companies like &lt;em&gt;&lt;strong&gt;Airbnb&lt;/strong&gt;&lt;/em&gt; and &lt;strong&gt;&lt;em&gt;Lyft&lt;/em&gt;&lt;/strong&gt; that leverage the &lt;strong&gt;&lt;em&gt;server to build the user interfaces&lt;/em&gt;&lt;/strong&gt; of their mobile apps. This opens up new possibilities and addresses some fundamental challenges with native mobile app development. Before we look at how server-driven UI works, let's take a look at how mobile apps are developed today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's see some examples.
&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%2Fgj9blsvvs4yi5a1f6nid.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%2Fgj9blsvvs4yi5a1f6nid.png" alt="Image description" width="656" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the listing screen is displayed to the user, the app fetches a list of products to display from a server. The list of products, the data, is combined with the UI built by the developer and transformed into a list view.&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%2Fnl8xjdx8wxa63fmszp23.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%2Fnl8xjdx8wxa63fmszp23.png" alt="Image description" width="300" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Release Cycle
&lt;/h2&gt;

&lt;p&gt;Now let's imagine after launching our listing screen, we decide to add the product's star rating to each row and give a special treatment to sale items.&lt;br&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%2F120khiytczwmv4oe90cd.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%2F120khiytczwmv4oe90cd.png" alt="Image description" width="267" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logic that determines how the data is presented for each row is built into the app, so in order to make these changes to the user interface, we need to run through a full release cycle. The process looks something like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Developers write code to make the desired UI changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The UI changes are reviewed by testers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A new version of the app is submitted to the App Store/Play Store.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Apple/Google reviews and approves it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Users update to the new version.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a typical app supporting &lt;strong&gt;&lt;em&gt;iOS&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Android&lt;/em&gt;&lt;/strong&gt;, the &lt;strong&gt;&lt;em&gt;release cycle must be done twice&lt;/em&gt;&lt;/strong&gt;, once for each platform, and generally, we will need different developers for each one. By the time these &lt;strong&gt;&lt;em&gt;changes have made it to our users&lt;/em&gt;&lt;/strong&gt;’ devices, we're already looking to make &lt;strong&gt;&lt;em&gt;additional changes&lt;/em&gt;&lt;/strong&gt;. In this case, we now want to display featured products at the top of the list in a horizontal scroll container.&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%2Fge2m6cxz687krpj6jx45.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%2Fge2m6cxz687krpj6jx45.png" alt="Image description" width="252" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, we have to go through the &lt;strong&gt;&lt;em&gt;full release cycle&lt;/em&gt;&lt;/strong&gt; to make these changes. Between development, testing and waiting for approval on both platforms, each of these simple &lt;strong&gt;&lt;em&gt;changes takes weeks or even months&lt;/em&gt;&lt;/strong&gt; to make their way into the &lt;strong&gt;&lt;em&gt;App/Play Store&lt;/em&gt;&lt;/strong&gt;. And even after they've made it into the store, we still have to wait for our &lt;strong&gt;&lt;em&gt;users to update&lt;/em&gt;&lt;/strong&gt; to the &lt;strong&gt;&lt;em&gt;new version&lt;/em&gt;&lt;/strong&gt; of the app before they will see them.&lt;/p&gt;

&lt;p&gt;Each time we release a new version of our app, we have to wait for our users to update to it. Some will update right away, some will take their time, and some won't update at all. This creates a bad user experience.&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%2F3xzg6ini9a2mom95ztmx.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%2F3xzg6ini9a2mom95ztmx.png" alt="Image description" width="727" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So what's the solution?
&lt;/h2&gt;

&lt;p&gt;Well, what we can do is that we can &lt;strong&gt;&lt;em&gt;write our Web/App designs&lt;/em&gt;&lt;/strong&gt; in such a way that they &lt;strong&gt;&lt;em&gt;render according to a JSON response&lt;/em&gt;&lt;/strong&gt; from the &lt;strong&gt;&lt;em&gt;server&lt;/em&gt;&lt;/strong&gt; and the designs are stored in the JSON format on the server.&lt;/p&gt;

&lt;p&gt;Instead of &lt;strong&gt;&lt;em&gt;hardcoding&lt;/em&gt;&lt;/strong&gt; our web or app &lt;strong&gt;&lt;em&gt;designs&lt;/em&gt;&lt;/strong&gt; directly &lt;strong&gt;&lt;em&gt;into the&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;client&lt;/em&gt;&lt;/strong&gt;, we can &lt;strong&gt;&lt;em&gt;build the UI&lt;/em&gt;&lt;/strong&gt; to render &lt;strong&gt;&lt;em&gt;dynamically&lt;/em&gt;&lt;/strong&gt; based on &lt;strong&gt;&lt;em&gt;JSON responses&lt;/em&gt;&lt;/strong&gt; from the &lt;strong&gt;&lt;em&gt;server&lt;/em&gt;&lt;/strong&gt;. These &lt;strong&gt;&lt;em&gt;JSON responses&lt;/em&gt;&lt;/strong&gt; define the &lt;strong&gt;&lt;em&gt;structure,&lt;/em&gt;&lt;/strong&gt; styling, and logic of the UI, such as buttons, input fields, labels, and layout containers.&lt;/p&gt;

&lt;p&gt;The server stores these UI definitions in a structured format (like JSON), and the frontend app simply parses and renders the layout accordingly.&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%2Fm9os3sc1qzuuj9rnoxiz.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%2Fm9os3sc1qzuuj9rnoxiz.png" alt="Image description" width="800" height="113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This approach gives us full control over the UI from the server, allowing us to:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Push &lt;strong&gt;&lt;em&gt;UI updates&lt;/em&gt;&lt;/strong&gt; without &lt;strong&gt;&lt;em&gt;forcing users&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;update&lt;/em&gt;&lt;/strong&gt; their app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Personalise or &lt;strong&gt;&lt;em&gt;customise UI&lt;/em&gt;&lt;/strong&gt; per &lt;strong&gt;&lt;em&gt;user&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Experiment&lt;/em&gt;&lt;/strong&gt; with new &lt;strong&gt;&lt;em&gt;flows&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;features&lt;/em&gt;&lt;/strong&gt; quickly (A/B testing).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Unify UI logic&lt;/em&gt;&lt;/strong&gt; across &lt;strong&gt;&lt;em&gt;platforms&lt;/em&gt;&lt;/strong&gt; (Android, iOS, Web) using a &lt;strong&gt;&lt;em&gt;shared schema&lt;/em&gt;&lt;/strong&gt;.&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%2F1p5ky2i8m4wdfusgmdxa.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%2F1p5ky2i8m4wdfusgmdxa.png" alt="Image description" width="636" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Instead of fetching a list of products, the app fetches a list view, which contains a set of row views, each of which contains text and image views with information about spacing, alignment, colour and text.&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%2F1ehlyjv67il87oa2728g.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%2F1ehlyjv67il87oa2728g.png" alt="Image description" width="800" height="825"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The app renders the response from the server, and the result is identical to the version using traditional development techniques.&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%2F92r9bfei4uwkjimez47b.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%2F92r9bfei4uwkjimez47b.png" alt="Image description" width="743" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The updates that previously took weeks or months can now be made in days or hours. The changes are made to both the iOS and Android apps consistently, and all users see the same version at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges with Traditional Native App Releases :
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Slower Update Cycle&lt;/em&gt;&lt;/strong&gt; : The time-consuming app release process causes delays in critical updates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Slower User Adoption&lt;/em&gt;&lt;/strong&gt; : Users need to download and install updates, leading to slower adoption rates for new features and bug fixes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Platform-Specific Code&lt;/em&gt;&lt;/strong&gt;: Developers must duplicate effort on different platforms(iOS, Android) and maintain separate codebases, doubling the workload. Ensuring a consistent user experience across platforms can also be challenging.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Slow Feedback Loop&lt;/em&gt;&lt;/strong&gt;: Gathering user feedback and making quick iterations is harder due to the slower update cycle and user adoption.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Advantages of Server-Driven UI over Traditional App Development:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Dynamic Updates&lt;/em&gt;&lt;/strong&gt;: Allows for dynamic updates without needing users to download new app versions, eliminating delays associated with app updates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Uniformity&lt;/em&gt;&lt;/strong&gt;: Ensures consistent user experience across platforms.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Faster Feedback Loop&lt;/em&gt;&lt;/strong&gt;: Empowers developers to stay agile, respond faster to user needs, and deliver the best user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Rapid Feature Rollouts&lt;/em&gt;&lt;/strong&gt;: Features can be rolled out, tested, and iterated quickly from the server side without waiting for app store approvals.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantages of SDUI compared to traditional UI techniques
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Increased Complexity on Backend&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The backend must now handle UI logic, layout generation, and dynamic rendering rules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It turns your backend into not just a data provider but also a UI controller.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Result: Tight coupling between frontend and backend logic, which can get messy fast.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Slower Development for Rich UI&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SDUI works great for static or form-based UIs (e.g., settings screens), but:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Building highly interactive, animated, or custom components becomes harder or even impossible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You lose the benefits of frontend frameworks' powerful component systems (like React/Vue).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;More Difficult Debugging&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Debugging becomes harder when UI bugs originate from a malformed JSON or incorrect server configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logs may not always clearly show the root issue, like in traditional UIs where you have direct access to the component tree.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Performance Overhead&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;More round-trips: First, the app asks for the UI definition, then fetches data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increased payload size: UI JSON + data = heavier initial loads if not optimised.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Might need aggressive caching and fallback strategies.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Loss of IDE/Tooling Benefits&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;With traditional UI development, you get type safety, code completion, previews, and powerful debuggers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SDUI JSON-driven rendering loses these advantages unless you build custom tooling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Steeper Learning Curve for Teams&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend teams need to understand UI structures and rendering logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Design Limitations&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pixel-perfect design or complex UI behaviours (e.g., drag-and-drop, advanced charts) are hard to achieve via SDUI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Often, we need to fall back to a hardcoded/native UI for those.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;SDUI&lt;/em&gt;&lt;/strong&gt; trades &lt;strong&gt;&lt;em&gt;flexibility&lt;/em&gt;&lt;/strong&gt; at &lt;strong&gt;&lt;em&gt;runtime&lt;/em&gt;&lt;/strong&gt; for complexity in codebase, &lt;strong&gt;&lt;em&gt;performance&lt;/em&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;em&gt;development experience&lt;/em&gt;&lt;/strong&gt;. It's great for use cases like CMS-driven pages, forms, and onboarding flows — but &lt;strong&gt;&lt;em&gt;bad&lt;/em&gt;&lt;/strong&gt; for &lt;strong&gt;&lt;em&gt;animations&lt;/em&gt;&lt;/strong&gt;, rich interactivity, and rapid frontend iteration.&lt;/p&gt;

&lt;p&gt;MY VIEW : &lt;strong&gt;&lt;em&gt;USE AT YOUR OWN RISK&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can read here &lt;a href="https://tech.phonepe.com/introducing-liquidui-phonepes-server-driven-ui-framework/" rel="noopener noreferrer"&gt;&lt;strong&gt;PART-1&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://tech.phonepe.com/liquidui-phonepes-server-driven-ui-framework-part-2/" rel="noopener noreferrer"&gt;&lt;strong&gt;PART-2&lt;/strong&gt;&lt;/a&gt; how &lt;strong&gt;PhonePe&lt;/strong&gt; integrated &lt;strong&gt;SDUI&lt;/strong&gt; in their Application(Their Implementation is Crazy 😍).&lt;/p&gt;

&lt;p&gt;There are Many organisations which use SDUI. I will list out the links below for your reference.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/airbnb-engineering/a-deep-dive-into-airbnbs-server-driven-ui-system-842244c5f5" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;AIRBNB&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://bytes.swiggy.com/a-deep-dive-into-dynamic-widget-swiggys-server-driven-ui-system-92cdc3b16ec6" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;SWIGGY&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Liked the content? Let’s connect on &lt;a href="https://www.linkedin.com/in/nishant-keshav7/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; — I post more stuff like this (and would love to see what you’re building too).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ui</category>
      <category>backend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>ORMs: The Good, The Bad, and The Ugly Performance</title>
      <dc:creator>Nishant Keshav</dc:creator>
      <pubDate>Tue, 24 Jun 2025 15:39:28 +0000</pubDate>
      <link>https://dev.to/nishant_keshav/orms-the-good-the-bad-and-the-ugly-performance-5fh6</link>
      <guid>https://dev.to/nishant_keshav/orms-the-good-the-bad-and-the-ugly-performance-5fh6</guid>
      <description>&lt;p&gt;Ever opened your code editor and thought, “Great, another day wrestling with SQL queries and database schemas”? You’re not alone. For centuries (give or take a couple of decades), developers have been banging their heads against the keyboard, translating their lovingly crafted objects into cryptic SQL statements.&lt;/p&gt;

&lt;p&gt;Enter the superhero you never knew you needed: &lt;strong&gt;ORM (Object-Relational Mapping)&lt;/strong&gt;. Imagine telling your database, “Hey, save this,” and—poof!—The ORM handles the nitty-gritty SQL complexity for you. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Think of ORM as your multilingual friend who effortlessly translates your instructions between you (the code) and the database.&lt;/strong&gt; No more lost-in-translation moments – thanks to ORM! Come on, let’s dive deeper into the world of ORM in this blog today.&lt;/p&gt;

&lt;p&gt;Let’s say you have this object with you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  rollNo: 7 
  name: "Nishant"
  sub: "JAVA"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, imagine a scenario where storing this object is as seamless as a magical process. Behind the scenes, all the required database operations happen automatically. No need for you to write the SQL queries – YES, this is possible!&lt;/p&gt;

&lt;p&gt;This is where ORM steps in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an ORM?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;An ORM is a tool that lets you work with a database using programming code instead of writing SQL directly&lt;/strong&gt;&lt;/em&gt;. You can perform CRUD operations (Create, Read, Update, Delete) by following the ORM's specific syntax to manage data in the database easily.&lt;/p&gt;

&lt;p&gt;So, let me take you through an example.&lt;/p&gt;

&lt;p&gt;Here's an example of SQL code that retrieves information about a particular user from a database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT id, name, email, country, phone_number FROM users WHERE id = 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above returns information about a user's name, email, country, and phone number from a table called users. Using the WHERE clause, we specified that the information should be from a user with an ID of 20.&lt;/p&gt;

&lt;p&gt;On the other hand, an ORM tool can do the same query as above with simpler methods. That is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;users.GetById(20)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the code above does the same as the SQL query. Note that every ORM tool is built differently, so the methods are never the same, but the general purpose is similar.&lt;/p&gt;

&lt;p&gt;Now, coming back to the Original Example &lt;/p&gt;

&lt;p&gt;For instance, if you have a student object with properties like student ID (rollNo), name, and subject (as given in the image above), you collect these values. All these things are available in the object format, in the variables format. Subsequently, to store this information in a database, you employ a SQL query.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;INSERT into student values (07, ‘Nishant’, ‘JAVA’);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, most of the people would execute the query given above to add the student details to the students' database.&lt;/p&gt;

&lt;p&gt;Every interaction with the database involves &lt;strong&gt;SQL queries&lt;/strong&gt;. Whether you're inserting data into a table, fetching information using a select query, or updating records with an update query, &lt;strong&gt;SQL is at the core of these operations. This means that as a developer, you need to have a good understanding of SQL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine you have some data in your program, like an object, and you want to save it to a database. Normally, you would write SQL queries to do this, which can be a bit tricky. But what &lt;strong&gt;if you didn’t have to write those SQL queries yourself?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead, you just tell the system, “&lt;strong&gt;Save this object&lt;/strong&gt;,” and it takes care of everything for you. Behind the scenes, the &lt;strong&gt;system automatically turns your object into the right SQL commands&lt;/strong&gt; and saves it in the database. &lt;strong&gt;You don’t see or write the SQL, but it’s still happening&lt;/strong&gt;(kind of magic, right?)&lt;/p&gt;

&lt;p&gt;Your DBMS only works with SQL queries, so you can't say there's no SQL. There is SQL, but you, as a programmer, are not directly writing it. However, you have tools/libraries that assist you in managing this process, ensuring you don't have to manually write the SQL queries.&lt;/p&gt;

&lt;p&gt;These techniques are called ORM techniques, which stand for Object Relational Mapping.&lt;/p&gt;

&lt;p&gt;You incorporate this technique between your framework and any programming language and your database.&lt;br&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%2Fe6uf9ejejffz0moabju0.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%2Fe6uf9ejejffz0moabju0.png" alt="Image description" width="800" height="207"&gt;&lt;/a&gt;&lt;br&gt;
Basically, &lt;strong&gt;you are actually talking to ORM&lt;/strong&gt;, and this will store the data in the database. Who is responsible for making the SQL queries? This ORM! You don't have to do anything.&lt;/p&gt;

&lt;p&gt;But is it possible? &lt;strong&gt;Can we just save the data in the database&lt;/strong&gt; by using the object? The answer is YES!.&lt;/p&gt;

&lt;p&gt;Let's consider how we create an object in JAVA.&lt;br&gt;
(If you are asking why Java, because I am a Java developer😏.)&lt;/p&gt;

&lt;p&gt;In Java, you require a class to create an object. This class serves as your design blueprint.&lt;/p&gt;

&lt;p&gt;Let's say if you talk about students, you will create only one student class, and you will have multiple objects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Student { 
    int rollNo;
    String name;
    String sub; 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Imagine you have a classroom with 20 students. For each student, you will have a distinct object. Each of these objects will have a unique roll number, a different name, and possibly a different or common subject of interest.&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%2F74xv2tqhnh2v46xamujr.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%2F74xv2tqhnh2v46xamujr.png" alt="Image description" width="151" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When considering creating tables in a database, think of it as having a box with multiple columns and rows.&lt;/p&gt;

&lt;p&gt;At the beginning of the application, you don't have any data; you just have the column structure. You might have a "roll number" column, a "name" column, and a favourite “subject" column.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;🔢 Roll No&lt;/th&gt;
&lt;th&gt;🧑 Name&lt;/th&gt;
&lt;th&gt;🎯 Subject&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🟢 01&lt;/td&gt;
&lt;td&gt;Rohit&lt;/td&gt;
&lt;td&gt;🐍 Python&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔵 02&lt;/td&gt;
&lt;td&gt;Jani&lt;/td&gt;
&lt;td&gt;☕ Java&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;⚪ ..&lt;/td&gt;
&lt;td&gt;..&lt;/td&gt;
&lt;td&gt;..&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔴 20&lt;/td&gt;
&lt;td&gt;Saira&lt;/td&gt;
&lt;td&gt;#️⃣ C#&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We are basically trying to relate &lt;strong&gt;object-oriented concepts&lt;/strong&gt; with &lt;strong&gt;database concepts&lt;/strong&gt;, and that is what is called &lt;strong&gt;&lt;em&gt;Object-Relational Mapping&lt;/em&gt;&lt;/strong&gt;. Okay, &lt;em&gt;so you don't have to do anything as a programmer&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;When we talk about Java we have &lt;strong&gt;HIBERNATE&lt;/strong&gt;, if you talk about Django which uses &lt;strong&gt;Python, which has an ORM built in&lt;/strong&gt;, if you talk about GoLang it also has &lt;strong&gt;GORM&lt;/strong&gt;, if you talk about .NET also has &lt;strong&gt;Entity framework&lt;/strong&gt;, if you use Nodejs or any Javascript runtime you have a lot of options like &lt;strong&gt;Drizzle, Prisma and Sequlize&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Mainly, you use this technique in between, and you say &lt;strong&gt;Hey, technique, this is my object. Save that in a database&lt;/strong&gt;, and it's done.&lt;/p&gt;

&lt;p&gt;That's how they do it. So they write all the queries for you. Behind the scenes, if you check, they create a select query. So if you say, "&lt;strong&gt;&lt;em&gt;Hey ORM, I have this roll number and can you give me the data for it?&lt;/em&gt;&lt;/strong&gt;" basically, we use some, let's say, GET methods. In this case, it will fire a SELECT query. When you say save, it will fire an INSERT query. When you say the data is already there, it will fire the UPDATE query. And what if you say you want to delete? It will fire the DELETE query. So everything will be done by your ORM technique.&lt;br&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%2F19eo5zciodwnmbqfz1em.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%2F19eo5zciodwnmbqfz1em.png" alt="Image description" width="495" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Basically, this is happening behind the scenes,
&lt;/h2&gt;

&lt;p&gt;The term “&lt;strong&gt;&lt;em&gt;Relational&lt;/em&gt;&lt;/strong&gt;” in ORM refers to the &lt;strong&gt;&lt;em&gt;Relational Table in the Database&lt;/em&gt;&lt;/strong&gt;. The database can be &lt;strong&gt;&lt;em&gt;SQL&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;MySQL&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;PostgreSQL&lt;/em&gt;&lt;/strong&gt;, etc. The term “&lt;strong&gt;&lt;em&gt;Object&lt;/em&gt;&lt;/strong&gt;” refers to the Object of a class. And finally, the term “&lt;strong&gt;&lt;em&gt;Mapping&lt;/em&gt;&lt;/strong&gt;” refers to the mapping between these two.&lt;br&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%2Fwdibw9azrvid95s1gmtw.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%2Fwdibw9azrvid95s1gmtw.png" alt="Image description" width="661" height="157"&gt;&lt;/a&gt;&lt;br&gt;
It maps the fields from the Student class to the columns of the Student Table.&lt;/p&gt;

&lt;p&gt;For example, the &lt;strong&gt;&lt;em&gt;ID from the student class&lt;/em&gt;&lt;/strong&gt; is directly mapped to the &lt;strong&gt;&lt;em&gt;ID column from the student table&lt;/em&gt;&lt;/strong&gt;. So we can directly create &lt;strong&gt;&lt;em&gt;objects of the student class&lt;/em&gt;&lt;/strong&gt; and store them in a &lt;strong&gt;&lt;em&gt;student database table&lt;/em&gt;&lt;/strong&gt;. Basically, we don’t have to write SQL statements to insert the record into the student’s table. &lt;strong&gt;&lt;em&gt;We can use ORM to directly map objects to the relational database table&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros of Using ORM:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;One of the significant advantages is the time saved for programmers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ORM techniques handle query generation, reducing manual SQL coding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You write less code when using ORM techniques than with SQL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ORM techniques are built to eliminate the possibility of SQL injection attacks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cons of Using ORM:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Complexity Limitations&lt;/em&gt;&lt;/strong&gt;: As projects become more complex, some ORM techniques may lack features for executing complex tasks. Customised queries might be necessary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Performance Debate&lt;/em&gt;&lt;/strong&gt;: There's an ongoing debate about the impact on application speed. &lt;em&gt;&lt;strong&gt;ORM might slow down the application&lt;/strong&gt;&lt;/em&gt; slightly, especially when &lt;strong&gt;&lt;em&gt;compared to manually optimised SQL queries&lt;/em&gt;&lt;/strong&gt;. However, the &lt;strong&gt;&lt;em&gt;difference might just be a fraction of a second&lt;/em&gt;&lt;/strong&gt;. But when &lt;strong&gt;&lt;em&gt;we talk about scale, those seconds matter a lot&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Debatable Speed&lt;/em&gt;&lt;/strong&gt;: While ORM aids faster development, there's a debate on whether it slows down runtime performance. In performance tests, the &lt;strong&gt;&lt;em&gt;difference is often minimal&lt;/em&gt;&lt;/strong&gt; but may be &lt;strong&gt;&lt;em&gt;noticeable in milliseconds&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Customised Queries&lt;/em&gt;&lt;/strong&gt;: ORM allows for customised queries. In Java, for instance, JPA supports JPQL or HQL, resembling SQL but adapted for object-oriented structures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Developer Experience&lt;/em&gt;&lt;/strong&gt;: If you're experienced in writing optimised SQL queries, using ORM might seem less efficient. &lt;strong&gt;&lt;em&gt;ORM techniques have their query-building methods&lt;/em&gt;&lt;/strong&gt;, which may &lt;strong&gt;&lt;em&gt;not align perfectly with manual optimisation&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Why ORMs Are (Supposedly) Your New Best Friend&lt;/em&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;You Don’t Have to Speak SQL All Day&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Look, SQL is great if you enjoy typing the same mind-numbing queries until your soul leaves your body. ORMs let you talk to your database in your own programming language—&lt;strong&gt;&lt;em&gt;no more ancient incantations required&lt;/em&gt;&lt;/strong&gt;. Just ask for what you want, and the ORM will fetch it (usually).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Faster to Build Stuff (Allegedly)&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Because you’re not wrestling with SQL every five minutes, you can actually build features. More time for actually building features, less time questioning your life choices at 3 AM because you misplaced a semicolon. Progress!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Makes Your Code Look Neater&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;ORMs keep your code looking like a well-organised&lt;/em&gt;&lt;/strong&gt; closet, instead of a pile of SQL socks thrown everywhere. When you revisit your project after a month, you might even remember what you were doing. Miracles do happen.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;But Wait... Here Comes the Fun Part&lt;/em&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Sometimes It’s Slower Than You’d Like&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMs are like that friend who insists on taking the scenic route to the grocery store. Sure, you’ll get there eventually, but I hope you weren’t in a hurry. If your app gets popular (hey, aim high), be prepared for some performance “surprises.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Magic Can Be Annoying&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMS do a lot for you automatically, which is awesome—until it’s not. It’s like having a helpful roommate who does your dishes but somehow breaks your microwave in the process. Thanks, I guess?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Not Great for Fancy Database Tricks&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMs look at your complex SQL requirements like a teenager asked to do calculus. Sure, they’ll try, but you’ll probably end up doing it yourself anyway. Sometimes, you just have to roll up your sleeves and write the SQL by hand, like a real adult.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Performance Issues&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The N+1 Query Disaster:&lt;/strong&gt;&lt;br&gt;
You load 100 users and want their posts. Naive ORM code hits the database 101 times (1 for users, 100 for each user's posts). Your app crawls like it's running on a potato. This happens ALL THE TIME to developers who don't understand what their ORM is doing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Lazy Loading Death Spiral:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMs love lazy loading - sounds efficient, right? Wrong. Access one related field outside your main query context, and boom - another database hit. Do this in a loop and watch your response times explode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Query Generation Stupidity:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMs generate SQL that would make a DBA cry. They often SELECT * everything instead of just the fields you need, create unnecessarily complex joins, and miss obvious optimisation opportunities that any human would catch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Memory Bloat:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
ORMs load entire objects when you might just need one field. Want just user emails? Too bad, here's the full user object with profile pictures, settings, and everything else eating your RAM.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The "&lt;strong&gt;&lt;em&gt;It Works on My Machine&lt;/em&gt;&lt;/strong&gt;" Problem:&lt;/li&gt;
&lt;li&gt;Your ORM query runs fine with 100 records in development. Deploy with 100,000 records, and suddenly everything times out. ORMs make it easy to write code that doesn't scale.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These aren't "microsecond differences" - they're "why is our app taking 10 seconds to load" disasters that kill user experience and cost companies real money.&lt;/p&gt;

&lt;p&gt;That's the performance reality most ORM tutorials conveniently skip.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;So, Should You Use an ORM?&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;If you’re new and want to build stuff fast without selling your soul to SQL, &lt;strong&gt;&lt;em&gt;ORMs can be a lifesaver&lt;/em&gt;&lt;/strong&gt;. Just remember: sometimes you’ll have to peek behind the curtain and deal with the mess. ORMs are like &lt;strong&gt;&lt;em&gt;autocorrect—incredibly helpful until they decide you meant “duck” when you clearly typed something else entirely&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By now, &lt;strong&gt;&lt;em&gt;you must have had a clear idea of ORM&lt;/em&gt;&lt;/strong&gt;. However, &lt;strong&gt;&lt;em&gt;understanding ORM on a theoretical level is just the first step&lt;/em&gt;&lt;/strong&gt;. To know the practical aspects of working with ORM, &lt;strong&gt;&lt;em&gt;you can try working with it by using it in some of your projects&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Liked the content? Let’s connect on &lt;a href="https://www.linkedin.com/in/nishant-keshav7/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;— I post more stuff like this (and would love to see what you’re building too).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>prisma</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Serverless Architecture</title>
      <dc:creator>Nishant Keshav</dc:creator>
      <pubDate>Thu, 24 Apr 2025 19:08:46 +0000</pubDate>
      <link>https://dev.to/nishant_keshav/serverless-268f</link>
      <guid>https://dev.to/nishant_keshav/serverless-268f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Serverless: It's Not 'No Server'!&lt;/strong&gt;&lt;br&gt;
You’ve probably come across the term before—Serverless. But don’t let the name mislead you. While it sounds like there are no servers involved, that’s not exactly true.&lt;/p&gt;

&lt;p&gt;Serverless doesn’t mean servers don’t exist—it means you, the developer, don’t need to manage them.&lt;/p&gt;

&lt;p&gt;Servers are very much a part of the process. Your application code still needs to run somewhere, and that “somewhere” is a server. There’s no magic that makes code run out of thin air.&lt;/p&gt;

&lt;p&gt;The real advantage of Serverless is that it takes the burden of server management off your shoulders.&lt;/p&gt;

&lt;p&gt;You don’t have to set up, maintain, or deploy servers. Instead, you get to focus entirely on writing your application logic, while the infrastructure is handled for you in the background.&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%2Fjpr6wco18w3482pzs7ap.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%2Fjpr6wco18w3482pzs7ap.png" alt="Image description" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Difference between Serverless and Non-Serverless&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Imagine you're working as a backend developer. A large part of your job is building APIs — whether it’s RESTful or GraphQL-based.&lt;/p&gt;

&lt;p&gt;You’ll typically write code that handles backend logic. This code could be written using any language or framework: Node.js, Python, Java, Spring Boot, Golang — whatever suits the project.&lt;/p&gt;

&lt;p&gt;But once you’re done writing your code, it has to run somewhere — and that somewhere is a backend server.&lt;/p&gt;

&lt;p&gt;In a traditional (non-serverless) setup, you're responsible for setting up that server, deploying your code to it, and keeping it running. The server is something you have to manage directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s take an example of Amazon and understand.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let me tell you this beforehand so that you won’t get confused, Serverless isn’t related to Amazon AWS or anything. It can be in any cloud provider. Microsoft also provides, Azure! For this example, we are taking AWS.&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%2Fvz6pr3qga0hi6dhmomut.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%2Fvz6pr3qga0hi6dhmomut.png" alt="Image description" width="783" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s take AWS and spin a server inside it. In terms of AWS, we call it EC2. EC2 might sound scary to you right now but it’s just a service which provide virtual machine. Now we have to configure this virtual machine.&lt;/p&gt;

&lt;p&gt;So let’s say, I figured out that my website doesn’t have much traffic as of now so I’ll be taking 2GB RAM with 500GB Storage.&lt;/p&gt;

&lt;p&gt;Now will spin up the machine with the desired configuration which will execute our code in this particular machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you see any problem in this process? NO right!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What’s happening here is, that there is a server in this case and I am responsible for managing the server.&lt;/p&gt;

&lt;p&gt;By managing the server I mean, how much RAM and storage has to be fed to the server, all of this is managed by me.&lt;/p&gt;

&lt;p&gt;One more thing to notice here is that the charges here are based on per hour.&lt;/p&gt;

&lt;p&gt;Assume Amazon is charging 0.02$ per hour. Thus, this machine will run 24 hours a day and 24 x 30 x 0.02 is my monthly cost.&lt;/p&gt;

&lt;p&gt;💡 In a nutshell, here we have a server that is constantly running, whose configurations are handled by me and there is a certain amount of charge that has to be paid.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But what about up-scaling and down-scaling?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s say during some months, huge traffic comes to my website. What will do in the case of Amazon will make some Auto Scaling Group (ACG).&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%2Ffx4bib0j9v96903ytclw.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%2Ffx4bib0j9v96903ytclw.png" alt="Image description" width="770" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me tell you ACG in layman's terms: It means that I’ll tell Amazon to give my EC2 instance 6GB RAM and 100GB Storage. Thus, for the time traffic will be high, the rate will automatically increase.&lt;/p&gt;

&lt;p&gt;But the catch here is, on a minimum level who is managing the server?&lt;/p&gt;

&lt;p&gt;It’s me who is managing the server. From scaling to code deployment, and configuration I’m managing all of it. Since it’s an EC2 machine, firstly we have to install NodeJS in it and then will have to install Linux and all of it.&lt;/p&gt;

&lt;p&gt;Since we can say that, &lt;strong&gt;in a non-serverless architecture we have to take up a server, configure it, install an Operating System inside it, install all the libraries inside it, and take care of all the deployments, scaling up and scaling down is also my responsibility and billing is done per hour.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens in Serverless?
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
All you have to do is write the code. You don’t have to worry about the underlying infrastructure that’s running your code.&lt;/p&gt;

&lt;p&gt;In terms of AWS, there is something known as AWS lambda.&lt;/p&gt;

&lt;p&gt;What you have to do is to give your code to Amazon. Now Amazon will decide, what OS has to be given, how much RAM, and how much Storage has to be given? Your only concern will be to write the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rest of the things like deployment, up-scaling, down-scaling, managing the underlying infrastructure, etc. all this is done by Amazon.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This particular thing is called serverless because you don’t actually have a server here. All you have is code and you’ve deployed it. All the management of the server is done by Amazon.&lt;/p&gt;

&lt;p&gt;Now you might wonder what’s the benefit?&lt;/p&gt;

&lt;p&gt;It took all the control away from me. The control to configure my machine the way I want.&lt;/p&gt;

&lt;p&gt;But the difference lies here!&lt;/p&gt;

&lt;p&gt;Let’s say I have a website and my backend is running on EC2, on a non-serverless architecture, and at this time my website has zero traffic on it.&lt;/p&gt;

&lt;p&gt;Even though I have zero traffic but my servers are still running (24×7) to be able to serve user as they come.&lt;/p&gt;

&lt;p&gt;But when we come to serverless, here billing is done in terms of invocation.&lt;/p&gt;

&lt;p&gt;Let’s say the rate here is $0.001 per invocation. What happens here is the code isn’t running 24x7.&lt;/p&gt;

&lt;p&gt;Suppose we have some code, and an API is attached to it. Initially, our code will be in SLEEP state and it’s not running. What happens here is, when a user comes and makes a request i.e. calls the API then only the serverless service will start my code.&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%2Fcly0y1sbiyrlh4jobb7f.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%2Fcly0y1sbiyrlh4jobb7f.png" alt="Image description" width="795" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this time, it’s in the START state and then it will execute the code line by line and return its output as a response and it will again go back to the SLEEP state.&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%2Fqwt4uxhosyr45ndcwvd7.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%2Fqwt4uxhosyr45ndcwvd7.png" alt="Image description" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever the user requests, the code is invoked, and it is from that invocation the billing is done i.e. in a month how many times it has been invoked.&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%2Fmq2bzx8r7vykin3iim2f.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%2Fmq2bzx8r7vykin3iim2f.png" alt="Image description" width="796" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The benefit here is that, if my website has zero traffic then I don’t have to pay even a single penny because at that time my website, server isn’t running at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Another important difference is in up-scaling and down-scaling.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Serverless can up-scale and down-scale on its own based on the traffic.&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%2Fiuqborvdbegclm5vqbp1.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%2Fiuqborvdbegclm5vqbp1.png" alt="Image description" width="798" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suppose your site automatically gets 1000 users.&lt;/p&gt;

&lt;p&gt;Now your single code cannot handle those 1000 users, thus what serverless will do is it will scale your system horizontally i.e. &lt;strong&gt;it will make multiple copies of your code so that it can cater to 1000 users and when the user traffic goes down it will get back to normal.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The other benefit is CDN. Serverless platforms help us run the same code in different regions so the latency is as low as possible, since the region that is selected is near the user.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This benefit is predominant as you don’t need to scale your system on its own!&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%2F2mjd8dq7agr8gti4yanf.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%2F2mjd8dq7agr8gti4yanf.png" alt="Image description" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let’s talk about why you should be interested as a developer in Serverless?&lt;/p&gt;

&lt;p&gt;The idea is basically to run the backend code without having to update, create, and maintain a server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;br&gt;
The major benefits from a developer’s side (being able to build a full stack site without having to worry about other stuff!)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No server maintenance&lt;/li&gt;
&lt;li&gt;No Provisioning: Enhances developer productivity and reduces operational costs by managing server tasks, enabling greater focus on app development.&lt;/li&gt;
&lt;li&gt;No monitoring: Facilitates DevOps by eliminating the need for developers to specify infrastructure and streamline processes.&lt;/li&gt;
&lt;li&gt;Low cost: Operational costs are minimized as cloud resources are paid for based on usage.&lt;/li&gt;
&lt;li&gt;Low maintenance&lt;/li&gt;
&lt;li&gt;Easy to scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lack of control over server-side logic and infrastructure may limit flexibility and lead to vendor lock-in.&lt;/li&gt;
&lt;li&gt;Cloud provider constraints can affect customization.&lt;/li&gt;
&lt;li&gt;Switching providers may require system upgrades to adhere to new specifications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By now, you must have had a clear idea of &lt;strong&gt;Serverless&lt;/strong&gt;, from its meaning to working. In a nutshell, Serverless computing abstracts server management, allowing rapid, event-driven scalability and cost-efficient deployment, ideal for modern, dynamic applications.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>serverless</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
