{"id":10430,"date":"2019-02-11T00:00:00","date_gmt":"2019-02-11T06:00:00","guid":{"rendered":"https:\/\/threecloud.wpengine.com\/post\/the-difference-between-elastic-pools-and-elastic-queries\/"},"modified":"2023-05-01T22:03:28","modified_gmt":"2023-05-02T03:03:28","slug":"the-difference-between-elastic-pools-and-elastic-queries","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/the-difference-between-elastic-pools-and-elastic-queries\/","title":{"rendered":"The Difference Between Elastic Pools and Elastic Queries"},"content":{"rendered":"<p><strong>Do you get elastic pools and elastic queries confused within Azure SQL Database?<\/strong> Many people do, probably because of the word elastic. <strong>Elastic Pools and Elastic Queries are two very different things and I\u2019m here to clear up any confusion.\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/ObLuU8asxGM\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>Recently, someone said to me, I want to do some elastic queries in Azure SQL Database, so I set up my elastic pool and I need help with the next steps. Well, first let me say, you don\u2019t need an elastic pool to do elastic queries in Azure SQL DB. Let me explain what each is:<\/p>\n<p><strong>Elastic Pool<\/strong><\/p>\n<ul>\n<li>An elastic pool is a set (or pool) of shared resources, or DTUs, that could be used by many databases in that pool.<\/li>\n<li>In a pool I set the number of DTUs and databases in that pool can scale up or down to use the available DTUs up to the maximum I\u2019ve set for that pool.<\/li>\n<li>The advantage is the scaling up\/down happens automatically. I don\u2019t have to set the service tier of each individual database to use a certain number of DTUs. By putting the databases in the pool, they have the pool DTUs available to them and as the workload increases or decreases, it will scale up or down the number of DTUs it uses.<\/li>\n<li>Pools are ideal when you have an application that is used by multiple customers. It\u2019s designed so each customer has its own database in the backend. Each database has the same identical schema and depending on how heavy or light each customer uses it, the pool will manage how the resources are used in each of the databases throughout the day.<\/li>\n<\/ul>\n<p><strong>Elastic Query<\/strong><\/p>\n<ul>\n<li>Elastic query is cross database queries. This is similar to how we used to do this with SQL Server on premises with linked services.<\/li>\n<li>We do elastic queries through external tables.<\/li>\n<li>To see what this looks like, the screenshot below is from SQL Server Management Studio and on it I have 2 sample databases; one is a sample OLTP and one is a sample DW.<img decoding=\"async\" style=\"width: 377px; display: block; margin: 0px auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2021\/09\/ElasticPoolsVsElasticQueries_04.jpg\" alt=\"ElasticPoolsVsElasticQueries_04\" width=\"377\" \/><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>If I want to use my data warehouse database to query data that\u2019s in my sample OLTP, I set up a cross database query or an external table from my data warehouse. To do this:\n<ul>\n<li>I first need to create an external data source in my data warehouse database. You can do that from the external resource folder, and it generates a sample script for you, there\u2019s no UI for you.<\/li>\n<li>I would script and create a data source and that will then make a reference, in this case to my OLTP database.<\/li>\n<li>Once I\u2019ve got that set up, I can create an external table. In Management Studio, your external tables are managed in a folder under Tables.<\/li>\n<li>When I create an external table, I\u2019m creating a pointer to a table (in my sample OLTP in this case). It\u2019s important to understand that when I create the external table in the data warehouse, it does not load the data from the OLTP, it\u2019s simply a pointer to it.<\/li>\n<li>Once I\u2019ve created that external table in my data warehouse pointing to the OLTP, a query executed from my data warehouse referencing this external table will read the data from the OLTP in this example \u2013 this is an elastic query.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>If you\u2019ve had any confusion about elastic pools vs elastic queries, I hope this cleared it up.<\/p>\n<p>Need further help? Our expert team and solution offerings can help your business with any Azure product or service, including Managed Services offerings. Contact us at 888-8AZURE or\u00a0 <a href=\"mailto:sales@3cloudsolutions.com\">sales@3cloudsolutions.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you get elastic pools and elastic queries confused within Azure SQL Database? Many people&mldr;<\/p>\n","protected":false},"author":32,"featured_media":9380,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[290,354],"tags":[],"class_list":["post-10430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-platform","category-infrastructure-cloud-platform","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=10430"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10430\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/9380"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=10430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=10430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=10430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}