<?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: Mohammad Mehadi Hasan</title>
    <description>The latest articles on DEV Community by Mohammad Mehadi Hasan (@mehediasif).</description>
    <link>https://dev.to/mehediasif</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%2F542086%2F828624ca-f620-4790-aa20-cc072dc3c510.jpeg</url>
      <title>DEV Community: Mohammad Mehadi Hasan</title>
      <link>https://dev.to/mehediasif</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mehediasif"/>
    <language>en</language>
    <item>
      <title>Checking NextJS Hydration on chrome</title>
      <dc:creator>Mohammad Mehadi Hasan</dc:creator>
      <pubDate>Thu, 19 Jan 2023 22:46:50 +0000</pubDate>
      <link>https://dev.to/mehediasif/checking-nextjs-hydration-on-chrome-22cn</link>
      <guid>https://dev.to/mehediasif/checking-nextjs-hydration-on-chrome-22cn</guid>
      <description>&lt;p&gt;If you're a web developer and you write your frontend in NextJS then you will probably be interested to see how the Hydration Process works for your app. Honestly I do not want to get into the nitty gritty of this in this specific blog post because I believe NextJS documentation explains it very well.Check out this &lt;a href="https://nextjs.org/docs/advanced-features/automatic-static-optimization"&gt;documentation&lt;/a&gt; to understand more on this. &lt;br&gt;
And this thread from Stackoverflow for &lt;a href="https://stackoverflow.com/questions/66845811/next-js-before-hydration-next-js-hydration-and-fcp"&gt;Questions Regarding this&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But I want to answer one thing before you start scratching your head about it(trust me we all have been there!)&lt;/p&gt;

&lt;p&gt;So the question you have to ask yourself is why would these performance metrics matters and why should you check out the tracing tool provided by Google Chrome??&lt;/p&gt;

&lt;p&gt;The simple answer would be : &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When diagnosing performance problems it can be valuable to see what Chrome is doing "under the hood." One way to get a more detailed view into what's going on is to use this &lt;a href="https://dev.tochrome://tracing/"&gt;tool&lt;/a&gt; by Chrome.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A bit elaboration : &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The tracing tool by chrome records the activity in Chrome's multi-process architecture processes to see what each process is doing in a hierarchical view. This could have a lot of information depending on your application size but sifting through it can help identify performance bottlenecks, slow operations, and JavaScript events with irregular lengths.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Check out this links to learn more on tracing:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/"&gt;chromium docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tracing Ecosystem Explainer &lt;a href="https://docs.google.com/document/d/1QADiFe0ss7Ydq-LUNOPpIf6z4KXGuWs_ygxiJxoMZKo/edit#heading=h.dytg6ymhhy0b"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now let's get back to Checking NextJS Hydration on chrome. After your nextJS application is running on chrome:&lt;/p&gt;

&lt;p&gt;Right Click on your mouse and Click "Inspect"&lt;br&gt;
Find "Performance Insights tab" and Click on it&lt;br&gt;
&lt;a href="https://developer.chrome.com/docs/devtools/performance-insights/"&gt;Helpful link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There you should see two options under a red button like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iDHvH9Jr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksx9pzbm2ozbokuch3dg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iDHvH9Jr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ksx9pzbm2ozbokuch3dg.png" alt="Screenshot of Performance Insights" width="291" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you click on the "Start Recording" and do some activity on your application and then stop recording chrome will record the trace events regarding your actions.After you're done recording you should see a nice timeline visualization of activity and if you click on the "Measure Page load" then there will be a similar timeline with trace events but only for the page you're on.&lt;br&gt;
In both cases I invite you to play around and try to understand what is going on and if you don't understand anything there will be a details tab where you can click and check the details of a specific event or check the links I have provided you in this blog.&lt;/p&gt;

&lt;p&gt;And finally if you really want to get to the bottom of your performance analytics you can either "Start recording an activity" or "Measure A specific page load" then on the same row where you have the buttons for it you can click "export" and it will export a profile.json file for you.Then go to &lt;code&gt;chrome://tracing&lt;/code&gt; and Click on "load" or go &lt;a href="https://ui.perfetto.dev/"&gt;here&lt;/a&gt; for better visualization.&lt;br&gt;
In both cases you will need to upload your Profile.Json file and the use &lt;strong&gt;WASD&lt;/strong&gt; keys on your keyboard to get into little details.&lt;br&gt;
But you will need to understand about Scheduling Algorithms to grasp the whole picture of what is exactly going on "Behind the Scene".&lt;/p&gt;

&lt;p&gt;That's all for today. #happyHacking&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>cputhreads</category>
    </item>
    <item>
      <title>Generating a whole database script in MySQL workbench #databases #MySQL #MySQL_workbench</title>
      <dc:creator>Mohammad Mehadi Hasan</dc:creator>
      <pubDate>Sat, 24 Apr 2021 03:14:24 +0000</pubDate>
      <link>https://dev.to/mehediasif/generating-a-whole-database-script-in-mysql-workbench-databases-mysql-mysqlworkbench-57c7</link>
      <guid>https://dev.to/mehediasif/generating-a-whole-database-script-in-mysql-workbench-databases-mysql-mysqlworkbench-57c7</guid>
      <description>&lt;p&gt;Hello there devs! I hope you guys are doing well and staying safe in this pandemic. So, as I took a database course at my university this semester and our teacher asked us to go for SQL first then learning NoSQL databases such as MongoDB.After the first half of the course, we had to create&amp;amp;design a whole working database in SQL and present it to the teacher as a project. As I knew MySQL syntax before I preferred to make my project in MySQL and as I am primarily a Windows user I am writing my SQL scripts in &lt;strong&gt;MySQL workbench&lt;/strong&gt;.But it took me by surprise when our teacher asked us to send him only one SQL script which has everything he asked for in the first place.So to describe it a bit more I had to send him only one SQL script when executed it should create the database at the first place then the tables, views,stored procedures and functions as well.I was a little bit surprised because usually in the professional work environment you are supposed to make them in separate scripts and put them under source control so that your teammates can also work on it without messing up with the data inside. Anyway as I had to do it for my grades I had to look for this up on the internet and took me some time to get how to do it properly even tho I thought I knew how to use MySQL Workbench.So I am writing this just in case you are looking for it for the first time.&lt;br&gt;
so at first we will go to the MySQL Workbench and connect a server you connected to before.Then go to the main menu and go to &lt;code&gt;Server&lt;/code&gt; and then go to &lt;code&gt;Data Export&lt;/code&gt;&lt;br&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%2Fzzyo1e07i1mu5bz40u27.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%2Fzzyo1e07i1mu5bz40u27.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
After that, you will see the list of Database schemas you can select to export.In my case, I had to select only one.&lt;br&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%2Ftssytzhqhl3x7wwaojrp.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%2Ftssytzhqhl3x7wwaojrp.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
So after selecting the Database Schema you can select the associated objects with it like the tables,views and stored procedures.Go ahead and select the objects you want to export in the SQL script.&lt;br&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%2Fcqdtd15qfsvxgz7qz9c8.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%2Fcqdtd15qfsvxgz7qz9c8.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Okay. &lt;em&gt;This part is a little bit important.&lt;/em&gt;&lt;br&gt;
You have 3 choices.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dump Structure and Data&lt;/li&gt;
&lt;li&gt;Dump Data only&lt;/li&gt;
&lt;li&gt;Dump Structure only &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you probably can understand by the names what each option would do for you.If you only want to export the structure with no data you can select that or you can only export the data if that's what your task is.But in my case, I had to export both the structure and the data along with it so I went with Dump Structure and Data.&lt;br&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%2Fw1yog595rkep2q6cjm11.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%2Fw1yog595rkep2q6cjm11.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
okay, we are almost done. Now we have the choice of putting our script in a folder or in a single file(depends however you prefer) and there is also a box where you can check it to include create schema meaning the Data Definition Language(DDL) or not.&lt;br&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%2Foido9s1o4adk5iz48e7a.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%2Foido9s1o4adk5iz48e7a.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
So after selecting according to your needs you just have to click the&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;Start Export&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 button to generate a sql script of the whole schema and you can either put it under source control and share the link or you can directly send the &lt;strong&gt;.sql file&lt;/strong&gt; by email.&lt;br&gt;
I hope it helped you in some way.&lt;/p&gt;

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