{"id":9932,"date":"2021-04-07T09:27:37","date_gmt":"2021-04-07T07:27:37","guid":{"rendered":"https:\/\/www.makingscience.com\/blog\/serverless-data-lakes-are-easy-to-create-with-google-bigquery-but-how-do-you-keep-them-running-efficiently\/"},"modified":"2021-04-07T09:27:37","modified_gmt":"2021-04-07T07:27:37","slug":"serverless-data-lakes-are-easy-to-create-with-google-bigquery-but-how-do-you-keep-them-running-efficiently","status":"publish","type":"post","link":"https:\/\/www.makingscience.com\/en\/blog\/serverless-data-lakes-are-easy-to-create-with-google-bigquery-but-how-do-you-keep-them-running-efficiently\/","title":{"rendered":"Serverless data lakes are easy to create with Google BigQuery. But, how do you keep them running efficiently?"},"content":{"rendered":"<div>Serverless data lakes are easy to create with Google BigQuery. But, how do you keep them running efficiently?<\/div>\n<div>Google\u2019s BigQuery serverless data warehouse makes life so much easier and so much safer in terms of having all the data in one location however, the house-keeping and data governance are left for you to administer and manage.  At Making Science we work with numerous Google BigQuery customers, some small, some large and some very large corporate groups. Most of our experience shows that customers are rolling out data governance tools but most of our customers are typically still offering the \u201cSQL knowledgeable\/connected\u201d departments direct access to BigQuery. This all in the spirit of self-service analytics moving their business to be more data driven.  Even with the advances of Google\u2019s data catalog and data governance capabilities, the data administrators are left with challenges keeping data lakes and data warehouses operating efficiently.  The Making Science teams are always looking for ways to make themselves more effective at performing their work with the construction of methodologies and tools. Making Science has tools specifically for Data Quality projects, Data Discovery and a most recent addition is BigQuery Intelligence. The tool offers value to the roles presented in the data governance model below:  <img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-4293\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/BigQuery-Intelligence-Blog-content.jpg\" alt=\"\" width=\"960\" height=\"540\" \/>  The BigQuery Intelligence tool was built to help the data warehouse\/lake architects\/administrators\/custodians manage house-keeping activities regarding datasets, tables and views and optimize these same objects. Many of our larger and very large customers have 100\u2019s of datasets and 100\u2019s of tables and 100\u2019s of views within each dataset making it very challenging to keep on-top of house-keeping activities.  BigQuery offers data lake administrators a simple visual interface to list datasets, tables and views. The BigQuery explorer panel interface allows you to collapse tables and views under their given dataset simplifying the visualization.  <img decoding=\"async\" class=\"size-full wp-image-4294 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-6.png\" alt=\"\" width=\"295\" height=\"85\" \/>  But the BigQuery Explorer does not offer data lake administrators a simple visual interface to understand usage statistics regarding datasets, tables and views; this is where BigQuery intelligence collects underlying data previously collected by the GCP + BigQuery environment and offers visualizations to understand the usage patterns across the nodes in the data warehouse.  The Data Scientists and Data Engineers at Making Science had a look and determined that a tremendous amount of data lake usage statistics are available in GCP but missing an easy means to retrieve the data and visualize the usage patterns in the data lake. The team decided to apply Sankey visualizations built using Python and D3 to the problem to facilitate understanding the usage patterns between the nodes (datasets, tables, views and jobs\/queries) in the data warehouse.  <img decoding=\"async\" class=\"size-full wp-image-4295 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-2.png\" alt=\"\" width=\"512\" height=\"303\" \/>  As the team worked with some very large data lakes they quickly found it necessary to allow data custodians to apply filters to limit views of the data lake to make the Sankey diagram more readable. Most typically they would select logical groupings of datasets to give a complete view but without making the visualization undecipherable. BigQuery Intelligence actually allows filtering both on datasets and tables.  <img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4296 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/Captura-de-pantalla-2021-04-07-a-las-11.18.56.png\" alt=\"\" width=\"317\" height=\"269\" \/>  The team also found that by including the possibility to define color based on criteria; by default, the color criteria is &#8220;dataset&#8221; so that each dataset is distinguished by a specific color in the Sankey visualization.  <img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4297 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-3.png\" alt=\"\" width=\"512\" height=\"465\" \/>  The team decided to include a &#8220;change color criteria&#8221; filter, where we can choose between additional criteria including: bytes, jobs, inherited jobs, recency and inherited recency. With this kind of plot, we can check if there exist inefficient nodes in the data lake. <\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4298 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-2-1.png\" alt=\"\" width=\"512\" height=\"268\" \/><\/h3>\n<h3><\/h3>\n<h3><strong>HotSpots<\/strong><\/h3>\n<p> A couple of use cases helped by changing the color criteria is the location of &#8220;hot spots&#8221;, i.e. those nodes which process too many bytes or have too many jobs, and \u201ccold spots\u201d or those nodes that have not been used in a long time and hence could be be removed\/deleted from the data lake. In the following screenshot we can see that the color indicates the volume of data each node has processed. Red indicates too much, and green indicates a reasonable volume. Grey indicates that we don&#8217;t have information about this particular node. It is interesting to see nodes that have a deep level and are very red. This usually means that those nodes could be optimized by creating aggregated\/intermediate tables. <\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4299 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-1-1.png\" alt=\"\" width=\"512\" height=\"326\" \/><\/h3>\n<h3><\/h3>\n<h3>Unused nodes<\/h3>\n<p> If we change the color criteria to &#8220;inherited recency&#8221;, we can search for nodes that have not received any query\/job in a long time. The meaning of &#8220;inherited&#8221; is that we take the smallest recency among one node and its children, given that if one child node receives a job, in some way, the parent node also receives that job. Here, red indicates a very high inherited recency and green indicates very small inherited recency. Grey, indicates that we have no info about the particular node. We could analyze the plot to search for unused nodes (red and grey) and clean the data lake. <\/p>\n<h3><img decoding=\"async\" class=\"size-full wp-image-4295 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/unnamed-2.png\" alt=\"\" width=\"512\" height=\"303\" \/><\/h3>\n<h3>Metrics<\/h3>\n<p> The team included a mouse over capability to display relevant metrics of a node, as you can see in the following screenshot: <\/p>\n<h3><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4300 aligncenter\" src=\"https:\/\/www.makingscience.com\/wp-content\/uploads\/2021\/04\/pasted-image-0.png\" alt=\"\" width=\"347\" height=\"596\" \/><\/h3>\n<h3>The Conclusion<\/h3>\n<p> Making Science teams, acting as Data Custodians for some of our customers, have found is that conversations with Data Business Owners\/Stewards regarding optimizations and housekeeping are greatly facilitated by the use of the BigQuery Intelligence tool. Sitting down with the Data Steward with data and visualizations in hand enables a transparent, data driven conversation.  The value to the business from a tool such as BigQuery Intelligence comes in the form of improved performance for systems accessing\/consuming the data and ensures a reduced GCP operating costs.  The Making Science team members have feature additions already in the works and we will share some of the use cases and the corresponding benefits as they are available.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Serverless data lakes are easy to create with Google BigQuery. But, how do you keep them running efficiently? Google\u2019s BigQuery serverless data warehouse makes life so much easier and so much safer in terms of having all the data in one location however, the house-keeping and data governance are left for you to administer and [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":9941,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[824,848],"tags":[65,57],"class_list":["post-9932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-en","category-google-cloud-en","tag-bigquery","tag-data-analytics"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/posts\/9932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/comments?post=9932"}],"version-history":[{"count":0,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/posts\/9932\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/media\/9941"}],"wp:attachment":[{"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/media?parent=9932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/categories?post=9932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.makingscience.com\/en\/wp-json\/wp\/v2\/tags?post=9932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}