Skip to main content

SQL Azure Elastic Pools - Review

ערב טוב
אז זהו הגיע זמן הפוסט על "SQL Azure Elastic Pools", ניסינו - התנסינו - למדנו ועכשיו יודעים על זה דבר או שניים.
ראשית זהו כלי בעל פוטנציאל מדהים שכאשר יעבוד חלק ויושלמו כל המרכיבים שלו זה שינוי מהותי.
שנית הוא בשל חלקית - אבל ככה היום עושות כל חברות הווב - מובייל - ענן... מוציאות משהו שלם לחצאין ונתנים לקהל להיות ה QA. אני מקבל את זה וזורם עם זה.

את הפוסט הזה אחלק ל 4 חלקים:
  1. הסבר קצר ולינקים להסברים על המוצר ועל חלקיו השונים.
  2. הסבר ודוגמאות על מה רואים בפורטל בחלקים השונים
  3. מהם ג'ובים? כיצד הם פועלים ומה האפשרויות מהם.
  4. מה הלאה...
נתחיל בהסבר קצר ובלינקים: המוצר הזה נועד להכניס לפול אחד מספר בסיס נתונים באותו שרת (נקווה שבעתיד הפול יוכל להכיל מספר שרתים), וכשהם בפול אחד ישנה דינמיות בהקצאת המשאבים בין בסיס הנתונים - אם עד היום כל בסיס נתונים היה יישות עצמאית בעלת יכולת עבודה וביצועים משלה ה DTU היה רק שלה, פה מכניסים לפול אחד מספר בסיסי נתונים וההגדרה של הסטורג' ושל ה DTU היא לא ברמת בסיס נתונים אלא ברמת הפול.
אם עד היום בסיס נתונים אחד מהדרגה S0 היה יכול להיות עד 250 GB, היום אם מכניסים אותו ועוד בסיס נתונים אחד לפול ואפשר במקסימום עד 1200 GB שזה שיםור עצום - אולם אם נכניס 15 בסיס נתונים תהיה לנו הרעה בהקצאת הסטורג'.
ואותו הדבר לביצועים - עם הזמן נלמד היכן האיזון.
זו ההגדרה של הפול באופן כללי מאד.
הלינקים הרלוונטים של איך יוצרים ומשתמשים מצא פה:

 
 

ומכאן לנקודה השניה מה רואים בפורטל ואיך זה בעצם עובד:

זו תמונה מעמוד הביית של הפורטל
אנו רואים פה קיצורי דרך לרכיבים הקריטיים של ה Pool. אני הולך משמאל לימין:
 
Resource Group (I know I need to explain abut that too) - of all my components in the pool
Sql Server V12 that hold few DB's that exists in the Pool
Elastic Pool itself
Resource Group  that holds the components  related to Jobs
 


אלו קיצורי הדרך והסימנים החשובים עכשיו נלחץ על ה - Pool עצמו ונראה מה רואים - אני פתחתי פה שני Blaeds - זוכרים את המושג הזה? אם היינו בשנות ה 80 היינו אומרים זה כמו ה windows - היום בעידן המובייל אלו מסכי הזזה....

מה רואים פה? ובכן ב etoro אני עובדים במקום מסויים באפליקציה על Shards DB's, הם חייבים להיות זהים מבחינת הסכמה ומאוזנים בביצועים. האפליקציה כותבת לכל Shard לפי טבלת מיפויים ובכך מאוזנת גם בקריאה וגם בכתיבה. פה אדגים מה רואים ב Elastic Pool על 4 בסיסי נתונים שיש ב Pool:
  1. גרף קטן שמראה תנודות של DTU וסטורג' ברמת ה Pool
  2. הגדרת ה Pool
  3. מה המקסימום DTU שיש ברמת בסיס הנתונים שנמצא ב Pool וכך אפשר לראות מי צרכן כבד או על חוסר איזון
  4. גרף קטן שמראה את מה שהטבלה מראה...
  5. קונפיגורציה של ה Pool: גרף קטן שמראה כמה אנו מנצלים מהגדרת ה storage של ה Pool וה DTU של ה Pool. וכפתורי לחיצה כאשר ההגדרה היא פה מה המקסימום שה Pool יוכל להגיע הן ברמת DTU והן ברמת Storage - רק היום הודיעו שהמינימום ירד ל 100 - דבר שמוריד הרבה עליות למי שרק בודק את המערכת.
  6. קונפיגורציה של ה Pool: גרף קטן שמראה כמה אנו מנצלים מהגדרת ה DTU של ה Pool ברמת בסיס נתונים אחד. וכפתורי לחיצה כאשר ניתן להגדיר מינימום ומקסימום לכל DB



ועכשיו אחרי שברור איך מקנפגים ומה רואים נעבור לעולם התוכן השני שזה הג'ובים: כשמו - לא - כן הוא זהו תהליך הרצה שניתן להריץ שוב ושוב של T-SQL אולם כרגע אי אפשר לקבוע לו לוח זמנים.

למה זה טוב?
זה מעולה הוא מריץ על כל בסיסי הנתונים שב Pool את אותו ה Query אם זה עידכון סטטיסטיקות - ואם זה  Deploy חד פעמי. במקום לעבור בסיס נתונים אחד אחד זה רץ על הכל..
גונב לאוזניי שממש בקרוב יהיה ניתן לעבוד בבסיס נתונים אחד עם כמה
external data source
שזה אומר שתוכל לעבוד מול בסיס נתונים אחרים או משהו כזה אבל זה לא כרגע...

בקיצור לוחצים על הלינק  של יצירת ג'וב


נוצרים מספר רכיבים ב Azure שמנהלים את הג'ובים - בעיקרון רכיבים אלו שקופים מבחינתינו מלבד התשלום החודשי - אבל באמת זהו סכום אפסי. יש פה אפליקציה, סטורג, ובסיס נתונים.
זהו ה
 Resource Group  that holds the components  related to Jobs
שהזכרתי למעלה.


 
 
מכיוון שאני אוהב בסיס נתונים וזהו בסיס הנתונים הרלוונטי שהוא כמו MSDB:
 
 
נחזור לג'ובים - אחרי שיצרנו את כל הרכיבים ניתן לייצר כמה ג'ובים שרוצים פשוט ממלאים יוזר וססמא שהם אחידים בכל בסיסי הנתונים.  הנה דוגמא לרשימה של ג'ובים כאשר לכל אחד ניתם להיכנס ולהריץ מחדש - כאמור עדיין אין אפשרות לקבוע לוז ריצה קבוע.
 
 
 
ניתן לראות לוגים של  הצלחות של הג'ובים ברמה כללית וברמה של כל DB לעצמו:
 
 
 
וניתן לראות לוגים של  כשלונות של הג'ובים ברמה כללית וברמה של כל DB לעצמו:
 
 
 
 
עד כאן.
 
לסיכום:
בצורה קלה ומהירה אפשר לייצר ישות חדשה בעולם ה SQL Azure DB, יישות שנקראת POOL והיא יישות ברמת תשלומים וברמת ניהול.
היא מתאימה לצרכים מסויימים כמו שירותים SAASים  או Shards - אבל אם נחשוב מחוץ לקופסא יש פה פוטנציאל למשהו הרבה יותר רחב.
 
נסו ותהנו
פיני


Comments

  1. Once you’ve decided on a method, merely choose it and follow the instructions. Of course, you’ll need to have some data prepared depending on the strategy you’re using. For instance, card payments would require your card number, expiration date, and CVC code. The 파라오카지노 excellent news is virtually all|that the majority} casino deposit strategies are instant, so find a way to|you presumably can} play immediately.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to restore deleted Azure Synapse dedicated SQL pool

  Existing dedicated pool can be easily restored from Azure portal or PowerShell command, but for now deleted pool could be restored from PowerShell only! Example: # Connect to Azure with system-assigned managed identity $AzureContext = (Connect-AzAccount -Identity).context # set and store context $AzureContext = Set-AzContext -SubscriptionName $AzureContext.Subscription -DefaultProfile $AzureContext # $AzureContext = Set-AzContext -SubscriptionName $SubscriptionName -DefaultProfile $AzureContext $SubscriptionName="Databases" $ResourceGroupName="stg-rg-we" $ServerName="stg-synapse-we"   $DatabaseName="sql_we_2023_11_07_13_42" $NewDatabaseName="sql_dp_we_deleted" ######################################## $token = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token $SubscriptionId = "ce088f9e-1111111a3914b" $DedicatedPoolEndPoint = "stg-synapse-we.sql.azuresynapse.net" $DedicatedPoolName = $DatabaseNam...

The journey to the Lakehouse

A long time has passed since the last post, we have gone through a long and tedious journey to adapt what Azure offers us, to our needs. Our needs were simple, the Current Datawarehouse (SQL Server on VM inazure) served the BI. ML teams worked on GCP, we want to let both teams to work on Azure in a platform that will have the ability to scale and will not fail every 2 days. We checked: Snowflake on azure Synapse analytics GCP We decided to go for the full Azure product for the reasons: Migration time support costs Synapse as a platform contains many components, and the challenge was to find what fits  us as an organization and as a group. The knowledge of the people and their abilities influenced the plans. Here's what we planned and what we did: We start to put everything in the Data Lake in parquet or delta format, build on top of Azure ADLS gen 2. We had to move some data to T-SQL compatible platform, so this involves setting up a dedicated Synapse pool , which is a fully man...

Configuring secondary database in Azure SQL DB - Bug found

Hi All Last week we had an issue with a secondary DB in geo replication and fail over group. To make the long story short we had to delete the secondary and recreate a secondary from scratch . And now let me tell you the story, we build a DB in P6 tier - very high, expensive and highly available. Then we add a geo replication copy via the platform, like it shows here. This is take from MSFT documentation: https://docs.microsoft.com/en-us/azure/azure-sql/database/active-geo-replication-overview It is written:  " Both primary and secondary databases are required to have the same service tier. It is also strongly recommended that the secondary database is created with the same backup storage redundancy and compute size (DTUs or vCores) as the primary. If the primary database is experiencing a heavy write workload, a secondary with lower compute size may not be able to keep up with it. That will cause redo lag on the secondary, and potential unavailability of the secondary. To mit...