Author: way0utwest

  • Self Service SQL

    self service help and advice
    Self service isn’t always better.

    I was looking over the Microsoft Virtual Academy recently, and went through one of the courses they have on SQL Server for the private cloud. I was curious how this solution is being both implemented and presented. It was interesting, and I learned a few things, including the fact that Microsoft is looking to build self-service into this idea of a private cloud. Users can build a virtual machine from a template, with Windows, SQL Server, and more already setup. They receive a SQL Server they can use as long as they like, and can delete it when they are done with it.

    There are a few problems here, and they are similar problems that we’ve seen in the past as we pushed out more capabilities to individual users. The first one is that allowing people to create their own SQL Server instances can be problematic as they don’t do a good job of setting up maintenance. SQL Server is easy to set up, but a little more complicated to manage over time. I suppose templates could potentially have backups and maintenance built in, but if you do this with any scale, you might end up with storage and space issues as well.  There’s only so much automation can do with limited resources, and I could see this ending up causing more infrastructure problems over time for IT staffs.

    The second issue is that people just don’t manage data well. How many people would delete a virtual machine without a final backup? How many people would create machines, load data, and then forget they had data out there? Apart from security concerns, there are likely to be efficiency concerns. How many people might create their own database server for financial data, even though the person in the next office might have already done the same thing? How many reconciliation problems will be brought to the DBA when people load different data sets into their servers, run reports, and then try to compare the results?

    I think IT self-service is a good idea in many ways, but it’s not the answer for all problems, and without some controls, I can see it easily causing as many issues as it solves.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.

  • The Cloud is Nothing New

    Cloud computing doesn’t seem to have any great definition. Like the physical structures is is named for, it is amorphous, with no defined boundaries, and often, without a recognizable shape. There are even a whole host of different acronyms (IaaS, PaaS, SaaS), which attempt to provide some differentiation between the services being offered by “cloud vendors”.

    However much of what the cloud does is act like an IT department for hire. They provide us with Virtual Machines we can configure as we like. They provide software services, much like Twitter, or even Google, provide for us. They may provide us a way to deploy some software we write, but ultimately this is nothing magic or new.

    Most of what the “cloud” gives us is a new marketing term that has caught on. From the Microsoft “to the cloud” commercials to the buzz about Amazon’s various AWS services.

    It’s hard to even compare the various services from different companies because we don’t really have a common framework of discussion. The “as”s give us a starting point, but when using the generic “cloud” term, it quickly becomes confusing.

    To date, I haven’t seen much innovation in the cloud. The way the services are priced, packaged, and made available is different than in the past, but the technology is the same. And in many cases, the deployment of much of this technology on virtual machines makes me think of the mainframe days when we carved up the hardware on one large, monolithic machine into various compartments where different applications could be run, or different programs could be deployed.

    The cloud isn’t a lot different, technically, but the way the services are offered to us is new, and the speed at which they can be built, used, and thrown away, is truly stunning.

    The cloud is nothing new, but it can change the way in which make decisions about our investments, and it can change the timing of the IT investments that we choose to make.

  • Create a Filestream Filegroup for Filetables – SQL Server 2012

    Once you’ve enabled filestream, the next step is to add a filegroup to your database to hold the filestream data. This is pretty easy to do, and I’ll show you the SSMS and code versions.

    If you want to know more about these Filestream containers, you can read BOL. Let’s create a simple database:

    -- create a new database
    create database UnstructuredData
    go
    
    

    This is a simple database with my instance defaults in place. It has a single mdf, a single ldf, and the default Primary filegroup. Let’s not add a new filegroup:

    -- add a filestream FG
    ALTER DATABASE [UnstructuredData]
      ADD FILEGROUP [FS] CONTAINS FILESTREAM 
    GO

    Here I am adding the filegroup (empty) and specifying this as a filestream container. You cannot mix Filestream data and non-Filestream data in the same filegroup in SQL Server 2012.

    To add a file, we can use the ALTER DATABASE command:

    -- Add a file to the Filestream FG
    ALTER DATABASE [UnstructuredData] 
      ADD FILE ( NAME = N'UnstructuredFS', 
                 FILENAME = N'c:\fs\UnstructuredFS' ) 
         TO FILEGROUP [FS]
    go
    

    Here I am adding a file, which is actually a folder in this case. According to the documentation, the path up to the last folder (c:\fs in this case) must exist, but the last folder (UnstructuredFS) must not.

    You could do all of this in one statement, as shown here:

    CREATE DATABASE [UnstructuredData]
     CONTAINMENT = NONE
     ON  PRIMARY 
    ( NAME = N'UnstructuredData', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\UnstructuredData.mdf' , SIZE = 3136KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ), 
     FILEGROUP [FS] CONTAINS FILESTREAM  DEFAULT 
    ( NAME = N'UnstructuredFS', FILENAME = N'c:\fs\UnstructuredFS' , MAXSIZE = UNLIMITED)
     LOG ON 
    ( NAME = N'UnstructuredData_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\UnstructuredData_log.ldf' , SIZE = 784KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
    GO
    

    This gets you a space for holding your Filestream data. In 2012, you can now have more than one file for Filestream data, so you can separate out your filegroup across different physical locations if you have a need to do so for performance or scalability.

    In the next post, I’ll build a FileTable and store some documents in it.

  • Is Software Engineering Dead?

    Software Engineering
    Are textbooks like this obsolete?

    Is Software Engineering dead? It’s a premise that’s in this article from Bloomberg. It calls the job a career dead end where job prospects decline after one reaches 35 years of age. I think that’s a naive view of the industry, despite the quotes from Craig Barrett and Mark Zuckerberg. While the best of the best might peak in their careers at the same age as many athletes, that doesn’t imply that the career choice is a poor one.

    There’s a discussion on Slashdot as well, and I was struck by a few of the comments, which seem to suggest that if you are still just a “software engineer” at age 40, you aren’t very good at your job. It seems that some people seem to think that everyone in this business is constantly looking to move to a new job and advance into management or they aren’t successful . I saw analogies with other industries thinking that same thing, that experienced people would not still be doing the same job after 20 years.

    That seems crazy to me. So many people in various industries continue to improve at their jobs, and do the same work for decades. Carpenters, doctors, accountants, all continue to improve their skills over time, and while some may more into management or open their own firms, many will continue to do their same jobs until they retire. And they’ll enjoy their careers.

    I don’t deny that ageism exists, and that older programmers often can’t, or won’t, work as many hours as younger ones, but that doesn’t mean they aren’t worth their salaries. Good, experienced programmers produce better code, with fewer bugs. Once managers learn that working more hours doesn’t equal better code, or even more code, the entire industry will start producing better applications.

    Steve Jones


    The Voice of the DBA Podcasts

    We publish three versions of the podcast each day for you to enjoy.