ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Azure Cloud & Storage Services 

Categories: Azure Notes

Some notes from Windows Azure Fundamentals by http://mattmilner.com

Fabric controller will keep the requested number of instances running.

Package & Configuration files

  • .cscfg is xml stating the os
  • .cspkg is just a zip file

Service Definition

  • Virtual machine sizing
  • Endpoints
  • Certificates
  • Websites (web role)
  • Environment variables
  • Startup tasks
  • Configuration settings declarations

Service configuration

  • Operation System
  • Instance count
  • Values for configuration settings
  • Certificate thumbprint

Managing Cloud Services

  • Affinity groups
  • Fault domains
  • Upgrade domains
  • VIP swap
  • REST API

Storage Services

  • x509 certificate and SSL
  • Storage Account Keys
  • ETags
  • Azure Storage Explorer

Tables

  • PartitionKey, RowKey, Entity (key/value pairs), Timestamp
  • Max 255 fields including keys
  • Matching partition keys = data in same physical partition
  • Transactions only on the same partition

Blobs/CDN

  • Root container - Named container (first dir) - Blob (second dir and filename) 
  • http://<account>.blob.core.windows.net/images/web/background.jpg
  • Block blobs vs Page blobs
  • Content-cache metadata=TTL in CDN

Queues (max. 7 days)

  • No capitals in name allowed
  • 64kb Max after base64 encoded and including xml headers
  • eg. worker role that creates thumbnails or processes video
  • A worker role can update a message.

GETDATE vs SYSDATETIME 

Categories: SQL Server

The precision of SYSDATETIME is in nanoseconds, the one for GETDATE is in miliseconds.

Just try for yourself

SELECT SYSDATETIME() fn_SysDateTime, GETDATE() fn_GetDate

SQL Insert Or Update AKA Upsert 

Categories: SQL Server

Since MsSQL 2008 you can use the MERGE command for inserting or updating, here is a small example I use with mojoPortal. I call it from a custom PageInitEventHandler and allows me to track what pages a user visits.

CREATE PROCEDURE [dbo].[kenTracking_Pages_Upsert]

@UserGuid	uniqueidentifier,
@SiteGuid	uniqueidentifier,
@PageGuid	uniqueidentifier

AS

SET NOCOUNT, XACT_ABORT ON;

MERGE [dbo].[kenTracking_Pages] WITH (HOLDLOCK) AS target
USING (SELECT @UserGuid, @SiteGuid, @PageGuid) AS source (User_Guid, Site_Guid, Page_Guid)
ON (target.User_Guid = source.User_Guid) AND (target.Site_Guid = source.Site_Guid) AND (target.Page_Guid = source.Page_Guid)
WHEN MATCHED THEN
UPDATE SET Visits = Visits + 1, DateModified = GETDATE()
WHEN NOT MATCHED THEN
INSERT
(
User_Guid,
Site_Guid,
Page_Guid
)
VALUES
(
@UserGuid,
@SiteGuid,
@PageGuid
);

RETURN @@ERROR;
GO
Page 21 of 43 << < 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 40 > >>