{
    "componentChunkName": "component---src-templates-note-note-js",
    "path": "/notes/Databases",
    "result": {"data":{"mdx":{"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Summary of different database engines and popular databases can be found here - \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://docs.google.com/spreadsheets/d/1xVUd1tN-05R00kj18hc3NiIxDonKX48LMCYXfFEniqE/edit#gid=1136247025\"\n  }, \"https://docs.google.com/spreadsheets/d/1xVUd1tN-05R00kj18hc3NiIxDonKX48LMCYXfFEniqE/edit#gid=1136247025\")), mdx(\"p\", null, \"For practising SQL queries online check - \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://onecompiler.com/mysql\"\n  }, \"https://onecompiler.com/mysql\")), mdx(\"h2\", null, \"Database normalisation\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://chatgpt.com/c/691d44c6-4140-8324-ba33-bf5a2f7dbd2e\"\n  }, \"https://chatgpt.com/c/691d44c6-4140-8324-ba33-bf5a2f7dbd2e\")), mdx(\"h2\", null, \"Indexes\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/indexes\",\n    \"title\": \"indexes\"\n  }, \"indexes\"), \" reduce the query time to constant time\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/tradeoff\",\n    \"title\": \"tradeoff\"\n  }, \"tradeoff\"), \"\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"addition space used for storage\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"in a service we used index storage was 3 times that of the actual data.\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"latency during the writes\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"if read to write ratio is high we don't need to worry about it\"))))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"indexes are like hash tables\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\\\"This means that indexes use a proportional amount of disk space and require I/O when being updated\\\"\"), mdx(\"li\", {\n    parentName: \"ol\"\n  })), mdx(\"h2\", null, \"TODO\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"I read recently that graph databases can be used in most scenarios. Need to read up more to validate this.\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"#todo \"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Read more about how indexes actually work in databases\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"and the tradeoffs here\")))), mdx(\"h2\", null, \"Tools\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Extension for \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/@code\",\n    \"title\": \"@code\"\n  }, \"@code\"), \"  -\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://topshot.medium.com/dbizzy-56652b107819\"\n  }, \"https://topshot.medium.com/dbizzy-56652b107819\"))), mdx(\"h2\", null, \"Tips\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Whatever client you use see if it supports \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/ER-diagrams\",\n    \"title\": \"ER diagrams\"\n  }, \"ER diagrams\"), \"\"), mdx(\"li\", {\n    parentName: \"ol\"\n  })), mdx(\"h2\", null, \"Further Exploration\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Graph-DB\",\n    \"title\": \"Graph DB\"\n  }, \"Graph DB\"), \"**\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Graphql\",\n    \"title\": \"Graphql\"\n  }, \"Graphql\"), \"\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Sparql\",\n    \"title\": \"Sparql\"\n  }, \"Sparql\"), \"\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"\", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Redash\",\n    \"title\": \"Redash\"\n  }, \"Redash\"), \"\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Optimisation of queries\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Use \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"EXPLAIN (format json)\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"Paste the execution plan in \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://tatiyants.com/pev/#/plans/new\"\n  }, \"https://tatiyants.com/pev/#/plans/new\")), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"You get an out put on the lines of \"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"![](\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://i.imgur.com/GBgSNUZ.png\"\n  }, \"https://i.imgur.com/GBgSNUZ.png\"), \")\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"N+1 queries -  \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://medium.com/doctolib/understanding-and-fixing-n-1-query-30623109fe89\"\n  }, \"https://medium.com/doctolib/understanding-and-fixing-n-1-query-30623109fe89\"), \" \"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"MVCC - \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://chat.openai.com/c/d9f1e3a9-b80d-4baa-b3d3-867addd0fe9a\"\n  }, \"https://chat.openai.com/c/d9f1e3a9-b80d-4baa-b3d3-867addd0fe9a\"), mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"conflict resolution strategy\"))), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"PostGres Primer\", mdx(\"ol\", {\n    parentName: \"li\"\n  }, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://github.com/vishesh92/pg-primer?lphiltid=621758b00a002303fc878a4e\"\n  }, \"https://github.com/vishesh92/pg-primer?lphiltid=621758b00a002303fc878a4e\"), \" by \", mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"/notes/Vishesh-from-Blinkit\",\n    \"title\": \"Vishesh from Blinkit\"\n  }, \"Vishesh from Blinkit\"), \"\")))), mdx(\"p\", null, \"How to Improve Database Performance: The Ultimate Guide \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.percona.com/blog/ultimate-guide-to-improving-database-performance/\"\n  }, \"https://www.percona.com/blog/ultimate-guide-to-improving-database-performance/\")), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\"\n  }, \"1. \\n\")), mdx(\"h2\", null, \"AI tools\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://www.sqlai.ai/app/generate-sql\"\n  }, \"https://www.sqlai.ai/app/generate-sql\")), mdx(\"li\", {\n    parentName: \"ol\"\n  })), mdx(\"h2\", null, \"Other Sources\"), mdx(\"p\", null, mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://db-engines.com/en/system/Amazon+Aurora%3BMongoDB%3BMySQL%3BPostgreSQL%3BRedis\"\n  }, \"https://db-engines.com/en/system/Amazon+Aurora%3BMongoDB%3BMySQL%3BPostgreSQL%3BRedis\"), \" \"), mdx(\"h2\", null, \"Unstructured learning\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://gokulnk.com/curious-about/database\"\n  }, \"https://gokulnk.com/curious-about/database\")), mdx(\"li\", {\n    parentName: \"ol\"\n  })));\n}\n;\nMDXContent.isMDXComponent = true;","inboundReferences":[{"id":"4e8fbdbd-771a-5f2d-90b3-2e66356dc18e","slug":"consistency-versus-concurrency"},{"id":"63ac2425-14c9-5078-b8fd-b766a889a5dd","slug":"sharding-versus-partitioning"},{"id":"bf5e9f9b-9094-5814-89b1-2497ccdc5a24","slug":"dailynotes/18-09-2021"}]}},"pageContext":{"slug":"Databases","node":{"childMdx":{"slug":"Databases"}}}},
    "staticQueryHashes": []}