Database Source Control : Map those changes

August 9, 2010 17:00 by tim

Following on from my previous article on git source control, I’ll now take a look at a few solutions for the other side of development : Database structure

There are 2 sides to most development projects.  The code, be that business logic, UI or reports is easily  via a variety of solutions (
SVN, CVS, git, VSS, etc)

The other side of the coin is that of the database.  Most applications will consume some form of data in their operation.  While some may rely on external services to provide this, most will have some form of local storage to store all the elements necessary for it to function.  Many site will have space for user logins, product information, shopping baskets, news, events, documentation, the list is endless

In the same vein as development, the data stores usually starts as a small collection of tables.  As functionality in the codebase grows, so does the number of tables needed to store all the different types of data that are being coded for.  So, as developers make changes to their sections of code and can commit their changes to a repository, what is there on the database side?  How does one track changes and additions to tables and stored procedures?

It’s definitely something that is becoming more of a necessity in these days of incremental release.  Traditionally, a new database would have to be created in it’s entirety. Not really a problem for development database that are used prior to release.  The development code can be expected to be quite fluid and changes are expected to occur frequently.  Once that database has been released to production, this becomes impossible.  Customers are very reluctant to lose historic data, user tracking relies upon it.  In this case, changes can be made piecemeal and scripts generated to map the single changes to other instances of the database

Fine if you’re using the DEV>UAT>Production strategy.  A single setup coordinator can orchestrate the script from a developer and apply that to the UAT database.  When the QA team are happy that the changes are working, this same script can then be applied to the production database, preserving existing data

However, when development becomes more distributed that a single developer and single production database, things start getting a little trickier to manage.  Sending scripts around becomes impossible.  People might not have the very latest build so scripts that rely on a series of changes will fail

This is where a central source control solution come in.  There are tools for applying these single change in order so that dependencies can be tracked.  Red gate have a fantastic tool which integrates natively with SVN so map changes, and there are some other really usable open-source tools available which can target more databases, but with more of an onus on developer collaboration to make the changes in sequence

Red gate's tool integrates only with SqlServer but is a valuable addition to their Sql toolbelt set of tools.  I’ve been using them for years and can’t fault them for mapping changes to production databases.  Their latest tool is no exception.  It works as an addition to the Sql Management Studio which ships with SqlServer.  Extra tool menus allow you to attach a database to an SVN repository.  Once linked, the tool will make an initial snapshot of it’s structure.  Then each change is managed within the tool, allowing the developer to commit them one by one as they are made.  When another developer needs to get a copy of the development database, they only have to make an empty database, link that to the central repository and the tool then maps the tables and stored procedures across, including any dependencies that are found.  The new developer can also make changes to their database, commit these one by one and the original developer will see these as updates and can apply them to their database.  The process can be scaled up in much the same way as regular development source control  solutions.  Distributed developers are given access to the repository and off they go

The open source solution I’ve looked at closely is deltaSql.  This employs a custom server for mapping changes which runs on
Apache, making it cross platform compatible with Windows or Linux.  It uses a similar commit and update strategy but pulling the individual scripts from it’s central server instead of SVN.  This solution also allows for more databases to be catalogued, including mySQL and postgreSQL and Oracle.  Lit integrates into the Eclipse IDE via asset of open source windows so is totally free to use


Both solutions provide a lightweight method of mapping changes from a distributed set of users to a central location over multiple database solutions.  Source control is essential for most projects and databases should be no different.  They are, in some cases, more complex than the code that drives them, so being able to sync the change with your peers is an absolute necessity.  Throw in a few QA houses, production databases and data warehousing solutions and the "Drop and Reload" method is not going to work out.  Both offering provide a less painful way to make structure changes in a controlled manner and provide a means to roll these changes back and start again should testing prove unsuccessful.  Very powerful!


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Microsoft Tech Days: London April 12 – 16, 2010

April 29, 2010 12:34 by tim

You wait all year for something to happen then three things happen at once!!!!

To kick off the release of Visual Studio 2010, .net framework 4 and Silverlight 4, Microsoft hosted an array of global events inviting developers and technical professionals. Some of the world’s finest speakers showed off the new products, with Microsoft programmers highlighting new features and tools.

Visual Studio 2010 is the latest tool from Microsoft to aid programmers in the creation of Windows Applications, data services, web sites, Silverlight applications and windows phone 7 applications.  The productivity tool has caught up with modern technology to offer multi-monitor support. There is now enhanced integration with existing Microsoft Office products, intellisense, for the jQuery library, and other open-source products. It also offers the ability to target .net framework 4 as well as previous versions of the framework. It even colour codes the oldest of ASP scripts for you die-hard VBScript heads!!

.Net framework 4 is the new framework for developing on the Windows platform.  The installer itself offers many more templates for creating your programs, including one which targets the yet-to-be-released Windows 7 Phone. One of these phones was on display during the event and the speaker made a simple program for organising contacts, calling into the Outlook program in the office suite, getting the user’s contact list and offering filters to re-organise the emails, phones numbers and other data items in the account. The framework is all about rapid development and .net 4 certainly seemed to deliver in the demos.

Silverlight 4 is the next generation of the fledgling RIA (Rich Internet Application) framework from Microsoft.  Building on Microsoft’s proven track record of solid data layer and fantastic base tools, Silverlight itself was intended as a business-class framework to compete with flash in the RIA space.  What had let it down in the past was highly restricted security stopping the development of business application.  Silverlight 4 overcomes this with a new security layer allowing a user to opt-in to certain security-restricted features such as printer support and webcam and microphone.

 The framework is merging more and more with Microsoft’s other rich application framework, WPF, so the lines between internet application and desktop application are becoming blurred. Indeed, a Silverlight 4 application can be downloaded from a website, installed to a desktop application and run as if it was a fully trusted application with access to your local files and network services.  Sounds scary? Well there are a fair few hoops to jump through to get this working but it only speaks volumes for Microsoft’s security-conscious values and not wanting to cause headache for even the least savvy of users.

There were plenty of other cool demonstrations of products like Blend 4, Windows Azure and Bing Maps, more to follow next time...


Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Virtual Earth meets Silverlight

April 15, 2009 09:46 by tim

I went to a Virtual Earth developer day at TVP the other day and one of the big releases that they demonstrated is the new Virtual Earth Silverlight control

Currently in a Community Technology Preview status, the control builds on the fluidity of DeepZoom to provide mapping over a really slick looking canvas.  Being that it's silverlight based, the canvas is really responsive compared to the AJAX implementation that is the current fashionable flavour

The controls can be downloaded from the Microsrof Connect website.  This MSDN blog really isn't lying when it says you only need to type 2 lines of code to get a basic looking map out of it :  http://blogs.msdn.com/virtualearth/archive/2009/03/18/introducing-the-virtual-earth-silverlight-map-control.aspx

Just add the references and make a simple Map Tag and you're away.  Making overlays is really simple and this guy has plotted the course and speec of the top 4 marathon runners in the New York Marathon, however i can only see 3 points : http://conceptdevelopment.net/Silverlight/VEMap01/default.html

He's actually plotted a few of the recent marathons in a few cities around the world.  The map pans to follow the runners

I have a demo that i created to highlight how easy it is to implement.  The app took around 10 minutes to create, including downloading the control from Microsoft Connect!!  http://silverlight.creative-jar.com/maps/default.html


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

asp.net Pager TemplatePagerField

March 12, 2009 17:42 by tim

Been working with the new ASP.net pager control and i must say I'm impressed

when it was all .net framework 2.0, we'd been working with a nice little usercontrol which handled all it's postback internally and we had pretty good control over the markup.  Then .net 3.5 comes on the scene with it's listview and pager, so we thought we should give them a go

It was a partially good experience but the lack of mark-up control was pretty limiting.  I'm not much of a front-end guy so i just plumped for the standard layout and went with that.  However, as our front-end guys show much more attention to look & feel than I do, they demanded better markup, nicer buttons, parameterised visibility, the lot basically

We saw there was a TemplatePagerField node for the datapage and http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.templatepagerfield.aspx showed us we could literally spoon any kind of controls and mark-up into it.  The server side functinalty opened my eyes to some new counters i didn't even know existed.  I was used to the listitem having a container, kind of like a row in a database, but the pagers container is actually the entire collection of rows.  Kind of obvious when i think about it as i was only ever throwing it the whole set and it did it's thang and paged the data as required.

Also, you can have any combination of fields so you can still use the standard pager ones.  i particularly like the page buttons one which gives you a link to each page so the users are not forced to keep pressing next and previous to get to the products 

check it out though.  Saved us loads of time recently :¬)


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

jQuery XML and MIME types

February 16, 2009 08:49 by tim

We're really getting into jQuery these days.  Since it's adoption by the .net framework team, we're seeing more and more AJAX UI with data read in via jQuery to make some really cool looking sites

However, there was a problem we had recently with MIME types. We host all our stuff on IIS and this comes pretty much ready-rolled with most of the MIME types set up.  For those of you that don't know what a MIME type is; It's a rule which the web server uses to process certain files based on their extension. JPG, for example, is pretty much going to be a picture so the server allows these as binary downloads, whereae ASPX is a server-side page so the MIME type for ASPX runs through an extra process to translate the code into a working web page

Browsers also use the MIME type to decide how to display the pages, or images, and set them up correctly in the browser. application/rss+xml signifies that there is an RSS feed somewhere nearby and the browser will then highlight the Feed button so the user know where to get the feed from and set it up in their favourites

Which brings me nicely on the the problem that this post is meant to remedy.  We were using the jQuery $(document).ready(function(){$.ajax({type: "GET",url: "tim.xml",dataType: "xml", success: function(xml) { stuff to retrieve the xml and the process the node we were interested in.  Worked fine locally using IIS on any browser we threw at it.  However, we had to upload this to a 3rd party server and the "text/xml" MIME type hadn't been set up.  FireFox didn't seem to mind, but IE was throwing it's toy out of the pram and just not playing ball whatsoever.

After much blog and forum digging, we cam across the explanation on the jQuery site : http://docs.jquery.com/API/1.1.1/Ajax

So there you have it; if somethings not behaving as it should, before you change the code, be sure to verify your MIME types are set up as they should be. I initially thought this was an issue with $(document).ready but amending this didn't fix my issue!!

 

 


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

NxtGenUg Session : Designer - Developer workflow

January 20, 2009 09:16 by tim

Have just returned from Coventry after doing a Designer-Developer workflow seminar for NxtGenUg. 

Really good crowd last night I thought.  We had a few issues with controls not rendering and events not firing on our Mix07 application, as is the way with a live demo I suppose, since you don't have time to iron out the imperfections and all that.  We even had a bit of time to demo a pet application of mine, DynamiChazm, which allows for dynamically updatable and taggable DeepZoom images.  More to follow in a future blog :¬)

Thanks to Richard Costall for hosting it and allowing us to present out 'thang'.  Simon and I had a great time


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Silverlight : Grow your own controls

January 13, 2009 17:50 by tim

We had an issue on an early version of a silverlight app we wrote.  the whole thing was a banner which was fed data from a SharePoint list.  The site itself was multi-lingual so the same sentence coudl be one and half times as long in, say, the German version as it was in the English version

Being a data-binding kind of person (?), I opted to use Silverlights inherently powerful DataBinding features and have it fill the text from a custom object I got from the list.  However, since th controls were coded into the xaml, the size of the box was causing truncation in some instances, forcing us to set it to be the width of the logest piece of text we would ever encounter, not a very clever solution but good enough for the dev site

Re-visiting the code for live, I had a brain-wave.  I knew that silverlight could handle the dynamic sizing, Blend was all over it and the area was expanding and contracting as needed.  So, i broke it out of the xaml, turned it into a usercontrol, and then added it to the canvas at run time, after i'd set the text from the data.  Then, when the control renders, it's the correct size for the text it contains :¬)

Job done :¬)


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Wrong User Agent?

January 12, 2009 17:43 by tim

Ever been to a site and been accused of having an old browser?  Like it warns you to upgrade you Internet Explorer version from 6 to 7 before it will show you stuff?

Seems there's a few Windows machines out there with some dodgy Registry settings.  There is a key in there which hard-codes your user-agent, rather than letting the broswer do the talking

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings\User Agent\Post Platform]

This should be empty in order to post the corerect version. There are some facebook users who are getting the IE6 version and messages because this key is hard-coded to IE6  

WARNING : EDIT YOUR REGISTRY WITH EXTREME CAUTION!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Mix 2009 : 10k Silverlight apps

December 22, 2008 11:07 by tim

Microsoft have announced their latest competition for the Mix 2009 event in Las Vegas. 

They're running a competiton whereby you can submit a Silverlight app to their galley.  The only caveat is that all the source code and related files must all be under 10k in total.  Interesting challenge!!

We've submitted a Mandelbrot generator.  It's pretty heavy on the browser as it needs to generate around 100,000 points for the low resoltion version, but it's interesting what you can do with just 10k of code!!

http://2009.visitmix.com/MIXtify/TenKGallery.aspx

Check out the gallery.   There are some interesting ideas in there, some weird ones too!!


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Could not load file or assembly App_Web_

December 11, 2008 12:12 by tim

I was getting a weird error in a site which is using WCF.  The application is silverlight and uses the WCF service for all it's data interaction.  However, while the Silverlight would load, any data access was failing.  A quick browse to the address of the service gave me the dreaded "Could not load file or assembly App_Web_yadayadayada"

Strange error really, giving that I never use the published site where the app_web_xxxxxxx dlls are generated, always plumping for the Web Deployment Project flavour of deployment as it's cleaner for uploading and quick aspx or code-behind changes as you don't have to upload the whole site everytime you publish

Turns out there's an attribute you can add to your web.config to stop all this recompilation stuff

In the compilation tag , add the following attibute.  Makes the site run a little faster due to not having to load debug symbols and also stops the batch recompilation of your bin folder when the AppPool recycles 

<compilation debug="false" batch="false"> 

Job done:¬)


Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Calendar

September 2010
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

Tags