Author: way0utwest

  • Transfer Times in the Cloud

    SQL Azure
    Can you get your data out of the cloud if it goes in?

    There are many reasons not to move your data to the cloud. You might be concerned about the performance of your system, you might be concerned about the reliability of the service, you might worry about any number of regulatory or legal factors, or you might be worried about security. However I think most of those issues aren’t as important as another one: moving your data.

    I like the freedom to choose how I want to run my business. I like to be able to choose to run Oracle, or NoSQL, or SQL Server. I like to be able to purchase my hardware from Dell or HP or Apple. And more importantly, I like to be able to change my mind and move to a new vendor if they have a better product, or if the price saves me money, or if I just change my mind.

    The ability to get my data back is critical to me. Despite all the triple redundancy of Azure and the backups avaible from AWS, I want to be able to move my data if the need arises. There are transfer options, but they might not work as well as expected. A test moving data from AWS to Azure didn’t work as well as expected, which unfortunately, isn’t surprising. Part of this may be Azure and not Amazon, which is a little disappointing.

    I suspect that cloud companies would not be as helpful when you are closing your account as when you first sign up. They have no financial incentive to do so, but I would hope that they would act maturely, and let customers go if they cannot meet their needs. Our requirements may change,  and being able to get our data back is important. If you want to charge a fee to expedite the removal of data, state that up front, but make sure that we can get our data back.

    Steve Jones


    The Voice of the DBA Podcasts

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

  • Be Extra Careful When Packing

    Over the last couple of years I’ve gotten myself down to two small, carry-on bags for most of my trips. It has allowed me to save time in and out of the airport, and cut down on a lot of hassles from frequent trips (I flew on 18 round trips last year).

    One of the ways I’ve done this is with a couple dedicated bag: one for clothes/shoes and one for the laptop and supplies. I don’t ever really unpack them, and I just move clothes in and out when I go. That always has me a little nervous as I am counting on things to be in the bags, but it’s worked for a dozen trips lately because I keep spares of all my supplies in the bags, replacing them as needed, but not using them for other purposes.

    However that can come back to bite you. I did have a trip last year where I left my presentation remote at home since I’d been using it to practice and hadn’t put it back in my bag before I left. Fortunately that’s a minor inconvenience and not a major hassle.

    I leave for the UK on Saturday for my annual visit to the Red Gate office in Cambridge, and I need to pack for a week. I’m hoping to slip in enough clothes to go with just my two bags, but we’ll see. I’ll also use this chance to double check I have everything packed I need since replacing stuff in another country is less than exciting to me.

  • Hashing Collisions

    One of the problems with hashing is that you can have collisions from values that are not very similar. This means that if you are using hashing as a way to identify similar values, you need to make further checks with the original data after the hash matches are gathered.

    This post will show a few examples of the collisions that can occur if you use the CHECKSUM() or BINARY_CHECKSUM() functions.

    If we examine this code:

    -- Checksum
    declare 
      @i varchar(200)
    , @j varchar(200);
    
    select @i = 'LE';
    select @j = 'AAAAAAAAAAAAAAAALE';
    
    select 
      Plaintext = @i
    , checksum = CHECKSUM(@i)
    UNION ALL 
    SELECT
      Plaintext = @j
    , checksum = CHECKSUM(@j);
    GO
    

    This returns a result like this:

    hashing2

    Note that these two values are the same as far as the checksum hash goes.

    If we switch to BINARY_CHECKSUM(), we can get similar results.

    -- binary_checksum is no better
    declare 
      @i varchar(200)
    , @j varchar(200)
    , @k varchar(200);
    
    
    select @i = 'LE'
    select @j = 'Ou'
    select @k = 'MU'
    
    select 
      Plaintext = @i
    , BINARY_CHECKSUM(@i)
    UNION ALL 
    SELECT
      Plaintext = @j
    , BINARY_CHECKSUM(@j)
    UNION ALL 
    SELECT
      Plaintext = @k
    , BINARY_CHECKSUM(@k)
    GO
    
    

    hashing3

    While these two functions can be useful, you do have to be careful with the results. A matching hash from these functions does not mean that the source data is the same.

  • Wasting Time

    ping pong
    In a few jobs, we had a ping pong table at work and it was a great place to take a 10 minute break from work.

    I used to come into work, get some coffee, sit in a cube, put headphones on, and then spend my day stuck in the world of SQL Server. Solving problems, working on trouble tickets, analyzing performance and more. An occasional meeting interrupted me, and an empty coffee cup interrupted me more, but for the most part I worked as a DBA with headphones on, doing my job. However I wasn’t perfect. There were times that I surfed the web, looking for news, answering questions on forums or more.  Add this to the conversations with co-workers about non-work topics and it’s clear that 8 hours at work isn’t 8 hours of work.

    I’m not alone, and most of my co-workers engaged in other sorts of distractions as well. We weren’t alone either, and this survey from Salary.com shows some interesting results. Many people spend time on the Internet on non-work tasks, and I think that’s OK. I also think it’s not much different from the pre-Internet days of work. Smoke breaks, random walks around the building, water cooler time, I think some people would be surprised how much time they spend away from “work” if their movements and efforts were tracked by the minute.

    As humans, we aren’t going to focus on a single task for a long period of time unless it doesn’t require much thought. For anyone that has to think, however, distractions are necessary over time. Extreme concentration in one area can easily leave us locked in to a particular solution, creating tunnel vision. It’s also hard, and requires some downtime to recharge. That downtime at work can easily come from a few distractions that let your mind wander.  The best people I’ve worked with often had short breaks spread in their day. A game of table tennis, playing a song on a guitar, a short conversation, or even working with a co-worker on some problem unrelated to their job. What looked like a waste of time didn’t seem to affect their productivity.

    Not everyone handles the freedom well, and plenty of people get distracted to the point of being unproductive. However eliminating all distractions doesn’t necessarily make them more productive. They’ll just find some other way to distract themselves. Great employers look to help people learn to manage themselves better, shortening breaks, learning to tackle problems as a challenge, and perhaps learning to become better at their craft by using some break time to learn more.

    Steve Jones


    The Voice of the DBA Podcasts

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