<?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: Tej Pratap</title>
    <description>The latest articles on DEV Community by Tej Pratap (@tejpratap).</description>
    <link>https://dev.to/tejpratap</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%2F158935%2F06879214-8e86-49a7-a082-a4579861592a.png</url>
      <title>DEV Community: Tej Pratap</title>
      <link>https://dev.to/tejpratap</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tejpratap"/>
    <language>en</language>
    <item>
      <title>What makes your web app faster? (part 4, Progressive Enhancements)</title>
      <dc:creator>Tej Pratap</dc:creator>
      <pubDate>Tue, 26 Nov 2019 12:34:25 +0000</pubDate>
      <link>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-4-progressive-enhancements-7o3</link>
      <guid>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-4-progressive-enhancements-7o3</guid>
      <description>&lt;h1&gt;
  
  
  What makes your web app faster? (part 4, Browser And Progressive Enhancements)
&lt;/h1&gt;

&lt;p&gt;If you are coming to this story directly, i’ll suggest to take a look at &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-1-databases-31fd"&gt;part 1&lt;/a&gt;, &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-2-caching-15ap"&gt;part 2&lt;/a&gt; and &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-3-client-app-3hgl"&gt;Part 3&lt;/a&gt; of this series.&lt;/p&gt;

&lt;p&gt;So, last time i left you saying,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Be indistinguishable from native apps.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a web developers we were successful in convincing user to leave there Native Desktop Apps for a web app, Now only few people use an native email client over Gmail. But we are still not able to make user leave there native mobile app for a mobile web app.&lt;/p&gt;

&lt;p&gt;This is because a native app feels more comfortable smooth and responsive than a web app. A native app has Push Notification for engagement, Device storage for offline access and much more. But this is changing quickly as web can do more things, check &lt;a href="https://whatwebcando.today/"&gt;&lt;em&gt;what web can do today&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  * Progressive Web App
&lt;/h2&gt;

&lt;p&gt;PWA (Progressive Web App) is the next step in making web feel more native to a device.&lt;/p&gt;

&lt;p&gt;PWA give you access to native capabilities such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Offline Storage (Service Worker)&lt;/li&gt;
&lt;li&gt; Push Notification (Service Worker)&lt;/li&gt;
&lt;li&gt; Install as Native (App Manifest)&lt;/li&gt;
&lt;li&gt; Open app links (App Manifest)&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;To use PWA you must be using https&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;PWA has 2 main Service Worker and Web App Manifest&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"&gt;1. Service Worker:&lt;/a&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server. They will also allow access to push notifications and background sync APIs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To read more about service worker goto &lt;a href="http://Service%20workers%20essentially%20act%20as%20proxy%20servers%20that%20sit%20between%20web%20applications,%20the%20browser,%20and%20the%20network%20(when%20available).%20They%20are%20intended,%20among%20other%20things,%20to%20enable%20the%20creation%20of%20effective%20offline%20experiences,%20intercept%20network%20requests%20and%20take%20appropriate%20action%20based%20on%20whether%20the%20network%20is%20available,%20and%20update%20assets%20residing%20on%20the%20server.%20They%20will%20also%20allow%20access%20to%20push%20notifications%20and%20background%20sync%20APIs."&gt;&lt;em&gt;MDN&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Manifest"&gt;2. Web App Manifest:&lt;/a&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;The web app manifest provides information about a web application in a JSON text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users with quicker access and a richer experience). PWA manifests include its name, author, icon(s), version, description, and list of all the necessary resources (among other things).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To read more about web app manifest goto &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Manifest"&gt;&lt;em&gt;MDN&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Other Enhancements:
&lt;/h2&gt;

&lt;p&gt;As we know javascript executes all operations in a single thread. It becomes a problem while going more intensive tasks such as image processing. To overcome this situation we can transfer that task to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API"&gt;&lt;strong&gt;&lt;em&gt;Web Worker&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; which will execute that task in a background thread. You cannot touch any DOM element from Web Worker and only transfer data using messages. To read more about Web Worker goto &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API"&gt;&lt;em&gt;MDN&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>What makes your web app faster? (part 3, Client App)</title>
      <dc:creator>Tej Pratap</dc:creator>
      <pubDate>Tue, 26 Nov 2019 12:29:41 +0000</pubDate>
      <link>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-3-client-app-3hgl</link>
      <guid>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-3-client-app-3hgl</guid>
      <description>&lt;h1&gt;
  
  
  What makes your web app faster? (part 3, Client App)
&lt;/h1&gt;

&lt;p&gt;If you are coming to this story directly, i’ll suggest to take a look at &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-1-databases-31fd"&gt;part 1&lt;/a&gt; and &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-3-client-app-3hgl"&gt;part 2&lt;/a&gt; of this series.&lt;/p&gt;

&lt;p&gt;So, last time i left you saying,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Not everything has to be done on server.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We are living in a new age of web development, previously everything was done on server side (Rendering, routing etc). After introduction of &lt;a href="https://en.wikipedia.org/wiki/Ajax_(programming)"&gt;&lt;strong&gt;AJAX&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;,&lt;/strong&gt; web development got a whole new way to create and manage user interaction. All the likes, adding comment does not needed a page refresh.&lt;/p&gt;

&lt;p&gt;But without using a standard development pattern like MVC, it was getting hard to manage bigger and bigger applications.&lt;/p&gt;

&lt;h1&gt;
  
  
  Javascript Frameworks:
&lt;/h1&gt;

&lt;p&gt;The Dawn Of Web Frameworks begins in 2009 when a guy at google started working on a js framework the made 18,000 lines of jquery code to 2,000 angularjs code (That app was google feedback).&lt;/p&gt;

&lt;h2&gt;
  
  
  The reason why they are so successful because:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; The use a well proven app development pattern (MVC, MVVC, MV* etc).&lt;/li&gt;
&lt;li&gt; Only load parts of web page that is changing (Single page application).&lt;/li&gt;
&lt;li&gt; Reusing web components.&lt;/li&gt;
&lt;li&gt; If you are using node js server you can user isomorphic javascript for a single codebase.&lt;/li&gt;
&lt;li&gt; Takes care of your routing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Leaders:
&lt;/h2&gt;

&lt;p&gt;There are more than 100 frameworks in market, leaders are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;a href="https://angular.io/"&gt;Angular&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://facebook.github.io/react/"&gt;React&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://vuejs.org/"&gt;Vue&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.meteor.com/"&gt;Meteor&lt;/a&gt; (we will be excluding this)&lt;/li&gt;
&lt;li&gt; &lt;a href="http://backbonejs.org/"&gt;Backbone&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="http://emberjs.com/"&gt;Ember&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.polymer-project.org/1.0/"&gt;Polymer&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a benchmark of these frameworks fighting for glory,&lt;/p&gt;

&lt;p&gt;[## Javascript Frameworks Benchmarks&lt;/p&gt;

&lt;h3&gt;
  
  
  Duration for updating all 1000 rows of the table (with 5 warmup iterations).
&lt;/h3&gt;

&lt;h4&gt;
  
  
  stefankrause.net](&lt;a href="http://stefankrause.net/js-frameworks-benchmark4/webdriver-ts/table.html?source=post_page-----4ec0d4fde428----------------------"&gt;http://stefankrause.net/js-frameworks-benchmark4/webdriver-ts/table.html?source=post_page-----4ec0d4fde428----------------------&lt;/a&gt;)
&lt;/h4&gt;

&lt;p&gt;I won't tell you to use a specific framework over other, you can look at the benchmarks and decide it for yourself.&lt;/p&gt;

&lt;p&gt;So, now back to how you can boost your web app’s performance. Using a Javascript framework helps you from generating those heavy HTML pages on server but it also increase time for &lt;strong&gt;first meaningful paint&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The way our web app rendered is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Get Container (simple page).&lt;/li&gt;
&lt;li&gt; Load Javascript framework.&lt;/li&gt;
&lt;li&gt; Load Controllers.&lt;/li&gt;
&lt;li&gt; Get template (not in case of React).&lt;/li&gt;
&lt;li&gt; Get api data.&lt;/li&gt;
&lt;li&gt; Render template with data.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Which is even &lt;strong&gt;slower than older methods&lt;/strong&gt;, just get HTML and BAMM first meaningful paint is here.&lt;/p&gt;

&lt;p&gt;But it is still good because, everything that changes from here will be blazing fast and what can never be matched with traditional server pages.&lt;/p&gt;

&lt;p&gt;But there is a solution for above problem → &lt;strong&gt;Server Side Rendering.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Server Side Rendering:
&lt;/h2&gt;

&lt;p&gt;In server side rendering, web app’s are rendered as HTML from server and after serving that 1st page client apps kicks in and takes control of application from there. So, it is a mix of old methods with new technology.&lt;/p&gt;

&lt;p&gt;Server side rendering also helps in keeping a single code base, you can achieve this with &lt;a href="http://phantomjs.org/"&gt;phantomJs&lt;/a&gt; (it has a npm module).&lt;/p&gt;

&lt;p&gt;But i will suggest take one which handles server side rendering itself, this will boost your app performance big time.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://webpack.github.io/"&gt;Webpack&lt;/a&gt;:
&lt;/h2&gt;

&lt;p&gt;Loading multiple javascript files surely takes more time than all file combined as one. Webpack helps you achieve that.&lt;/p&gt;

&lt;p&gt;Javascript frameworks are big topic in itself, I will not going to explain you every one of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose one Choose Wisely:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; One way to choose is, Just have a look at every frameworks homepage, go with the one loads faster.&lt;/li&gt;
&lt;li&gt; If you are new to Javascript stay away from things you don't understand (means stay away from angular 2 or reactjs).&lt;/li&gt;
&lt;li&gt; Some people also go for creating a minimal framework themself (They say they only needed that much, so why to include 50kb more).&lt;/li&gt;
&lt;li&gt; Other way would be to get one which has everything you need.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Personally i would suggest to go for reactjs as they get new and shiny things first. (For now i am so much invested in angularjs, that i cannot leave it. But soon i will give vuejs a try).&lt;/p&gt;

&lt;p&gt;OK, it time for another shower thought here:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Be indistinguishable from native apps.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Native apps always have a sweet spot in user’s heart, let's change that in next chapter → ** &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-4-progressive-enhancements-7o3"&gt;Browsers&lt;/a&gt; .**&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>What makes your web app faster? (part 2, caching)</title>
      <dc:creator>Tej Pratap</dc:creator>
      <pubDate>Tue, 26 Nov 2019 12:27:04 +0000</pubDate>
      <link>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-2-caching-15ap</link>
      <guid>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-2-caching-15ap</guid>
      <description>&lt;h1&gt;
  
  
  What makes your web app faster? (part 2, caching)
&lt;/h1&gt;

&lt;p&gt;If you are looking to boost performance of you web application, then do read &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-1-databases-31fd"&gt;part 1&lt;/a&gt; of this series.&lt;/p&gt;

&lt;p&gt;So in last part i left you after saying;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Best way to use database is, not using it at all.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Reading database is nothing but reading a well organised file (that is why they are persistent, duh). With use of some amazing algorithms, they are queried, read and written.&lt;/p&gt;

&lt;p&gt;But reading a file comes with a cost in terms of cpu utilization and delay to serve those requests. This does not seem big problem when you are serving 4–5 requests per second, but as you reach something like 20–30 requests per second your database starts to show some strange behaviour in serving those requests.&lt;/p&gt;

&lt;p&gt;Suppose you run a web app like twitter (&lt;a href="https://blog.twitter.com/2013/new-tweets-per-second-record-and-how"&gt;which serves 143,199 tweets per sec&lt;/a&gt; and for read let's multiply that with 0.2 of &lt;a href="https://about.twitter.com/"&gt;313M Monthly active users&lt;/a&gt; which comes close to 8964257.4M reads per sec), It is not possible to query database for every new request, so, solution to this problem is &lt;a href="https://en.wikipedia.org/wiki/In-memory_database"&gt;&lt;strong&gt;in-memory databases&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  in-memory database
&lt;/h1&gt;

&lt;p&gt;Server today do not have any boundaries (not literally), they have huge processing power, petabytes of petabytes of storage and some terabytes of RAM. With this amazing specs we get liberty to do a lot of operations in runtime and store a lot of things in memory.&lt;/p&gt;

&lt;p&gt;Reading and writing to memory is faster than anything else, with this idea came concept of in-memory databases.&lt;/p&gt;

&lt;p&gt;There are 2 major solutions for in-memory database:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Redis&lt;/li&gt;
&lt;li&gt; Memcached&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are more but these are the famous once, and that's what i care about.&lt;/p&gt;

&lt;p&gt;Memcached is a little part of Redis, redis is much more than a in-memory key pair database, it has powerful data types, transactions with optimistic locking, fast message channels and much more.&lt;/p&gt;

&lt;p&gt;Twitter also uses redis, let me tell how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Tweets made are stored in redis with an associated key.&lt;/li&gt;
&lt;li&gt; Tweets are then pushed to users unique timeline which is also stored in redis (this could be the reason why you cannot update your tweet).&lt;/li&gt;
&lt;li&gt; There are more questions like what happens to timeline when user follows another user or unfollows a user, but this is how they give you amazing response time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, key points to note here:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Anything which has a large read request but less write request can be stored in a in-memory database.&lt;/li&gt;
&lt;li&gt; They can be blog, post or something like a tweet but not who liked post, comments of a post (these generally have a direct access with URL like /postid, /videoid).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If RAM is not a problem then there is no reason to not use a in-memory database.&lt;/p&gt;




&lt;h1&gt;
  
  
  Some more things that can be done on server side:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt; Choose a good server side language, because implementation to handle requests are done by those things, they handle your threads and all sorts of other stuff.&lt;/li&gt;
&lt;li&gt; Choose a language that can take proper advantage of your server capabilities. That means, it should use 64 bit data bus if provided, use all 8 or 16 cpu cores if provided.&lt;/li&gt;
&lt;li&gt; Here as well, you can use distributed system to form a cluster of servers use it as a load balancer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, some more golden words by me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Not everything has to be done on server.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Our server is stronger than ever so does our users devices, we will see how to use its power for some more performance boost with our client app in next chapter → &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-3-client-app-3hgl"&gt;&lt;strong&gt;Client App&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>What makes your web app faster? (part 1, databases)</title>
      <dc:creator>Tej Pratap</dc:creator>
      <pubDate>Tue, 26 Nov 2019 12:24:40 +0000</pubDate>
      <link>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-1-databases-31fd</link>
      <guid>https://dev.to/tejpratap/what-makes-your-web-app-faster-part-1-databases-31fd</guid>
      <description>&lt;h1&gt;
  
  
  What makes your web app faster? (part 1, databases)
&lt;/h1&gt;

&lt;p&gt;There is no sure shot way to make your app faster, it is a performance boost at each level of your app. Your database, server, caching, client app, user’s browser they all plays a major role in providing that smooth user experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  So, let’s begin.
&lt;/h1&gt;

&lt;p&gt;I will proceed like, databases → caching → client app → browser.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Databases:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today’s databases are fast, secure and has a lot of perks we do not even use.&lt;/p&gt;

&lt;p&gt;Databases can be divided into 3 categories (&lt;a href="https://en.wikipedia.org/wiki/Category:Types_of_databases"&gt;there are more&lt;/a&gt;):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Relational Databases&lt;/li&gt;
&lt;li&gt; noSQL Databases&lt;/li&gt;
&lt;li&gt; Graph databases&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And they all have there their purpose in software world and you cannot pick a noSQL database when your application need transactions or a relational database if you need to compute a deeper relation between two separate object.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Relational Databases
&lt;/h1&gt;

&lt;p&gt;If you want a great relational database you cannot go wrong with amazon’s &lt;a href="https://aws.amazon.com/redshift/"&gt;Redshift&lt;/a&gt; or if you want something at your own system you can use &lt;a href="https://www.postgresql.org/"&gt;postgreSQL&lt;/a&gt; which has been industry standard for a long time. (I use neither, because i don’t need one).&lt;/p&gt;

&lt;p&gt;Taking a step ahead, there are some new databases making buzz with their capability to use GPU (Graphics processing unit) for operations, performance results are killing everything else. &lt;a href="http://blazingdb.com/"&gt;BlazingDB&lt;/a&gt; was featured on TechCrunch Disrupt 2016 and it is the greatest i have seen so far.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. noSQL Databases
&lt;/h1&gt;

&lt;p&gt;They are hell lot faster than Relational database because they do not have any constraint system (unique, joins or something like autoincrement) Or any kind of transaction (commits or rollbacks).&lt;/p&gt;

&lt;p&gt;In noSQL universe &lt;a href="http://cassandra.apache.org/"&gt;cassandra&lt;/a&gt; was winning the war and most of the email providers still use cassandra as their way to go database, but lately a trend of startups with all javascript stack arrived since then &lt;a href="https://www.mongodb.com/"&gt;Mongodb&lt;/a&gt; is kicking everybody's ass. Both are fast, industry grade and powerful databases. (I’m using Mongodb, because kick-ass).&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Graph Databases
&lt;/h1&gt;

&lt;p&gt;They are relatively new in the game and i do not know much about them, Only that they are best if you want some deep analytics/relations between objects. They can filter results based on some crazy combination of links. I personally did not get a chance to use any of these databases. If you simply google “Graph Database” you get first result for &lt;a href="https://neo4j.com/"&gt;neo4j&lt;/a&gt;. So, i assume this is the best option available. But still, i do not have any evidence for this being the best.&lt;/p&gt;




&lt;p&gt;So, now you know which one is best in what category. Choosing correct database is a crucial part, once you have set your heart on a one it will be very hard to migrate to other one (there are plenty examples set by big companies for this).&lt;/p&gt;

&lt;p&gt;Now, all the databases have more or less same performance benchmarks and choosing one will not give you a solid upper hand in performance. So, to get the fastest performance, you have to follow these things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Optimize your query: the way you structure your query will play a major role in your database performance. Fine tune your queries.&lt;/li&gt;
&lt;li&gt; Minimal select: Do not select all properties (columns) as a query result. select only those you need at that point of time.&lt;/li&gt;
&lt;li&gt; Distributed database: Distributed database cluster can save your ass by a big margin but they are a little hard to setup/manage. In a simple setup, you can test a master-slave system that can increase your fault tolerance, can act as load balancer on a peak time.&lt;/li&gt;
&lt;li&gt; Computed data: If you can get some property by some simple mathematical computation then do that instead of selecting it from database, like percentage, profit, loss etc. Do not do it for complex operation like generating hash or finding mean of a large dataset.&lt;/li&gt;
&lt;li&gt; Opposite of point 3: Although your machine will be a lot faster than your database but in some cases like fuzzy search (soundex source), pattern recognition etc. Store computed result in the database and query with newly computed property.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Remember the next few golden words for database optimizations.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Best way to use database is, not using it at all.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Meaning of above quote will be explained in next part → &lt;a href="https://dev.to/tejpratap/what-makes-your-web-app-faster-part-2-caching-15ap"&gt;&lt;strong&gt;Caching&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
  </channel>
</rss>
