Author: way0utwest

  • Serverless Software

    Developers may never see groups of servers like this again in the future.
    Developers may never see groups of servers like this again in the future.

    I love the words “loosely coupled.” At times in my career, I’ve built software and have aimed to ensure that processes, workflows, and components worked well on their own. In the places where I had to work with data or services on different physical machines, I tried to ensure that each item would run separately, and communicate when needed, but wouldn’t fail if another machine was down.

    That’s kind of the idea proposed in the article that says the future of software is serverless? It’s an interesting read, talking about the advances in cloud services that can change the way developers build applications. Developers should think about liking services, and pieces of applications, ignoring the idea their systems are tied to specific servers.

    It’s a future that I think makes sense for most environments. Development shouldn’t be concerned about the size or care of physical machines. Instead they should think about building on a platform of services, and expecting the scale to grow or shrink as needed, without code changes.

    I do think this could be the future in which development proceeds inside companies, as well as for commercial software. However vendors need to sell “private clouds” which function in the same way as the public ones, for those companies that want to control, and invest in, their own hardware.

    Steve Jones


    The Voice of the DBA Podcasts

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

  • Geeky Oscars

    Skyfall is recommended, but be warned, it's long.
    Skyfall is recommended, but be warned, it’s long.

    Last fall I heard an interview with one of the people who had worked on Skyfall. I can’t remember who it was, but this person mentioned the director had made the film with an eye towards the Best Picture award. It’s less than a month away from the Oscar awards, and Skyfall wasn’t nominated. I’m not sure it should have been, but I did very much enjoy the film.

    Last year was a good year for geeky films. The top grossing films of 2012 were dominated by those topics that we might see as appealing to the nerds, geeks, and technologists. I greatly enjoyed the top 4 and would recommend to others. However the amount of money a film makes doesn’t necessarily mean it’s worth watching, and if a film doens’t earn much money, that shouldn’t mean you want to avoid it.

    This Friday, as a break from the software and database discussions we have, I wanted to ask you

    What sci-fi, fantasy, or geek-oriented films do you recommend from 2012?

    Did you think John Carter or Total Recall (the remake) were worth watching? Are there other films you’d recommend that might not have been well marketed or widely distributed? With the streaming video services and online rentals, it’s easy for many of us to watch films that we might have missed in the theater.

    Let us know this week what you recommend and give us an idea for how we might relax over the weekend or throughout the year. At least until the Dr. Who 50th Anniversary special.

    Steve Jones


    The Voice of the DBA Podcasts

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

  • If You Need To Fix Database Filename Extensions

    In a recent post I showed how the file extension for a database doesn’t matter. It can be confusing, however, and you might wish to “fix” the filenames to conform to the proper extension. How can you do this?

    Well, to change a file name, or location, you need to take the database offline. This is noted in the Books Online Move Database procedure. Why? Well, the files need to be physically changed in the file system (either a rename or copy), so there is downtime here. Locations are one thing, but what about renames?

    The rename is simpler, and if you script this, downtime is minimal. The procedure is the same as listed in BOL:

    • set the database offline
    • rename the file
    • run the ALTER DATABASE command
    • set the database online

    This is pretty simple. We want to run this code:

    ALTER DATABASE [NameTest2] SET OFFLINE
    GO
    ALTER DATABASE [NameTest2]
     MODIFY FILE ( NAME = NameTest2
                 , FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\nametest2.mdf' )
    GO
    ALTER DATABASE [NameTest2] SET ONLINE
    GO
    

    However that code misses item #2 from above. I can manually perform that step, which is pretty easy, or I can script it if I allow xp_cmdshell changes. I know this is a security risk, but I can enable it and disable it all in the script:

    EXEC sp_configure 'show advanced options', 1
    GO
    RECONFIGURE
    GO
    EXEC sp_configure 'xp_cmdshell', 1
    GO
    RECONFIGURE
    GO 
    ALTER DATABASE [NameTest2] SET OFFLINE
    GO
    EXEC xp_cmdshell 'rename C:\"Program Files"\"Microsoft SQL Server"\MSSQL10.MSSQLSERVER\MSSQL\DATA\nametest2.ldf nametest2.mdf'
    GO
    ;
    ALTER DATABASE [NameTest2]
     MODIFY FILE ( NAME = NameTest2
                 , FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\nametest2.mdf' )
    GO
    ALTER DATABASE [NameTest2] SET ONLINE
    GO
    EXEC sp_configure 'show advanced options', 1
    GO
    RECONFIGURE
    GO
    EXEC sp_configure 'xp_cmdshell', 0
    GO
    RECONFIGURE
    GO 
    
    

    Note in here that I need some quotes in the RENAME command inside the shell so that Windows handles the spaces correctly in the path.

  • Building Better Software

    The Do Not Disturb bug would have seemed to be easy to fix, but perhaps there wasn't time before it fixed itself.
    The Do Not Disturb bug would have seemed to be easy to fix, but perhaps there wasn’t time before it fixed itself.

    Why is programming so hard, especially on seemingly simple problems. Here’s a short piece on the Apple iOS6 Do Not Disturb bug that surprised me. The bug is fixed, as of Jan 7, because it was a date issue. According to the article, the programmers that implemented the Do Not Disturb function used the ISO calendaring dates, which do not work as expected this year. The details are in the article, and it reads like an edge case, but it’s not one I’d expect to have slipped by Apple’s QA department.

    These types of programming errors seem to regularly slip by developers. The situation has gotten better since the days of VB6 when it seemed everyone that could complete a week long course was building buggy applications at a frightening rate. While I still think there are plenty of hack developers out there, it seems that with all the publication and information available, there are better programs being built in many organizations.

    However simple bugs can still slip through. The maintenance plan bug in SQL Server 2005 showed Microsoft that there’s no such thing as a simple fix or patch. In this case, even the Apple documentation for developers (Fixed Format section) notes that the ISO date should not take precedence when there is a conflict. Apparently not all of Apple’s developers are following their own documentation.

    Developing software is easy to do, but hard to get right, especially when you are building software that you expect to last a long time and get used in a variety of ways. Experience, practice, learning from your mistakes, and a deep understanding of the business you are working in help developers write better software over time. It’s a reason why you should ensure you work to retain your talented developers. They are much harder to replace than the lines of code they produce. A new developer may produce the same amount of work in a short period, but I’d wager they produce many more bugs as well.

    Steve Jones


    The Voice of the DBA Podcasts

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