Author: way0utwest

  • Data Modeling Information

    Data modeling is something that we should all be doing when altering the schema in our databases. I’d like to think that most people spend time here, but I don’t think that’s the case. I think plenty of people think “I need to store a piece of data” and they pick a string or numeric datatype and start stuffing in values. If in doubt, just pick a string. It’s why I think we have lots of dates stored in string columns because that was someone’s first thought.

    There was a post recently that talked about storing data in its highest form. It was interesting to me because these are the type of decisions I try to make when designing a table. What is the best form in which to store data? The authors talk about picking not only a type that easily converts, but the fields that make it easiest to work with the data in different ways.

    I do think that the aggregations or calculations that we need to perform should influence your data type. If you are measuring something, use a numeric. In fact, in their example of movie times, integer is probably the best type. While many databases and languages have time datatypes, some represent a measure of time (timespan), while others represent a clock (T-SQL time). Either might work for movies, but in aggregations, the T-SQL time will have issues beyond 24 hours. An integer is a better choice, assuming we don’t care about seconds.

    The second part of the post looks at multiple values, in this case customer loyalty points earned and redeemed. A simple running sum is what we might store in a database, though the application class might need two fields. Of course, modern software often totals these things for a customer as part of gamification and inducement to engage more, so maybe a data store would also want to store the title earned and redeemed, with a calculation to show the balance.

    The one thing that I might add for developers to a post about modeling is the need to consider operations at scale. While using a bit more or less storage often doesn’t matter for any row or any operation on a singleton set of data, when we scale across millions of rows, little things matter. Consider how your data might be aggregated and what happens if you have millions of rows to work on. There a better design decision can out perform a poor one by many orders of magnitude.

    That and generate lots of data to test. You ought to know how to quickly mock up a million rows to check your queries. You might have a million rows in production.

    Steve Jones

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

  • Off to the 2023 Microsoft MVP Summit

    I’m off today to Seattle, Redmond actually, and the Microsoft MVP Summit. This is an annual conference Microsoft has run for their MVPs, allowing them to interact and learn from the developers for various products.

    I am a Microsoft Data Platform MVP, which means that I’ll mostly be seeing sessions and talking with the developers for SQL Server, Azure SQL, Synapse, etc. All the Data Platform stuff.

    The entire event is under NDA, so I can’t discuss anything that happens or what I will learn. At least not this week. A lot of this will come out from under NDA in the next few months, and this event gets me the chance to work with some things before they become public.

    It’s also the chance to get to know the developers and product managers better. I’ve become good friends with some over the years, and I look forward to the chance to not only learn from them, but share a meal or drink at some point this week.

    A quick trip, out today, back Thursday. Just in time to meet the tractor guy Friday.

  • Coming Out of the Cloud

    Google has launched a version of their AlloyDB that can be installed on-premises. AlloyDB is a PostgreSQL compatible cloud database, a full-managed PaaS service. However, they are giving away a free developer edition and a paid for commercial license that can be installed where a customer wants to run it. The new product is called AlloyDB Omni.

    I like Google’s approach here. Obviously Google would prefer lots of their customers would move to the cloud version hosted in GCP (Google Cloud Platform), but they know that’s not realistic. Even for customers that want to move to GCP, the customers might need to keep some workloads on-premises for a period time, so Google is giving them an option to modernize their workload with a new datastore that is PostgreSQL compatible, but running on-premises. Presumably this will be compatible with the cloud version and if customers want to, they can just shift to AlloyDB.

    This is similar to what Microsoft is doing as Azure SQL versions, both  database and Managed Instance, are mostly compatible with SQL Server on-premises. There are easy migration paths, but since the cloud and local versions aren’t quite the same, it might not be simple to migrate. There are lots of tools to help, but the biggest problem (in my mind), is having a development environment that mimics what I get in the cloud. I need to be able to work not only offline, but with the unlimited CPU I get on my laptop. I don’t want to pay for developers to stand up cloud instances to experiment with code.

    There is the SQL development container (running Edge), but that’s a container and I find far too many people don’t like working with the container versions. They struggle with getting their data set in the container, or keeping it up to date. Plus there’s the fact that the local environment seems linked to database projects, which not everyone uses. Especially those of us using Redgate tooling.

    I have been surprised in the last five years by how many companies have moved to the cloud. I’m especially surprised how many have performed lift-and-shift migrations to IaaS services after a mandate by management. I’m also not surprised that many customers find they’re spending too much, and that both Azure and AWS realize they need to help customers spend less before they lose them.

    The cloud can be a good place for workloads, but you need to plan for it, and often you need to modernize apps, make them less chatty, and write better code against your data services. To do that, I think you need a local dev environment and I like the way that Google is providing that with AlloyDB Omni. I wish we also had a switch to get a local SQL Server dev edition to act like Azure SQL DB.

    Steve Jones

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

  • Tesla One Year Review at Nineteen Months

    Well, not one year. More like 18 months, but close enough. I’m writing this at just over 17 months of ownership, from Sept 2021 to Mar 2023.

    This is part of a series that covers my experience with a Tesla Model Y.

    The Highlights

    I never need gas and I have a full tank of fuel every morning. That’s the practical me, the real highlight is that the car is so fast it’s a lot of fun to drive. I stop by gas stations regularly for my diet Coke addition, and the few times I use a gas car, it’s strange to have to pull up to a pump and get fuel. In fact, I sometimes drive next to the little store and then realize I need to move the X5 because it needs gas.

    The car is fast. Acceleration is still exciting when I use it. Mostly I drive in chill mode as I don’t need the speed, it’s surprising to passengers, especially the dogs, and I sometimes bounce my own head off the headrest. However, when I need it, it makes merging into traffic easy because I can quickly match speeds with others.

    The car giving me access to data and controlling it from remote places is cool. I could start it for my wife when her phone died. I can heat/cool it from the gym or ski slope before I get to it. I have seen the UI change across 18 months to add features, like dog mode, like moving the camera display for turning, music controls, etc. I like this.

    Autopilot is great. I use it in certain places, and it keeps the car moving down the road, through bends, letting me watch the road, but not have to focus so much. It’s really nice when I’m tired that it reduces the stress of driving quite a bit, especially over distances.

    However, mostly, it’s just transportation that just works. I enjoy driving it, and there are times my wife and I are both wanting to drive it. I miss it when I’m in the X5, or the Suburban, or in a rental. At times, I wish we’d gotten an electric UTV instead of another gas one, but I’m not 100% sure Polaris has figured out the process of building a reliable electric car, both with batteries, motors, and software.

    The Issues

    Autopilot isn’t perfect. First, it doesn’t change lanes. I could subscribe and get that feature for a price, and perhaps I’ll do that sometimes, but it also has issues. Phantom breaking is much better, but it still flips out in a few places in Colorado. The stretch of C-470 from I-25 in the South going west to Kipling has a few places where the car reads the exit lane speed limit and slows from 70 to 55 quickly.

    There also are a few places with sharp curves of cresting a hill where it doesn’t handle things. It also sometimes accelerates and brakes like a new driver, being late to do both. I tend not to use it with my wife because she gets annoyed. As a driver, I can predict these places and I’m ready.

    Climate control isn’t perfect. Overall it matches temp well, but the lack of vents in the back, either in the console or side pillars, mean there isn’t great control in the rear. The lack of two fans or vent controls  in front also means that sometimes either the driver or passenger has to compromise with more or less fan than they might want.

    The front defroster also doesn’t work well in sleet. Most of the time it works OK, but my wife struggled with it in a bad sleet/rain/snow storm. I think this wasn’t engineered as well as much of the car.

    No having a rear wiper is annoying. It hasn’t been too much of an issue, but a couple times I wish I had one. It rarely rains in CO, so this might be a bigger issue in other places. The view out the rear is poor as well, which is annoying. With the cameras, I haven’t found this to be dangerous.

    In line with that, I wish I had a way to pop out the door handles, like the Model S. In snow, or at night, I can’t always find them easily, especially while carrying stuff. Rather annoying.

    It rarely happens, but sometimes the app loses connection to the car and I can’t open the doors. I have to kill and restart the app. Not a big deal, but it does happen. I also don’t always have my keycard with me, so I get slightly worried this might cause an issue at some point.

    Lastly, a trim piece in the car broke and was replaced under warranty. It needs to be replaced again Sad smile

    The Costs

    What has this car cost me? Here’s a breakdown:

    • Fuel: $919.80 in electricity (ish, my logger was down a bit). This is for 28k miles. My 100mi cost is $3.28. I’ve also spent about $87.44 at Superchargers.
    • Windshield fluid – 5 bottles at around US$4
    • New Rims – 1058.96 (busted one in a pothole. A single one from Tesla was $400 so I just got a new set aftermarket)
    • Winter Tires – $465.18
    • Flipping tires – $270 (3 slips. summer->winter->summer->winter)

    Of these costs, the tire costs would have been roughly what I’d have done in many other cars. Rims, hard to know. I could have bent one in any case, though the weight of the EV probably made this more likely.

    Maintenance has been about $20. Fuel is low. My 100mi cost in the BMW is easily $14-15 or more. That would have been around US$4k. That’s $3k savings.

    Registration is adding a new $8 sticker for EVs in my county, which I wouldn’t pay for a petrol car.

    Summary

    My wife and I were driving recently after a snowstorm. The car started beeping because it thought I was getting too close to the curb, but I was far away. However, the white snow had piled up and likely reflected enough to worry the car. Annoying. It also slowed the Autopilot during a light snow storm because it couldn’t see. Again, annoying.

    However, we both think the car is still the best one we’ve owned. We enjoy it immensely, even with a few quirks. The dog mode alone has been a large value add for us.