Sql Data Services
Upcoming SlideShare
Loading in...5
×
 

Sql Data Services

on

  • 1,589 views

January 24, 2009 presentation to So Cal Code Camp at Cal State Fullerton - A real live web site with SQL Data Services.

January 24, 2009 presentation to So Cal Code Camp at Cal State Fullerton - A real live web site with SQL Data Services.

Statistics

Views

Total Views
1,589
Views on SlideShare
1,586
Embed Views
3

Actions

Likes
0
Downloads
34
Comments
0

2 Embeds 3

http://www.slideshare.net 2
http://www.brijj.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Sql Data Services Sql Data Services Presentation Transcript

  • A Real World Web Site with SQL Data Services So Cal Code Camp January 24-25, 2009 James Johnson Inland Empire .NET User’s Group [email_address] www.iedotnetug.org
  • About me
    • Founder and President, Inland Empire .NET User’s Group. Past 5 years in Riverside, San Bernardino Counties
      • www.iedotnetug.org
    • Executive Director, Geeks Without Borders
      • www.geeks-without-borders.org
    • My Blog
      • www.duringlunch.com
    • Serial Netrepreneur
      • Latringo.com, ElSalvadorArtwork.com, TourElSalvador.com, 0AAFFF.com, AzureBlueCoding, AnonymousTypes.com, etc.
    • Last but not least
        • No bailar con monos borracho al comer su almuerzo.
  • More stuff
    • Have been developing software since i286 days
    • Educational CD-ROMs
    • If a mistake, had to redo the entire run
    • Started looking at ways to have dynamic data
    • Web development
      • Cold Fusion (yuck) , PHP (yikes) , ASP.NET (the promised land)
    • Met David Robinson on Code Trip (Feb 08)
    • The rest is history
  • SQL Data Services - Introduction
    • Agenda
    • What is SDS
    • How to setup the development environment
  • SQL Data Services - Introduction
    • SDS is a component of SQL Services
    • Integrated into the “cloud”
    • Provides database and querying
    • Flexibility
    • Scaling
    • Developer agility
  • SQL Data Services - Introduction
    • SDS is built on SQL Server and Windows Server
    • Quickly build and extend applications
    • Low cost management with high scalability
    • Reliability, and security features
  • SDS – Setting up the environment
    • Download Azure Services Training Kit
      • www.microsoft.com/azure/trainingkit.mspx
      • Contains Hands-on-labs (HOLs) for:
        • Windows Azure
        • .NET Services
        • Live Services
        • SQL Services
  • SDS – Setting up the environment
    • Sign up for the SDS Public CTP
      • http://go.microsoft.com/fwlink/?LinkID=133905&clcid=0x409
      • Sign up is free, but will ask for CC for verification
    • Create a Solution
      • Name and Password
      • Name of solution is the username when logging into system via code
  • SDS – Setting up the environment
    • SDS Developer Center
      • http://msdn.microsoft.com/en-us/sqlserver/dataservices/default.aspx
      • Link to change password for solution
    • SDS Primer
      • http://msdn.microsoft.com/en-us/library/cc512417.aspx
    • Getting Started Forum
      • http://social.msdn.microsoft.com/forums/en-US/ssdsgetstarted/threads/
  • Authorities, Containers, Entities
    • Authorities, Containers and Entities, Oh My
    • SDS data model is based on this concept
    • Provides flexible schema
    • Easy to create data structures
  • Authorities, Containers, Entities
    • Authorities
    • Topmost level of the hierarchy
      • anontypes-01
    • DNS name
      • https://anontypes-01.data.database.windows.net/v1
    • Maps to specific data center
    • Is a unit of geo-location
  • Authorities, Containers, Entities
    • Containers
    • Each container has unique id associated
    • Store the data contained in the application
    • Cannot be in a different geo-located Authority
    • Can contain homogeneous or heterogeneous data
  • Authorities, Containers, Entities
    • Entities
    • Actual bits of data stored in container
    • Stores any number of user-defined properties/values
    • Retrieved, added, updated, deleted
    • Partial updates are not supported
    • Entire entity is replaced in container when updated
  • Homogenous/Heterogeneous Data
    • Homogeneous data is similar to a database table, in which all entities are of the same kind
    • Books container stores “book” entities
    • Highly structured applications should use
    • Heterogeneous data contains all types of entities
    • MyOffice container stores “books”, “supplies”, “furniture”
    • Allows for querying across all entities in parent container
  • Flexible Entities
    • Key concept of SDS
    • XML fragment with one element per property value.
    • Value restricted to simple scalar type of string
      • String, binary, Boolean, decimal, datetime
    • Fixed metadata properties – Id, Version, Kind
      • Version. New version assigned with each update
      • Kind. User-defined, identifying the entity type
  • Anonymous Types
    • A new podcasting website featuring the little known development geeks
    • Site runs on a hosted server
    • Data is hosted on SQL Data Services
    • Leads to differences in how we work with data
    • When using REST, return types are XML
    • Need to use LINQ
  • Differences to remember
    • An Entity is like a property bag – keys/values
    • Each Entity in a Container can have a different structure
    • Different paradigm than when working with database tables
    • There is no “primary key”, instead an “EntityID”
      • User defined value
  • Containers
    • Can contain heterogeneous, homogeneous, or flexible entities
    • For this project decided to have four Containers
      • at_page
      • at_podcast
      • at_podcastdata
      • at_guest
  • Site structure
    • Administer text data
    • Upload and administer BLOB’s (podcasts)
      • Demo only shows uploading – not streaming down
    • Standard ASP.NET Membership, Roles, Authentication for Admin pages
    • Classes for different aspects of site functions
      • Pages, Podcasts, Guests, Configuration, Utilities
  • Using REST
    • POST (Insert, Create)
    • PUT (Update)
    • GET (Retrieve)
    • DELETE (Delete)
  • Page Administration
    • Insert, Save, Edit, Delete
    • Page code creates XML passed to the class
    • Methods
      • SelectPages()
      • SelectPage()
      • InsertPage()
      • UpdatePage()
      • DeletePage()
    • Make sure to HtmlEncode strings going in HTML chars will mess things up with validity of the XML
  • Demo
    • Web site Page administration
  • Uploading PodCasts (BLOBs)
    • Uploading of BLOBs is possible, but can only send the object, no other data
    • Create two XML strings
      • PodCast
        • EntityId, Container, FilePath
      • PodCastData
        • Meta and other data about the PodCast
        • EntityId,Title, RunTime, Guest, Publish Date, etc.
      • Since two different containers, can have same EntityId
  • Uploading PodCasts (BLOBs)
    • Two step process
      • First insert the Meta data
        • Title, Guest, Description, etc.
      • If successful, upload the PodCast
  • Demo
  • Public facing side
    • One Master Page
      • Navigation, PodCast List
    • One Content Page
      • Page Content for different “pages”
  • Demo
    • Setting Navigation
  • Demo
    • Setting Page Content
  • Demo
    • Get All PodCasts
    • Uses Join between Containers so that we can get data back on the Guests as well
  • Demo
    • Get Single
    • Uses Join between Containers
    • Uses Where to get specific Pod Cast
  • Questions
  • Thank you
    • Email – [email_address]
    • Inland Empire .NET User’s Group
      • www.iedotnetug.org
      • 2 nd Tuesday evenings of each month – Riverside
    • Geeks Without Borders
      • www.geeks-without-borders.org
    • My Blog
      • www.duringlunch.com
    • Please tip your wait staff
    • PayPal address – members@iedotnetug.org
  • Thanks to our sponsors We could not hold these code camps for you without our sponsors. These Guys ROCK!