Top Banner
Don't Repeat Yourself An Introduction to Agile SSIS Development Cathrine Wilhelmsen Moderated by Regis Baccaro
55

Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Aug 06, 2015

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Don't Repeat Yourself

An Introduction to Agile SSIS Development

Cathrine Wilhelmsen

Moderated by Regis Baccaro

Page 2: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

2

Technical Assistance

2

Maximize your screen with the zoom button on the top of the presentation window

Type your questions in the question pane on the right side

Page 3: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

33

Thank YouPresenting Sponsors

Supporting Sponsors

Gain insights through familiar

tools while balancing monitoring

and managing user created

content across structured and

unstructured sources.

Unifying computer, storage,

networking, and virtualization, Cisco

UCS is the optimal database and

business intelligence platform for SQL

Server.

Solutions from Dell help you

monitor, manage, protect and

improve your SQL Server

environment.

www.microsoft.com www.cisco.com www.software.dell.com

Page 4: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Planning on attending PASS Summit 2015? Start saving

today!

• The world’s largest gathering of SQL Server & BI professionals

• Take your SQL Server skills to the next level by learning from the world’s SQL

Server experts, in over 190 technical sessions

• Over 5000 attendees, representing 2000 companies, from 52 countries,

ready to network & learn

Contact your Local or Virtual Chapter for an

additional $150 discount.$1795until July 12th, 2015

Page 5: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Cathrine Wilhelmsen

5

Data Warehouse Architect and Developer For the Norwegian financial company

Active in the Biml and SQL Server communityPASS Outstanding Volunteer, SQLSaturday Oslo Organizer and

SQL Server User Group Norway Board Member

cathrinewilhelmsen.net

@cathrinew

/in/cathrinewilhelmsen

Page 6: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Don't Repeat Yourself

An Introduction to Agile SSIS Development

Cathrine Wilhelmsen

Page 7: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

7

Session Description

SSIS (SQL Server Integration Services) is a powerful tool for extracting, transforming and loading data, but creating and maintaining a large number of SSIS packages can be both tedious and time-consuming. Even if you use templates and follow best practices you often have to repeat the same steps over and over again. Handling metadata and schema changes is a manual process, and there are no easy ways to implement new requirements in multiple packages at the same time.

It is time to bring the Don't Repeat Yourself (DRY) software engineering principle to SSIS projects. First learn how to use Biml (Business Intelligence Markup Language) and BimlScript to generate SSIS packages from database metadata and implement changes in all those packages with just a few clicks. Then take the DRY principle one step further and learn how to update all packages in multiple projects by separating and reusing common code. See how Biml allows you to complete in a day what once took more than a week!

7

Page 8: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

8

Who are you?

SSIS and ETL developer?

Easily bored?

Tired of repetitive work?

8

Page 9: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

9

Your work day?

Long development time?

Many SSIS packages?

Slow GUI editor?

9

Page 10: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

10

Ever experienced this?

10

New standards!

Yay...Job done!

Page 11: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Ready for a change?

Page 12: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

12

From Traditional SSIS to Agile SSIS

Traditional: Plumbing Agile: Business Logic

Page 13: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

13

Traditional SSIS: Plumbing

Time wasted on dragging, dropping, connecting, aligning

Create the same package over and over and over again with just a few changes

Standards, patterns and templates must be defined up-front

Changes must be done in every single package

High risk of manual errors

More packages, more time

13

Page 14: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

14

Agile SSIS: Business Logic

Spend time on what is unique in a package

Create a pattern once and reuse for all similar packages

Handle scope and requirement changes quickly and easily

Changes can be applied to all packages at once

Lower risk of manual errors

Longer time to start, but then reuse and scale

14

Page 15: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)
Page 16: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

16

Will Biml solve all your problems?

Probably not...

Biml is a tool for generating SSIS packages

Biml is not a pre-defined data warehouse framework

Biml is not a tool for automated deployment

...but it will solve many problems!

16

Page 17: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

17

How can Biml help you?

Timesaving: Many SSIS Packages from one Biml file

Reusable: Write once and run on any platform

Flexible: Start simple, expand as you learn

17

Page 18: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

18

What is Business Intelligence Markup Language?

Easy to read and write XML dialect

Specifies business intelligence objects

Databases, schemas, tables, columns

SSIS packages

SSAS cubes, facts, dimensions (not in free version)

Page 19: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

19

What do you need?

Page 20: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

20

How does it work?

Generated packages are indistinguishable from manually created packages

Page 21: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

21

Biml syntax

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 22: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

22

Biml syntax: Root Element

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 23: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

23

Biml syntax: Collection of Elements

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 24: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

24

Biml syntax: Elements

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 25: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

25

Biml syntax: Attributes

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 26: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

26

Biml syntax: Full vs. Shorthand Syntax

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 27: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

27

Biml files are placed in the Miscellaneous folder

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 28: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

28

Right-click on the Biml file to Generate SSIS Packages

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="EmptyPackage1"></Package>

<Package Name="EmptyPackage2"/>

</Packages>

</Biml>

Page 29: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

29

From Biml to SSIS

Page 30: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

30

From Biml to SSIS

Page 31: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

31

.biml vs .dtsx: human-readable vs ALL THE CODE!

31

(150% zoom) (20% zoom)

Page 32: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)
Page 33: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

33

The magic is in the

Extend Biml with C# or VB.NET code blocks

Import database structure and metadata

Loop over tables and columns

Add expressions to replace static values

Allows you to control and manipulate Biml code

Page 34: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

34

BimlScript code blocks

<#@ … #> Directives (Instructions to the BimlCompiler)

<# … #> Control Blocks (Control logic)

<#= … #> Expression Control Blocks (Replace block with string value)

<#+ … #> Class Feature Control Blocks (Create helper methods)

Page 35: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

35

BimlScript syntax

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<# foreach (var table in RootNode.Tables) { #>

<Package Name="Load<#=table.Name#>"></Package>

<# } #>

</Packages>

</Biml>

Page 36: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

36

BimlScript syntax: Control Blocks

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<# foreach (var table in RootNode.Tables) { #>

<Package Name="Load<#=table.Name#>"></Package>

<# } #>

</Packages>

</Biml>

Page 37: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

37

BimlScript syntax: Expression Control Block

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<# foreach (var table in RootNode.Tables) { #>

<Package Name="Load<#=table.Name#>"></Package>

<# } #>

</Packages>

</Biml>

Page 38: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

38

How does it work?

Page 39: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

39

Yes, but how does it work?

39

Page 40: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

40

Yes, but how does it actually work?

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<# foreach (var table in RootNode.Tables) { #>

<Package Name="Load<#=table.Name#>"></Package>

<# } #>

</Packages>

</Biml>

<Biml xmlns="http://schemas.varigence.com/biml.xsd">

<Packages>

<Package Name="LoadCustomer"></Package>

<Package Name="LoadProduct"></Package>

<Package Name="LoadSales"></Package>

</Packages>

</Biml>

Page 41: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

41

Don't Repeat Yourself

Move common code to separate files

Centralize and reuse in many projects

Update code once for all projects

1. Split and combine Biml files

2. Include files

3. CallBimlScript with parameters

Page 42: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

42

Don't Repeat Yourself: Split and combine Biml files

Solve logical dependencies and simulate manual workflows by using tiers

Tiers instruct the BimlCompiler to compile files from lowest to highest tier

<#@ template tier="1" #>

Higher tiers can use and might depend on objects from lower tiers

Tier 1 - Create database connections

Example: Tier 2 - Create loading packages

Tier 3 - Create master package to execute loading packages

Page 43: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

43

Split and combine multiple Biml files

1. Create Biml files with specified tiers

2. Select all the tiered Biml files

3. Right-click and click Generate SSIS Packages

1

2

3

Page 44: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

44

Don't Repeat Yourself: Include files

Include common code in multiple files and projects

Can include many file types: .biml .txt .sql .cs

Use the include directive

<#@ include file="CommonCode.biml" #>

The include directive will be replaced by the content of the included file

Include pulls code from the included file into the main file

Page 45: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Don't Repeat Yourself: Include files

45

Page 46: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

46

Don't Repeat Yourself: CallBimlScript with parameters

Works like a parameterized include

File to be called (callee) specifies the input parameters it accepts

<#@ property name="Table" type="AstTableNode" #>

File that calls (caller) passes input parameters

<#=CallBimlScript("CommonCode.biml", Table)#>

CallBimlScript pushes parameters from the caller to the callee, and

the callee returns code

Page 47: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Don't Repeat Yourself: CallBimlScript with parameters

47

Page 48: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Don't Repeat Yourself: CallBimlScript with parameters

48

Page 49: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Dem

o

Page 50: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

50

What do you do next?

1. Download BIDS Helper

2. Identify your SSIS patterns

3. Rewrite one SSIS package to Biml

(Not possible to reverse-engineer SSIS to Biml in BIDS Helper)

4. Expand with BimlScript

5. Separate and reuse common Biml code

6. ...never look back to the days of drag&drop

7. Get involved in the SQL Server and Biml community!

Page 51: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

51

Biml on Monday...

…BimlBreak the rest of the week

Page 52: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

52

Thank you!

@cathrinew

cathrinewilhelmsen.net

no.linkedin.com/in/cathrinewilhelmsen

[email protected]

cathrinewilhelmsen.net/biml

slideshare.net/cathrinewilhelmsen

Page 53: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Questions?

Page 54: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

Thank You for AttendingFollow @pass24hop

Share your thoughts with hashtags

#pass24hop & #sqlpass

Page 55: Don't Repeat Yourself - An Introduction to Agile SSIS Development (24 Hours of PASS)

The Data Loading Performance

Presentation

Matan Yungman

Coming Up Next …