Loading...

Snowflake Connection Provider

September 11, 2023
2 minutes to read
Share this post:

Hi,

What do snowflakes have to do with software development?

Strange question, I know.

But I had to ask myself this recently.

I was going through the code.

I wanted to understand which connection pools we have and how they are configured.

That’s when I stumbled upon a connection pool named SnowflakeConnectionProviders.

Huh?

What is that supposed to be? And how is it used?

And why is it a HashMap<String, IConnectionProvider>?

So: Find Usage and read on.

Aha, a small pool size is configured in the init. But why?

In which scenario would I want a connection pool that only uses about 1/6 of the available cores? 🤔

I couldn’t grasp its purpose.

And before I grope around in the dark: Better to ask someone instead of wasting unnecessary time.

So, I called the developer who is knowledgeable about this topic.

And the explanation came right away: Years ago, an important client demanded that there be an audit on the database queries.

And as it often happens - it was implemented just for that one customer. To achieve this, only this client needed a different user and since the user is configured per connection pool, this “Snowflake” had to be added.

Aha!

So that’s where the name came from.

It’s the silent protest of the developers.

They didn’t want this exception.

I recently wrote about how it’s not a good idea to cater to individual customer requests in the product business. This is one such case.

Two things we can learn from this:

  1. Be cautious with individual customer requests. It’s either a feature, or it won’t happen.
  2. Name your variables and methods in a way that they describe their purpose. AuditingCustomerConnectionProvider or something similar would have made it instantly clear to me what it was about.

On that note.

Rule the Backend,

~ Marcus

Top