Tuesday, 19 January 2016

Q&A with Sergey Smirnov

Welcome to the Q & A sessions where I get people who are working as database professional’s to share their experiences, their thought processes and give out some golden nuggets of advice along the way.

The first session is with a guy who has worked with SQL Server for quite a bit of time so picking his brains was a real privilege. We talked about a bunch of things; what the DBA role means, database development, SQL2016 and shooting things! There are also a few wise words of wisdom for those thinking about working with SQL Server.

So here it is, Part 1 (of 2) of my Q & A session with my good friend Sergey Smirnov!

So, to begin with – who are you and what do you do?!
My name is Sergey Smirnov, 42 years old and I am a database guy – particularly MSSQL Server. Designing, planning, coding, troubleshooting, administering and so on for the last 25 years.

How did you get into databases? Was it a planned career move or like many of us, completely accidental?
Yes and no. I built my first computer when I was 14 and after few months I knew what I want to do for living. I became a database person when we start doing our first commercial software (the one that we told to be paid for) – just no-one else want to be a DBA. Then I simply liked it!

So what was the first thing that made you think “I’m a database guy”?
I think it happened when I understood how important it is to have a well built and well-designed database for any software system. I saw many heavy and complex systems that were suffering a lot from pure or “generic” database design or coding. So I thought there would always be a job for someone who knows how to improve things!

Would you say the DBA is a popular role? From both perspectives, companies needing them and employing them and people want to go down that route? 
No, I would say that DBA role is mostly underestimated until it is too late. IMHO the main problem here is that how database design and coding is usually done – it is very common that front-end or middle layer programmer also doing SQL queries without enough knowledge of how databases are working. As a result on the development stage the is no need for an experience DBA because everything is working just fine for a few developers and testers and when it gets hit by hundreds and thousands of users it is too late to restructure a database design.

Many of us talk about the DBA role being more than a job, it’s a passion. Do you agree and what specifically do you enjoy about the role itself?
True, I totally agree. It is as much passion as any other job that you like to do J In fact my specific passion is troubleshooting existing code or design a complex database systems

Any bad bits to it?
I always saying that it is people that do all the troubles. Database without clients would be a perfect one!

I did once read that the perfect database is one without users! 
I glad to know that someone else shares same view. :-)

You’ve worked with SQL for a long time. Would you say that it is important to specialise in one particular area and if so, what would you say is your main area of expertise as a DBA/Developer and is it also the part you most enjoy?
It is important NOT to have a very narrow specialization in database world. You cannot be an excellent DBA without good coding knowledge and vice versa. I personally enjoy coding, performance troubleshooting and distributed system design most but I am trying not to be too much specific

Would you say there is a gap between developers and DBA’s and if so, how as a DBA (or a developer) do you remedy that? For example, training, integrate more with other teams.
To avoid this I am trying to involve DBAs to development and developers to DBAs tasks as much as possible and to separate database development from other development and coding.
In ideal situation I am trying to build a database “black box”, where outside development just requests some data or functionality from a database and database team design, develops and supports it.

As an ex developer myself I think a mutual understanding is very important. As well as coding knowledge what sort other things do you find cross over between the DBA and Development roles?
I never believe to separation of DBA and database development roles. From my experience tuning database or hardware settings can give you something between 5 to 10% of the performance improvement – but if you want a real performance gain you need to look on the database code. Yes, there are some routine operations that has to be performed by DBA and support of the “system from the box” is different – but you don’t have to be a very experienced person to perform most of them.  

So would you say then that developers should try to gain more of an understanding about SQL itself, how the engine works perhaps? For example one thing I found rather quickly was that standard coding techniques like recursion do not apply well to databases.
Yes and no. There are two different worlds – good OO programmer thinks objects, encapsulations and inheritances and good DB programmer thinks tables, joins and Cartesian multiplications. I believe a combination of strong OO programmer with DB knowledge and good DB programmer with some OO knowledge will build a perfect development unit.  

Monday, 18 January 2016

Q&A with Sergey Smirnov - Part 2

Are there any non-SQL area’s that you like to work with?
Networks and hardware, smart houses and automation. 

Smart houses and automation, is this a personal hobby?
I wouldn’t call it a hobby, it is just an area that kind of IT related and where I most likely spend a few bucks! My personal hobby is clay and target shooting.

I imagine that’s quite an ideal hobby for a database professional!! 
Shooting a few things after hard day is priceless.
Many big companies are using other database systems like MongoDB for example? Should DBA’s try to pick up knowledge in other databases?
Of course they should – there is no such thing as too much knowledge! My point is that before use it you should understand two things – their limitations and their market share. It may be much effective to invest you time to something else. 

So speaking about DBA life in particular, what sort of routines do you follow; what would the typical morning look like?
I am a development DBA and work on many projects in parallel most of the time and each of them requires its own routine. To manage it I usually prepare a “what-to-do” plan for next day every evening together with a more sketchy weekly plan.

So the to do lists are very much part of life?! 
They really help you to get a few extra free hours a day J Organizing your work time is good and works well. Apart from things like Agile which I hate as much as possible.

For production DBA activity I have a set of scripts, jobs and warnings that actually alerting me if anything odd happens on the servers – I believe in preventive medicine and trying to fix things before they became issues.
Yes a key there in being preventative, what are the most common problems that you encounter, particularity when troubleshooting servers for the first time and what should be looking for?
Most common problem that I see is bad written code. It wins with a huge gap over the second most common problem, which is bad indexing. Third place is bad design but it is also related to the first one.

Key things to check for the first time would be a ratio between index seeks and scans, disk, CPU and memory pressure, wait stats, list of long-running queries, locks and deadlocks. After this you usually have an impression what needs to be done first thing.

Bad code, I think many people will agree! Do you have a particular method of taking a “bad” query and tuning it?
 It’s never been hard to find a bad code! Tuning is different situation and it’s depends on many factors – sometimes adding a new index to “key stone” table instantly increases performance for the whole system and sometimes you spend a day looking on one single query and trying to win a few milliseconds or a few CPU ticks. It depends.

What do you think of the junior DBA role? Personally I don’t see enough of them advertised.
Good question. From one side I understand that nobody wants to give their important data to junior hands. From other side – we all were juniors. I like to take a junior DBA to the project if I see a potential and I advise them to search for a projects where they can learn fast.

And to somebody staring out as a DBA, what three pieces of advice would you give them?
Listen, but never blindly trust what others saying

Just how important has learning been to your career? How do you learn best and what resources can you recommend?
In our business you have to run to stay in the same place so learning is very important. I learn best on my personal experience – I have to try everything myself to be confident that I understand how this or that is working.
Best learning resource for is still Microsoft BOL, second best are Internet blogs and forums

And would you say that certification is worthwhile?
Yes – it helps an HR or Dev Manager to feel that they picking up the right guy. It also helps me to feel that a person that we hire understands this point :)
From technical point of view certification does not teach you anything, it just confirms your knowledge.
I always do a fresh certification before looking for a new job – it increases my chances to go through HR filter!

So we know one another from LinkedIn, the SQLDBA group in particular – what benefits do you see from people, fellow database professionals in using these groups?
For me it is an access to second opinion or alternative point of view. It is also a good source of new features or techniques that may worth to learn.

So talking about new features, are you presently using or planning to use SQL 2016? If so what do you think are the key features/improvements?
 I would like to – if my current job permits. Regarding features, I am kind of skeptical about encryption ones. This may be good from enterprise point of view but for DBA it means that server will consume more resources.

Query Store seems to be a brilliant feature – I may not need to do it manually anymore!

PolyBase and Stretch databases – mmm…more skeptical than positive, unless until I see myself how they work. I worked a lot with distributed views and queries before and know a lot about issues related to it. Don’t think MS gets them fixed.
Row Level Security – skeptical. In the majority of cases row level security has to be built based on the business rules, not SQL Logins.

Do you think it will it be a big a release as SQL 2005 was?
The biggest ever release was SQL 7 – after SQL 6.5 J For me SQL 2016 has more marketing features than technical improvements. However I hope I am wrong!

So to round things up and this is for those who might be thinking of going down the DBA route - what three things, skills or attributes would you look for in a potential DBA?
-        Passion to learn
-        Passion to stand on own opinion
-        Ability to admit that it can be wrong from time to time J

Finally, last question about you, if you weren’t working with databases what would you be doing?

No idea J Building something – computers, houses, cars, guns, anything! Something that you can look at and say – I built it and I am proud!

Tuesday, 5 January 2016

SQL Bits - Training Day Sessions Booked!

One of my new year resolutions was to finally get to a SQL conference this year. Well, OK I cheated a little bit in that I came up with the resolution after I had booked but hey, it's my resolution so my rules!

So this year I am heading to the SQL Bits conference which is going to be held in Liverpool from the 4th to the 7th of May. 

Now one problem that I have already encountered is the training day sessions. These are full days of training where you are taught by some of the leading experts from the world of SQL, which is fine, well it's fantastic to be honest. Until you have to decide which one to go to.

Seriously, you would think it will be easy. The sessions are split into tracks; DBA, BI, Dev, Azure so perhaps I can just hone in on one of these. Well yes I could, but I still quite fancy all of them.

So after a long time thinking about it I went for the SQL Server Index Formulas: Problems and Solutions session led by Kendra Little. Indexing is a fascinating area that I work with a lot and (like most of us I am sure) I have watched many of Kendra's training videos so getting a full day is going to be awesome!

Day two was equally as difficult. How about T-SQL for the Experienced Practitioner led by Itzik Ben-Gan? The guy who's book on 2005 T-SQL seriously helped me on the way in my career? How about SQL 2016? Well maybe Advanced Accidental Database Design for SQL 2016 by Thomas LaRock and Karen Lopez should get the vote?!?!

In the end I went for the latter. SQL 2016 is going to be huge so getting trained up by these guys, well I cant wait!

So there you go, conference booked, hotel is booked...I think, and now finally I know what I am doing on the first two days! 

Looking forward to it! 

Installing SQL Server Reporting Services on a cluster

Installing SSRS on a cluster is a relatively easy process to follow and in the most part it is the same as when installing on a stand alone instance. However, SSRS is not cluster aware so when you try to install it on a cluster (node or cluster name) you'll get so far, then this will happen:

Existing clustered or cluster-prepared instance = Failed.

Darn! This particular install is now finished, we can't click next and we'll have to start again. This time though we will run the SQL setup slightly different. In a command prompt go to the directory where the setup.exe is situated and run the following command:

Setup.exe /SkipRules=StandaloneInstall_HasClusteredOrPreparedInstanceCheck /Action=Install

This will ignore the clustered instance check and allow you to install SSRS as normal. Please note the process must be repeated on any other nodes in the cluster. One final point if you are using a report database on the cluster, you must specify the clustered instance name, not the node name.