Data persistence in a web hosted world
Download
1 / 33

data persistence in - PowerPoint PPT Presentation


  • 256 Views
  • Updated On :

Data Persistence In A Web Hosted World. Jeff Ammons. The Atlanta Journal-Constitution Developer/DBA GGMUG.com President Gwinnett, Georgia, Microsoft User Group 2 nd Thursday, 6:30 PM Gwinnett Tech Blog: http://ammonsonline.com/jeffablog. Agenda. Define Hosted Environment

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'data persistence in ' - Gideon


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Data persistence in a web hosted world l.jpg

Data Persistence In A Web Hosted World


Jeff ammons l.jpg
Jeff Ammons

  • The Atlanta Journal-Constitution

    • Developer/DBA

  • GGMUG.com

    • President

    • Gwinnett, Georgia, Microsoft User Group

    • 2nd Thursday, 6:30 PM Gwinnett Tech

  • Blog: http://ammonsonline.com/jeffablog


Agenda l.jpg
Agenda

  • Define Hosted Environment

  • Explore Data Persistence Options

  • DBA Tasks With Hosted SQL Server

  • Data Access With LINQ and Entity Framework


What is hosted environment l.jpg
What Is Hosted Environment?

  • Web

  • Shared Server

  • Managed By Hosting Company


What s included l.jpg
What’s Included?

  • Web Server

  • File Storage

  • Database

  • Bandwidth

  • Email


Examples l.jpg
Examples

  • GoDaddy

  • Hostgator

  • DiscountASP.net

  • Bizhostnet.com


Who is this environment for l.jpg
Who Is This Environment For?

  • Start-ups

  • Non-profit organizations

  • Personal use


Why choose a hosted env l.jpg
Why Choose A Hosted Env?

  • Lost cost ($5-$20/month)

  • Quick Start

  • Fewer People Required

  • No hardware to buy

  • No hardware to maintain

  • No server room


Challenges l.jpg
Challenges

  • Server Access

  • Server Options

  • Server Load

  • Dude, Where’s My Data?

  • Dude, Who Can See My Data?


Microsoft vs foss the foss advantage l.jpg
Microsoft vs FOSS:The FOSS Advantage

  • Lots of FOSS based sites (LAMP)

  • Lots of FOSS sample code

  • Zero start-up cost

  • MS stack seen as ugly and corporate-looking


Microsoft vs foss the empire strikes back l.jpg
Microsoft vs FOSS:The Empire Strikes Back

  • Asp.Net MVC

  • JQuery supported OFFICIALLY

  • Visual Studio Express Edition

  • BizSpark

  • WebsiteSpark

  • You CAN achieve zero start-up cost

  • You CAN make good looking sites


Asp net options l.jpg
Asp.Net Options

SharePoint

WebForms

MVC

ASP.NET


Data persistence options l.jpg
Data Persistence Options

  • MySQL

  • SQL Server

  • File Based

    • XML

    • JSON


Why not mysql l.jpg
Why Not MySQL?

  • .Net naturally works better with SQL Server

    • LINQ To SQL works ONLY with SQL Server

    • Entity Framework support for MySQL is dodgy

  • This is NOT MySQL Saturday…


Sql server l.jpg
SQL Server

  • $15/month = Unlimited 200 MB DBs

  • Good basic set of functionality

  • Choice of access methods

    • LINQ To SQL

    • Entity Framework

    • ADO

    • Etc.



What s missing l.jpg
What’s Missing?

Missing In Action

Alternative

  • Agent

  • SSIS

  • SSRS

  • SSAS

  • Wish You Had Agent

  • Stored Procs

  • ASP App Perhaps With Silverlight, why not?

  • None


Types of access l.jpg
Types Of Access

  • Direct Access

    • SQL Server Management Studio

    • Expose YOUR database directly to the Internet

  • Web Admin

    • Primitive tools

    • CYDB


Typical dba tasks l.jpg
Typical DBA Tasks

  • Set Up

    • Schemas

    • Tables

    • Indexes

    • Views

    • Stored Procedures

  • Backups/Restores

  • Imports/Exports



Developer dba l.jpg
Developer/DBA

  • Developers vs DBAs

  • Objects vs Relational Data

    • ORM


What is linq l.jpg
What Is LINQ?

  • Language INtegrated Query

  • SQL-like language construct for .Net

    • Joins

      • Tables

      • Objects

      • Both

    • Aggregation

    • Selection


Example linq query l.jpg
Example LINQ Query

var orderedModuleList = from module in itemList.getList()

orderby module.Name

select module;


Linq to lots of stuff l.jpg
LINQ To Lots Of Stuff

  • LINQ To Entities

  • LINQ To SQL

  • LINQ To Objects

  • LINQ To XML


File system options l.jpg
File System Options

  • POCO (Built-in .Net Serialization)

  • XML


Why why why l.jpg
Why? Why? Why?

  • Not ALL apps need relational databases

    • Burn the heretic!!!

  • SMALL datasets

  • Lots of Readers/Few Publishers

    • Blog

    • Informational site

    • Personal site

  • Excessive DB Traffic


Example l.jpg
Example

  • Custom ASP.Net Membership Provider

  • Basic log-on info

  • Works great with 10-30,000 users

  • Total DOG with 500,000 users

  • No calls to DB server

  • Most start-ups would KILL to get 10,000 users



Goals for your project l.jpg
Goals For Your Project

  • Website itself

  • Web app others can use


Strategy 1 sql server l.jpg
Strategy 1: SQL Server

  • Your hosting plan gives you all the DBs you need

  • Latency of calling DB server is acceptable

  • Don’t kill yourself by calling DB too much

    • Cache, Cache, Cache


Strategy 2 file system now sql server later l.jpg
Strategy 2: File System Now, SQL Server Later

  • Repository Pattern

  • LINQ lets you query object collections

  • Switch to SQL Server if you grow

  • Not as big a deal as it once was

    • SQL Server now pretty cheap


Helpful links l.jpg
Helpful Links

  • MSDN: Dynamic Management Views and Functions

    • http://msdn.microsoft.com/en-us/library/ms188754.aspx

  • SQLServerCentral

    • http://www.sqlservercentral.com/

  • SQLBlog

    • http://sqlblog.com/


Helpful queries l.jpg
Helpful Queries

  • SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

  • select top 100 *from sys.dm_tran_locks

  • select login_name, count(1)from sys.dm_exec_sessionsgroup by login_nameorder by count(1) desc

  • SELECT creation_time ,cursor_id ,name ,c.session_id ,login_name FROM sys.dm_exec_cursors(0) AS c JOIN sys.dm_exec_sessions AS s ON c.session_id = s.session_id WHERE DATEDIFF(mi, c.creation_time, GETDATE()) > 5;


ad