Showing posts with label best practices. Show all posts
Showing posts with label best practices. Show all posts

Thursday, June 04, 2020

Pets vs Cattle

This refers to the pets versus cattle analogy for IT
https://youtu.be/Ox_Wm6XQnxI

The analogy concisely describes a major paradigm shift in our industry that we have been implementing with BAM2.
http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/

An elevator pitch for “Pets vs Cattle” from “The History of Pets vs Cattle and How to Use the Analogy Properly
In the old way of doing things, we treat our servers like pets, for example Bob the mail server. If Bob goes down, it’s all hands on deck. The CEO can’t get his email and it’s the end of the world. In the new way, servers are numbered, like cattle in a herd. For example, www001 to www100. When one server goes down, it’s taken out back, shot, and replaced on the line.
-

More articles on Pets vs Cattle

"4 Reasons Why “Pets Versus Cattle” Still Matters in Cloud Security" https://nightfall.ai/resources/pets-vs-cattle/
This slide is taken from a presentation given by Gavin McCance at CERN in 2012. Though, The Register identifies Microsoft’s Bill Baker as the original source of this analogy.

"Pets Vs. Cattle" https://blog.engineyard.com/pets-vs-cattle

Wednesday, April 27, 2011

Reducing Sleeping Dragons

A few weeks ago I added a column to a SQL table DateCreated.  I wanted to track when the records were getting created.  I provided a value for the existing columns and then made it not nullable and provided getdate() as its default.  I have done this quite often in the past and in the other frameworks I was in it never was a problem.

This time it was.  I had made other changes to the database the project used.  I updated the edmx file for the data access layer so it would refresh my object model for my code.  I did not pay close enough attention to the fact that it now added code to account for the new DateCreated column.

Yesterday we got an error.  When looking at the SQL trace I saw that Entity Framework was passing in a '0001-01-01 00:00:00' for the date value because the code giving the values was not providing it a value.  I was counting on the app (including the data layer) to not provide a value.  The database definition would provide getdate().

Entity Framework did only half the job that needed doing.  The presentation layer, or service layer or business layer should have been updated to provide a value if the data layer gets updated with the DateCreated column.


I am glad that we are getting away from using ORM solutions.  We are instead relying on lightweight utilities to create a data layer using only ADO.NET.  My colleague, Sam started this with LOEF.  He is now developing NOEF (No Entity Framwork perhaps with a better name).  This will reduce the sleeping dragons we have to deal with.