0
A Real World Web Site with SQL Data Services So Cal Code Camp January 24-25, 2009 James Johnson Inland Empire .NET User’s ...
About me <ul><li>Founder and President, Inland Empire .NET User’s Group. Past 5 years in Riverside, San Bernardino Countie...
More stuff <ul><li>Have been developing software since i286 days </li></ul><ul><li>Educational CD-ROMs </li></ul><ul><li>I...
SQL Data Services - Introduction <ul><li>Agenda </li></ul><ul><li>What is SDS </li></ul><ul><li>How to setup the developme...
SQL Data Services - Introduction <ul><li>SDS is a component of SQL Services </li></ul><ul><li>Integrated into the “cloud” ...
SQL Data Services - Introduction <ul><li>SDS is built on SQL Server and Windows Server </li></ul><ul><li>Quickly build and...
SDS – Setting up the environment <ul><li>Download Azure Services Training Kit </li></ul><ul><ul><li>www.microsoft.com/azur...
SDS – Setting up the environment <ul><li>Sign up for the SDS Public CTP </li></ul><ul><ul><li>http://go.microsoft.com/fwli...
SDS – Setting up the environment <ul><li>SDS Developer Center  </li></ul><ul><ul><li>http://msdn.microsoft.com/en-us/sqlse...
Authorities, Containers, Entities <ul><li>Authorities, Containers and Entities, Oh My </li></ul><ul><li>SDS data model is ...
Authorities, Containers, Entities <ul><li>Authorities </li></ul><ul><li>Topmost level of the hierarchy </li></ul><ul><ul><...
Authorities, Containers, Entities <ul><li>Containers </li></ul><ul><li>Each container has unique id associated </li></ul><...
Authorities, Containers, Entities <ul><li>Entities </li></ul><ul><li>Actual bits of data stored in container </li></ul><ul...
Homogenous/Heterogeneous Data <ul><li>Homogeneous data is similar to a database table, in which all entities are of the sa...
Flexible Entities <ul><li>Key concept of SDS </li></ul><ul><li>XML fragment with one element per property value. </li></ul...
Anonymous Types <ul><li>A new podcasting website featuring the little known development geeks </li></ul><ul><li>Site runs ...
Differences to remember <ul><li>An Entity is like a property bag – keys/values </li></ul><ul><li>Each Entity in a Containe...
Containers <ul><li>Can contain heterogeneous, homogeneous, or flexible entities </li></ul><ul><li>For this project decided...
Site structure <ul><li>Administer text data </li></ul><ul><li>Upload and administer BLOB’s (podcasts) </li></ul><ul><ul><l...
Using REST <ul><li>POST (Insert, Create) </li></ul><ul><li>PUT (Update) </li></ul><ul><li>GET (Retrieve) </li></ul><ul><li...
Page Administration <ul><li>Insert, Save, Edit, Delete </li></ul><ul><li>Page code creates XML passed to the class </li></...
Demo <ul><li>Web site Page administration </li></ul>
Uploading PodCasts (BLOBs) <ul><li>Uploading of BLOBs is possible, but can only send the object, no other data </li></ul><...
Uploading PodCasts (BLOBs) <ul><li>Two step process </li></ul><ul><ul><li>First insert the Meta data </li></ul></ul><ul><u...
Demo
Public facing side <ul><li>One Master Page </li></ul><ul><ul><li>Navigation, PodCast List </li></ul></ul><ul><li>One Conte...
Demo <ul><li>Setting Navigation </li></ul>
Demo <ul><li>Setting Page Content </li></ul>
Demo <ul><li>Get All PodCasts </li></ul><ul><li>Uses Join between Containers so that we can get data back on the Guests as...
Demo <ul><li>Get Single </li></ul><ul><li>Uses Join between Containers </li></ul><ul><li>Uses Where to get specific Pod Ca...
Questions
Thank you <ul><li>Email –  [email_address] </li></ul><ul><li>Inland Empire .NET User’s Group </li></ul><ul><ul><li>www.ied...
Thanks to our sponsors We could not hold these code camps for you without our sponsors.  These Guys ROCK!
Upcoming SlideShare
Loading in...5
×

Sql Data Services

450

Published on

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

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
450
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Transcript of "Sql Data Services"

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

      Clipping is a handy way to collect important slides you want to go back to later.

    ×