<?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: Dayanand garg</title>
    <description>The latest articles on Forem by Dayanand garg (@dayanandgarg).</description>
    <link>https://forem.com/dayanandgarg</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%2F848099%2F316ecdc4-a7f1-4c07-85a5-86e2923edc63.png</url>
      <title>Forem: Dayanand garg</title>
      <link>https://forem.com/dayanandgarg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dayanandgarg"/>
    <language>en</language>
    <item>
      <title>Mastering Database Schema Design: The First Step of Requirement Gathering</title>
      <dc:creator>Dayanand garg</dc:creator>
      <pubDate>Thu, 30 Mar 2023 18:19:23 +0000</pubDate>
      <link>https://forem.com/dayanandgarg/mastering-database-schema-design-the-first-step-of-requirement-gathering-26dn</link>
      <guid>https://forem.com/dayanandgarg/mastering-database-schema-design-the-first-step-of-requirement-gathering-26dn</guid>
      <description>&lt;p&gt;When it comes to designing a database schema, the first and most important step is requirement gathering. This step involves understanding the needs and objectives of the system being developed and the data that will be stored and processed within the database. A well-designed database schema can greatly improve the efficiency and accuracy of data management, and ultimately, the success of the system as a whole.&lt;/p&gt;

&lt;p&gt;Here are some key steps to follow when gathering requirements for database schema design:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Identify the stakeholders: The first step in requirement gathering is to identify the stakeholders who will be using the system and the data that will be stored in the database. This includes end-users, developers, and other stakeholders such as managers, administrators, and data analysts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Determine the scope: Once the stakeholders have been identified, it is important to determine the scope of the system and the database. This includes understanding the business processes, rules, and workflows that will be supported by the database, as well as the types of data that will be stored and processed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Define the data entities: Once the scope has been determined, the next step is to define the data entities that will be stored in the database. This involves identifying the key data elements and their relationships, as well as any constraints or rules that must be applied to the data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Determine the data attributes: For each data entity, it is important to determine the attributes that will be stored in the database. This includes defining the data type, size, format, and any other relevant properties.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identify the relationships: Once the data entities and attributes have been defined, the next step is to identify the relationships between the entities. This involves understanding the primary keys, foreign keys, and any other relationships that must be established to ensure data integrity and consistency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consider performance and scalability: Finally, when gathering requirements for database schema design, it is important to consider performance and scalability. This includes understanding the expected volume of data and transactions, as well as the types of queries and reports that will be generated. This information can be used to design a database schema that is optimized for performance and can scale to meet future needs.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, requirement gathering is a crucial step in the database schema design process. By taking the time to understand the needs and objectives of the system and the data that will be stored and processed, it is possible to design a database schema that is efficient, accurate, and supports the needs of all stakeholders.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Database Design 101: An Introduction</title>
      <dc:creator>Dayanand garg</dc:creator>
      <pubDate>Wed, 22 Feb 2023 17:30:50 +0000</pubDate>
      <link>https://forem.com/dayanandgarg/database-design-101-an-introduction-129o</link>
      <guid>https://forem.com/dayanandgarg/database-design-101-an-introduction-129o</guid>
      <description>&lt;p&gt;If you're new to the field of &lt;em&gt;database design&lt;/em&gt;, you might be wondering what it is and why it's important. In this post, we'll provide a basic overview of database design, explain why it matters, and walk you through the basic steps involved in the database design process.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is database design?
&lt;/h2&gt;

&lt;p&gt;At its core, database design is the process of creating a logical and physical model of a database system. This involves defining the structure of the data, the relationships between different data elements, and the rules for storing and retrieving the data. A well-designed database can improve data accuracy, reduce data redundancy, and provide faster access to the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is database design important?&lt;/strong&gt;&lt;br&gt;
Database design is critical because it can impact the performance and usability of a database system. Poorly designed databases can lead to data inconsistencies, slower performance, and difficulties in retrieving and analyzing data. On the other hand, well-designed databases can provide numerous benefits, including improved data accuracy, increased data security, and faster access to the data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps in the database design process
&lt;/h2&gt;

&lt;p&gt;The database design process typically involves several distinct steps, including requirements gathering, conceptual design, logical design, normalization, physical design, implementation, and maintenance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Requirements gathering&lt;/strong&gt;: This involves understanding user requirements, defining data elements, and creating use cases and scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conceptual design&lt;/strong&gt;: This step involves creating an Entity-Relationship (ER) model, identifying entities and attributes, and defining relationships between entities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logical design&lt;/strong&gt;: Here, you create a relational schema, define tables and columns, and create primary and foreign keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalization&lt;/strong&gt;: This step involves organizing the data into tables and eliminating redundancy in the data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Physical design&lt;/strong&gt;: In this step, you choose a database management system (DBMS), define storage structures, and create indexes and views.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation&lt;/strong&gt;: This involves creating the database schema, populating the database with data, and ensuring data integrity and security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintenance&lt;/strong&gt;: Finally, you'll monitor the database performance, back up and restore the database, and modify the database schema as needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Database design is a complex and important field that can have a significant impact on the performance and usability of a database system. By understanding the basic steps involved in the database design process, you can begin to create databases that are well-designed, secure, and efficient. In the coming chapters of this book, we'll dive deeper into each step of the database design process, providing practical advice and best practices along the way.&lt;/p&gt;

&lt;p&gt;We hope you found this introduction to database design helpful. If you have any questions or comments, please feel free to leave them below!&lt;/p&gt;

</description>
      <category>posts</category>
      <category>writing</category>
      <category>contentwriting</category>
    </item>
    <item>
      <title>Why Next.js is the Best Choice for Server-Side Rendering with React</title>
      <dc:creator>Dayanand garg</dc:creator>
      <pubDate>Wed, 22 Feb 2023 04:59:37 +0000</pubDate>
      <link>https://forem.com/dayanandgarg/why-nextjs-is-the-best-choice-for-server-side-rendering-with-react-11hk</link>
      <guid>https://forem.com/dayanandgarg/why-nextjs-is-the-best-choice-for-server-side-rendering-with-react-11hk</guid>
      <description>&lt;p&gt;In recent years, server-side rendering (SSR) has become an essential part of building modern web applications. Server-side rendering allows web developers to provide better user experience and improve search engine optimization (SEO) by pre-rendering HTML on the server before sending it to the client. React, one of the most popular JavaScript libraries for building web applications, also supports server-side rendering. In this blog, we'll discuss why Next.js is the best choice for server-side rendering with React.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Next.js?
&lt;/h2&gt;

&lt;p&gt;Next.js is a popular open-source framework for building server-rendered React applications. It was created by Vercel, the company that created the popular JavaScript-based JAMstack platform. Next.js provides a set of tools and features that help developers build high-performance web applications. Some of its features include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server-side rendering&lt;/strong&gt;: Next.js provides built-in support for server-side rendering, which means that your application's pages are pre-rendered on the server and sent to the client as HTML. This significantly improves the time-to-first-byte (TTFB) and makes the website load faster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automatic code splitting&lt;/strong&gt;: Next.js automatically splits your code into smaller chunks, which reduces the size of the JavaScript files and improves the page load time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Static site generation&lt;/strong&gt;: Next.js supports static site generation, which means that your website's pages can be pre-generated as static HTML files and served from a content delivery network (CDN). This further improves the page load time and reduces the server's load.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why Next.js is the Best Choice for Server-Side Rendering with React&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to get started&lt;/strong&gt;: Next.js provides an easy-to-use CLI tool that helps you create a new project quickly. You don't need to set up a separate server or configure complex build tools. Next.js takes care of all the setup, so you can focus on building your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Provides a great developer experience&lt;/strong&gt;: Next.js provides a great developer experience by supporting hot module replacement (HMR), which means that your changes are reflected in the browser instantly. This makes the development process faster and more efficient.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improves search engine optimization&lt;/strong&gt;: By using server-side rendering, Next.js provides search engine crawlers with fully rendered HTML pages, which makes it easier for them to index your website's content. This improves the website's visibility on search engine results pages (SERPs) and can lead to more organic traffic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better performance&lt;/strong&gt;: Next.js provides faster page load times by using server-side rendering and automatic code splitting. This significantly reduces the time-to-first-byte (TTFB) and makes the website load faster. In addition, Next.js supports static site generation, which makes the website even faster by serving pre-generated HTML files from a content delivery network (CDN).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Next.js is a powerful open-source framework for building server-rendered React applications. It provides a set of tools and features that make it easy to get started and improve the website's performance, developer experience, and search engine optimization. If you're looking to build a server-rendered React application, Next.js is the best choice&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to track user location in background</title>
      <dc:creator>Dayanand garg</dc:creator>
      <pubDate>Sat, 18 Feb 2023 03:51:12 +0000</pubDate>
      <link>https://forem.com/dayanandgarg/how-to-track-user-location-in-background-pnm</link>
      <guid>https://forem.com/dayanandgarg/how-to-track-user-location-in-background-pnm</guid>
      <description>&lt;p&gt;&lt;a href="https://media.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%2Fidexowthye4it78i0n72.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fidexowthye4it78i0n72.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In many mobile apps, it's important to track the user's location to provide location-based services or gather data for analytics purposes. However, tracking the location in the background and sending it to the server can be challenging, especially when the screen is locked or the app is in the background. In this tutorial, we'll learn how to update the user's location in every 15 minutes and send it to the server even when the screen is locked in a React Native app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we get started, make sure you have the following installed on your development machine:&lt;/p&gt;

&lt;p&gt;Node.js (v10 or later)&lt;br&gt;
React Native CLI&lt;br&gt;
Android Studio (for Android development)&lt;br&gt;
Xcode (for iOS development)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install necessary packages
&lt;/h2&gt;

&lt;p&gt;First, let's install the necessary packages to track the user's location in the background and schedule a background task. Run the following commands in your terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm install @react-native-community/geolocation
npm install react-native-background-task


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Step 2: Grant permissions
&lt;/h2&gt;

&lt;p&gt;Next, we need to grant the necessary permissions to access the device's location. Depending on your target platform, you need to add the following lines to your AndroidManifest.xml and Info.plist files:&lt;/p&gt;

&lt;p&gt;AndroidManifest.xml:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&amp;gt;
&amp;lt;uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Info.plist:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;key&amp;gt;NSLocationAlwaysAndWhenInUseUsageDescription&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;Location is used to track your movements.&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;NSLocationAlwaysUsageDescription&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;Location is used to track your movements.&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;NSLocationWhenInUseUsageDescription&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;Location is used to track your movements.&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;UIBackgroundModes&amp;lt;/key&amp;gt;
&amp;lt;array&amp;gt;
  &amp;lt;string&amp;gt;fetch&amp;lt;/string&amp;gt;
  &amp;lt;string&amp;gt;remote-notification&amp;lt;/string&amp;gt;
  &amp;lt;string&amp;gt;location&amp;lt;/string&amp;gt;
&amp;lt;/array&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;These permissions allow the app to access the device's location even when the app is in the background or the screen is locked.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Set up background location tracking
&lt;/h2&gt;

&lt;p&gt;Now, let's set up the background location tracking using the Geolocation module from @react-native-community/geolocation. This module provides a way to watch the device's position in the background and receive updates at a given interval.&lt;/p&gt;

&lt;p&gt;Here's an example of how you can set up the background location tracking:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import Geolocation from '@react-native-community/geolocation';

// Configure Geolocation
Geolocation.setRNConfiguration({
  authorizationLevel: 'always', // Request "always" location permission
  skipPermissionRequests: false, // Prompt for permission if not granted
});

// Watch for position updates
const watchId = Geolocation.watchPosition(
  position =&amp;gt; {
    console.log(position);
    // Send the position data to the server
  },
  error =&amp;gt; {
    console.log(error);
  },
  {
    distanceFilter: 10, // Minimum distance (in meters) to update the location
    interval: 900000, // Update interval (in milliseconds), which is 15 minutes
    fastestInterval: 300000, // Fastest update interval (in milliseconds)
    accuracy: {
      android: 'highAccuracy',
      ios: 'best',
    },
    showsBackgroundLocationIndicator: true,
    pausesLocationUpdatesAutomatically: false,
    activityType: 'fitness', // Specify the activity type (e.g., 'fitness' or 'other')
    useSignificantChanges: false,
    deferredUpdatesInterval: 0,
    deferredUpdatesDistance: 0,
    foregroundService: {
      notificationTitle: 'Tracking your location',
      notificationBody: 'Enable location tracking to continue', // Add a notification body
    },
  }
);

// To stop tracking (for example, when the component unmounts):
// Geolocation.clearWatch(watchId);



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;By following the steps outlined in this tutorial, you can ensure that your app continues to track the user's location and provide relevant services even when the app is in the background or the screen is locked.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
