Author

REST Methods (Verbs)

A REST resource enables access to data, but doesn’t in itself do anything with that data. To use a REST resource, we have to pass along instructions about what action we want to perform. This is done using HTTP methods, also called verbs. Anytime you use a web browser, you or rather the browser use... » read more

GRASP Principles of Software Engineering

General Responsibility Assignment Software Patterns. Creator Who is responsible for creating an object? Making it apparent which objects are responsible for creating other objects. Controller MVC. Should separate view from model (business logic). Use Controller to coordinate this. Pure Fabrication When the behavior does not belong anywhere else, create a new class. Information Expert A... » read more

General Software Development Principles

Don’t Repeat Yourself (DRY) Avoid duplication in code. There should be a single source of truth. There should be one place in our system that deals with the particular problem. You Ain’t Gonna Need It (YAGNI) Solve the problems that you know exist, don’t write speculative code. It’s very tempting for developers when writing code,... » read more

Object Oriented Programming Basics

Abstraction Abstraction means we focus on the essential qualities of something rather than one specific example. Generalize instead of going into details.  Encapsulation The idea of taking our attributes and then taking our behaviors and bundling them together in the same unit. We also want to restrict access to the inner workings. “I don’t care... » read more

Implicit transactions: Don’t use it.

By default the database engine uses what’s known as an auto commit. Every T-SQL statement is committed or rolled back when it completes.  The database engine will always use this auto commit functionality unless a transaction is explicitly specified with BEGIN TRAN. Implicit transaction are rarely used in SQL server and when the option is... » read more

Read Committed Snapshot Isolation (RCSI)

Similar to Read Committed Isolation level but you can still read the old version of the data. Before a row is locked in preparation for changes, that means an update statement that might be run to a given row, that row is then placed in a version store (TempDB). The big advantage that our SCI... » read more

Database Isolation Level

Low isolation levels do allow for more users to be able to access the data so you can get greater concurrency, but they can also affect data integrity by creating the effect of lost updates and dirty reads.Dirty reads are a phenomenon where you read uncommitted data. That data could be wrong, because its transaction... » read more

CHAR, NCHAR, VARCHAR and NVARCHAR Data Types

Table of Differences   char nchar varchar nvarchar Character Data Type ASCII Unicode ASCII Unicode Maximum Length up to 8,000 characters up to 4,000 characters up to 8,000 characters up to 4,000 characters Character Size takes up 1 byte per character takes up 2 bytes per Unicode/Non-Unicode character takes up 1 byte per character takes... » read more

SQL Varchar vs Nvarchar

Nvarchar stores UNICODE data. If you have requirements to store UNICODE or multilingual data, nvarchar is the choice. Varchar stores ASCII data and should be your data type of choice for normal use. Regarding memory usage, nvarchar uses 2 bytes per character, whereas varchar uses 1. VARCHAR is stored as regular 8-bit data. But NVARCHAR strings are stored in the database as UTF-16 — 16 bits... » read more

Index and Column Limits

SQL Server gives us a limit of 900 bytes for clustering keys, and 1700 bytes for non-clustered indexes.  Have to use full-text index for VARCHAR(MAX) or nVARCHAR(MAX) datatypes.