Database Design for DNN Developers Sebastian Leupold.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
Dr Gordon Russell, Napier University Unit Data Dictionary 1 Data Dictionary Unit 5.3.
11 3 / 12 CHAPTER Databases MIS105 Lec14 Irfan Ahmed Ilyas.
Shawn McClure Software Engineer CIRA, Colorado State University Projects: Visibility Information Exchange Web.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Chapter 1 Introduction to Databases
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Module 5: Data Access. Overview Introduce database components involved in data access Introduce concepts of Transact -SQL and Procedural SQL as tools.
Localization Roadmap Content Localization in DNN neXt Sebastian Leupold.
Chapter 9: Creating Database Conventions & Standards MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide (70-443)
Module 17 Storing XML Data in SQL Server® 2008 R2.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
Data Administration & Database Administration
Functions Lesson 10. Skills Matrix Function A function is a piece of code or routine that accepts parameters and stored as an object in SQL Server. The.
RDB/1 An introduction to RDBMS Objectives –To learn about the history and future direction of the SQL standard –To get an overall appreciation of a modern.
Database Technical Session By: Prof. Adarsh Patel.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
CODD’s 12 RULES OF RELATIONAL DATABASE
DBSQL 14-1 Copyright © Genetic Computer School 2009 Chapter 14 Microsoft SQL Server.
NoSQL Databases NoSQL Concepts SoftUni Team Technical Trainers Software University
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
5/24/01 Leveraging SQL Server 2000 in ColdFusion Applications December 9, 2003 Chris Lomvardias SRA International
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Module 4 Designing and Implementing Views. Module Overview Introduction to Views Creating and Managing Views Performance Considerations for Views.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Visual Programing SQL Overview Section 1.
Indexes and Views Unit 7.
GLOBEX INFOTEK Copyright © 2013 Dr. Emelda Ntinglet-DavisSYSTEMS ANALYSIS AND DESIGN METHODSINTRODUCTORY SESSION EFFECTIVE DATABASE DESIGN for BEGINNERS.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Session 1 Module 1: Introduction to Data Integrity
Chapter 3: Relational Databases
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
Retele de senzori Curs 2 - 1st edition UNIVERSITATEA „ TRANSILVANIA ” DIN BRAŞOV FACULTATEA DE INGINERIE ELECTRICĂ ŞI ŞTIINŢA CALCULATOARELOR.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Enterprise Database Systems Introduction to SQL Server Dr. Georgia Garani Dr. Theodoros Mitakos Technological.
SQL Triggers, Functions & Stored Procedures Programming Operations.
 What is DB Testing ?  Testing at the Data Access Layer  Need for Testing DB Objects  Common Problems that affect the Application  Should Testers.
SQL Basics Review Reviewing what we’ve learned so far…….
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
In this session, you will learn to: Create and manage views Implement a full-text search Implement batches Objectives.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
Views / Session 3/ 1 of 40 Session 3 Module 5: Implementing Views Module 6: Managing Views.
In this session, you will learn to: Manage databases Manage tables Objectives.
Top 10 Entity Framework Features Every Developer Should Know
Visual Studio Database Tools (aka SQL Server Data Tools)
SQL Server 2000 and Access 2000 limits
Developing Production Quality SQL Code
Chapter 4 Relational Databases
Translation of ER-diagram into Relational Schema
Module 5: Implementing Data Integrity by Using Constraints
Database management concepts
Team Project, Part II NOMO Auto, Part II IST 210 Section 4
Data Model.
Database management concepts
Contents Preface I Introduction Lesson Objectives I-2
Best Practices in Higher Education Student Data Warehousing Forum
Presentation transcript:

Database Design for DNN Developers Sebastian Leupold

Microsoft MVP dnnWerk Verbund Deutschsprachige DNN-Usergroup DNN Localization Team German Translation of DNN

Agenda  Role of the Database in DNN  Data Design  Improve Performance  Structuring SQL Code for Re-Use  Security Concerns  Code Management  Sample

Role of the Database in DNN Data Store is an important decision: - Scaling - Performance - Security - Alternatives Simple Data Stores Relational Databases (RDBMS) NoSQL Datastores Database as Computation Engine Database as Consistent Data Container

Role of the Database in DNN /1 DNN Core and Module Templates provide CRUD i.e. Using the Database like a Fixed Length File Few Exceptions (GetUsersAdvancedSearch) Few “NoSQL” Attempts Few uses of XML in the core and 3 rd Party

Role of the Database in DNN /2 Benefits of an RDBMS - Data Types (optimal storage of data) - Unique and Check constraints (Validation) - Indexes (Performance) - Relations (Integrity, Joins) - Optimized for Mass Operations - Computation Engine - Self Optimizing (Table Statistics, Query Plan)

Role of the Database in DNN /3 Problem handling varying data schemas - Structure not available on Install - and/or - - Structure varies by object instance Abuse: UserProfile.ExtendedPermission Storing multiple values in a single text column Benefit  no extra table needed  Store structured objects with a single call Disadvantage  Not search/filter support by the database  No Protection against faulty data

Role of the Database in DNN /4 Handling varying data schemas Serializing Data (FnL) XML data type (with Schema) Abuse Text Store and ignore RDBMS features Using NoSQL Data Store

Role of the Database in DNN /5 Database as Computation Engine Complete Implementation as Business layer Using Stored Procedures, Transactions, Triggers Advantages  Fast Data Processing  Always Consistent Data Downside  not optimal for strings and “step by step” computing  Difficult error handling

Role of the Database in DNN /6 Database as Consistent Data Container  Implementing Rules enforcing Integrity:  Check Constraints  ForeignKey References  Access using “complete” Stored Procedures  Documentation  Naming Conventions  Descriptions  Developer Doc

Data Design Modelling the Use Case Using ORM (EF): Code First or Database First? Tables and Relations Normalization Using Proper Data Types (avoid old Text and nText) Default and Check Constraints Multiple Schemas and Naming Conventions

Improve Performance Understand SQL  Mass data handling vs. loops Indexes (Clustered, Primary, non-Primary) Retrieve Computed Results Computed Columns Indexed Views Schemabinding of Views

Structuring Code for Re-Use Custom Data Types  Limited support in SQL Server User Defined Functions (using Schemabinding)  3 Types (Static, inline TVF, multi-statement TVF)  Inline TVF preferred for large data  Static Functions make code easy to read and maintain Evaluate using Profiler! (ignored in query plans)

Security Concerns DDL statements (modify data structure, generate SQL Code) should be allowed upon install only Better if DNN would be using multiple Schemas  Metadata (core only)  Presentation Layer & Content Access Data only using Stored Procedures  More effort, but:  No risk of SQL injection  Easy to optimize Be careful with Dynamic Queries  SQL injection

Code Management Separate SQL Code (Views, Functions and Sprocs) from Updates of Data Structure (Tables.Columns) and Content Mark data updates being executed (upgrade scripts need to be re-runnable) Consider removing code and re-apply completely on each update: 1.Drop all your Views, Functions, Procedures 2.Migrate Data 3.Re-Create all Views, Functions, Procedures This allows you to manage versions of most of the code

Questions?