Daily Coping 18 Nov 2021

I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

Today’s tip is to try a new way to practice self-care and be kind to yourself.

I have tended to push myself to do more and more. It’s driven me, and it’s helped me be successful.

It also throws me a bit our of balance in life, and I don’t relax well. I’ve been working on that for the last decade plus.

Lately my body gets worn out or more tired. Parts hurt as I age. As a result, I’m learning to slow and take care of myself more. The other day, I was at yoga, and my ankle was acting up. Rather than push, I slowed down, I skipped some things, and I sat and sipped water, relaxing a bit.

I find myself doing that more often, caring for the things I can do that day and not being upset that I can’t do more. It’s helped me find a better mental balance.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 18 Nov 2021

STRING_SPLIT Has Ordinals

I noticed the docs for STRING_SPLIT now show that there is a third parameter. This brings us an ordinal for the positioning of the data. The format is now:

STRING_SPLIT( string, separator [, enable_ordinal])

This is a bit or int that determines if a positional value is added to the result set. Here’s a quick demo.

No third parameter shows this:

2021-11-16 13_32_11-SQLQuery2.sql - dkranchapps.database.windows.net.SimpleTalk (sjones (89))_ - Mic

If I add a 1 for the third parameter, I see this:

2021-11-16 13_32_37-SQLQuery2.sql - dkranchapps.database.windows.net.SimpleTalk (sjones (89))_ - Mic

Right now this is only in Azure. I assume we’ll see this in SQL Server 2022, but we’ll have to wait and see.

Posted in Blog | Tagged , | 1 Comment

The API Bottleneck

While talking with a client recently about their performance challenges, I was relieved to find that the database wasn’t the problem. Instead, their API server was overloaded by the number of calls taking place in their application. While the database did provide the backing for the API calls, there was a fair amount of caching. However, as they’d moved to microservices, more and more of the interaction between modules was taking place as a network call to a single server, which became overloaded.

Certainly, they could add more API servers, or break out different types of API servers, but each of these changes potentially has downsides. Data can become out of sync across two systems, which is why we often want a single database storing all data. Distributed systems are hard to architect and implement, and I suspect as more developers try to build them, we’ll find more issues like this. Not that developers are doing anything wrong, but they often don’t realize the challenges of building a distributed system when the workload scales.

They’re relearning the knowledge that others have gained through their own experiments and failures.

One of the things we try to do here at SQL Server Central is share our knowledge with others. We hope to help each of you learn from others, and hopefully not need to make the same mistakes in your applications.

As I listened to the client talk, I was reminded of this post from Troy Hunt. In it he talks about the HaveIBeenPwned site, which he built a scaled to meet demands. The site doesn’t cost a lot, but there is a great quote about the API server he set up. He wrote: “I’ve tested it with 380k queries a minute! Infrastructure will scale out and magic will happen, so long as you’re not maxing it out for perpetuity, just go for it.”

However, in your company, you might be scaling in perpetuity in an app, especially as a workload grows and more parts of your application need to make queries against an API. Good design, good coding, and adhering to good distributed system design, will help ensure you can handle the load. This is especially true in the cloud, where scaling up is just provisioning another resource, but there is a cost.

You have to know what to do, so I urge anyone looking to build a distributed system to read about the experiences of others. Learn from their knowledge, rather than make your own mistakes and try to correct them. There is a lot of great information out there, but you need to be looking for resources that provide technical details, like Troy’s posts on how he built his site or Jeff Moden’s posts on writing high performing queries. That’s the type of knowledge that is invaluable if you want to be an efficient and effective developer.

Steve Jones

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

Posted in Editorial | Tagged | 2 Comments

Daily Coping 17 Nov 2021

I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag.

Today’s tip is to do something playful outdoors – walk, run explore, or relax.

Usually today would be a little hectic with work and coaching at night. However, no coaching tonight, so I’m going to take advantage of the time.

It’s dark early with the time change, so I don’t want to be outside late, but it’s work from home, pandemic style. I’m going to knock off at 2pm and go for a hike outside, getting a little fresh air. It may be cold, but I’ll still enjoy November in Colorado. I’ll pick up a little extra work when I get home, and it’s dark.

Posted in Blog | Tagged , , | Comments Off on Daily Coping 17 Nov 2021