Creating vs. Maintaining

If your job as a developer or DBA has been like mine, it’s a constant stream of requests to change something, often without enough information and short deadlines that create a bit of stress. There’s always more work to be done, and while it might be a great job, you’re often trying to finish something quickly enough to get to the next thing.

In this mode, how often do you think about creating (or modifying) the thing you’re working on for today vs maintaining it for tomorrow. In other words, do you consider how easily your work can be understood, is documented, is designed to allow for flexibility, and can be enhanced without many (any?) side effects, or anything else.

In other words, is it maintainable?

We often build things to solve a problem and we can be very creative. We design a solution that works well, solves a problem, and may work very efficiently. However, I know I often haven’t thought about future maintenance. I haven’t considered how difficult it may be to understand the context around what I put together by anyone else. Sometimes I’ve built things that things that were very clever, but weren’t easily understood by my team or able to easily adapt to new requirements when those arise.

Often I’ve been looking at the problem from only a “it’s this tree that’s important” perspective, and forgetting that my particular thing is part of a wider system (a forest). I hadn’t been considering future maintenance, which often led someone in the future (often a future-me) to tear it down and rebuild something new.

That’s technical debt.

When some structure isn’t maintainable, it’s debt. It’s a burden for the team in the future. Designing things quickly and building them within a deadline, while making them maintainable requires some knowledge, experience, and also discipline to work with the patterns, and avoiding the anti-patterns, that make code difficult. The same thing applies to managing systems. Custom jobs on every server and separate configurations make life hard. At the same time, a one-size-for-everyone approach also isn’t maintainable. We need a balance of well-written solutions that solve our problems, but are easily maintainable.

Part of becoming a better engineer or admin is learning how to build maintainable things that others will continue to use for a long time, not because they have to, but because they want to because the code works well.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | Comments Off on Creating vs. Maintaining

A Quick Test Data Manager Eval with My Database Backup

I wrote about getting the Redgate Test Data Manager set up in 10 minutes before, and it was a great post. In that one, the sample database Northwind was created and used. However, Alex Yates has modified the scripts to work with backup files, and I’ll show you how easy this is in just a few minutes.

This is part of a series of posts on TDM. Check out the tag for other posts.

The Setup

I’ve filtered my SSMS to only show databases with BB in the name. You can see I have none.

2025-01_0167

I also have a backup file of a baseball database on my d: drive. My local instance has access to this folder as I use for backups and restores in dev/test work.

2025-01_0168

While I can pass these parameters in, it’s easy to just change the values in the file after cloning the repo. This way it’s easy to see what’s going on.

2025-01_0169

That’s it, now let’s fire up PowerShell.

Running the Eval

When I run the file, I see it start up and report the various values. You can see that it’s set the base database name to “BB” and I should see the two databases with the suffixes created. I also see my backup path.

2025-01_0170

This runs and in a few minutes, I see that the databases have been created and we are ready to subset.

2025-01_0171

Checking SSMS with a refresh, I see the databases.

2025-01_0172

If I type “y”, the subsetter runs, and very quickly. This isn’t a massive database, but it is thousands of rows, which makes it easy to play with.

2025-01_0173

If I run counts, I see this. The left is the full restore, which has 16k records. The subset, on the right, has about 10% of that, with 1644 rows. Pretty cool. So far, this has taken less than a couple of minutes.

2025-01_0174

Now let’s continue to press “y” and get the classification, mapping, and masking done. Two tables were found with PII (names) and masked.

2025-01_0177

If I query the tables, I see the results below. Notice that not all values were moved, as the first ID in the subset is 11, but we can see IDs 11 and 22 were masked.

2025-01_0175

This was a very quick look at running an eval with my own database backup, not a sample db. We’ve had a few people ask to do this for their own testing, and we modified the scripts to work with backups.

Give TDM a try today from the repo and a trial, or contact one of our reps and get moving with help from our sales engineers.

Video Walkthrough

Check out a video of my demoing this below:

Posted in Blog | Tagged , , | 4 Comments

Get a PAT in Azure DevOps

I have a presentation recently on Continuous Integration Using Local Agents in Azure DevOps and one of the things I do in there is get a PAT for Azure DevOps to use in configuring an agent. This post shows how to do this, as I found this wasn’t obvious when I was searching out information.

Azure DevOps Organizations

In Azure DevOps, at the top level you have an organization. Here’s my way0utwest org.

2024-12_0298

In the lower left corner, there is this, which is somewhat hidden. As you can see, it’s next to the bottom projects in my org, just above my Windows bar.

2024-12_0299

If I click this, I have lots of settings. I have lots of different things. One would think this would be a place where I could create a PAT for my agent to connect with.

2024-12_0300

It’s not.

If I am setting up an Agent and need a PAT, I need to do to the upper right, under my user settings. This is the second from the right (as of Jan 2025) icon. If I click this, I see PATs.

2024-12_0301

Once I click Personal access tokens, I get to this screen. You can see my PATs and a “New” buton in the upper right. Click this to create a new token.

2024-12_0302

You get this screen. Apparently this token is only used to register the agent. I’ve usually granted this full access, but I haven’t dived too deep into what happens if I only limit rights. I’ll try that soon. As with any security issue, make sure you know the implications of settings.

2024-12_0303

Once you create this, you get a notice that you need to copy this now or lose it. There’s a handy copy button, so use it.

2024-12_0304

Summary

This is a quick post on creating tokens in Azure DevOps. As with any security change, make sure you know what the implications are for creating and using these.

Posted in Blog | Tagged , , | Comments Off on Get a PAT in Azure DevOps

The Local OLLAMA Gui

I ran a small ollama model in a container and have been doing some experiments. One of the things I wanted to do was get a GUI so I wasn’t always running docker to connect (with –it) or writing code to interact.

I saw a post somewhere that there is a webgui, so I decided to try it. This post shows the quick setup process.

This is part of a series of experiments with AI systems.

Run the Container

The command I used was this one:

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v ollama-webui:/app/backend/data --name ollama-webui --restart always ghcr.io/ollama-webui/ollama-webui:main

This downloaded and ran the container, which I forgot about until I saw it running in my Docker list.

Connecting and Getting Going

The command above runs on port 3000, so I went to port 3000 on my local host and saw this:

2025-01_0162

I clicked signup and added info, which isn’t really checked.

2025-01_0163

The first account is set at the admin and I see this screen:

2025-01_0164

I need to select a model to query, and when I click the drop down, I see the two I downloaded as part of my ollama container setup.

2025-01_0165

I picked mistral and started asking questions. I started with clicking the prompt on the screen, and I saw:

2025-01_0166

If you play with different models, give this a try as an easy way to run an AI on your local machine and see how well it can help you with anything you do.

Note, be wary, and make sure you read the disclaimer at the bottom (circled by me)

2025-01_0154

Posted in Blog | Tagged , , | Comments Off on The Local OLLAMA Gui