Monday, 15 September 2014

Don't build a data platform that works

I mean that a little bit tongue in cheek, but if you build a data platform that simply solves the initial problem you are setting out to do, then you are doing it wrong. You will build an accidental platform.

If you look at the use case in front of you, and maybe a handful more then it is easy to get tempted by a technology choice or an approach that suits that limited scope. Somewhere down the road it has the potential to bite you in the arse because you didn't think far enough forward.

I'm definitely not saying that you should go hell for leather with a 'big design' up front, and I would suggest that that applies more to the schema or structure as opposed to a modular and scalable platform. What you need quite simply is options. You don't need to have figured out every answer, but you need to know if there is an answer to be found and that you have a rough idea on what to do. Make your life easy for yourself and figure some of this out in advance. When you need it, things become easier.

I've had occasions where I've been told we need to double our full setup and time was tight. I was ready for it as I'd built a modular system (and I don't simply mean bolting on a few more servers). I didn't have an actual plan, but I'd left myself options that made it easy to figure things out.

If you are architecting a system, you have a couple of responsibilities. Providing options (without spending too long figuring them out) is one of them. Providing a timely and financially justifiable solution are a couple more. You are being paid to be the expert and winging it is not something an expert should do.

If you go headlong into an approach without knowing how you are going to scale, what the costs are, how much kit and so on then you will very likely go wrong. When you have a quiet day, spend some time figuring this all out. One day it will come in handy.

If your answer is simply 'we can add more servers' then you haven't thought it through enough. What happens when I add more, how do we balance things when we do this. What effort is required. What do we impact when we do this ? etc...

I have a lot of respect for the developers that I have worked with over the years (and there are hundreds of them). However, there is a different mindset between a developer and the man who gets called in the early hours being told that 'the database is the problem'. (Hint, it probably isn't).

What you are missing is 'everything other than your immediate problem'. By that I mean everything else going on in the system that isn't directly related to the problems you are solving. Database platforms have many many people connecting to many many different things. Some things are done well. Most things are not.

For me, when building a data platform, I have to be 10 steps ahead of everyone else and have always needed to have thought ahead as many problems as I can do. It's my job to take away obstacles before you've run into them. It's a bit like a game of chess. When I give an answer, I've already thought about my moves weeks or months before so it is a qualified answer and not one made up on the spot. I've seen plenty do this and sometimes it works and sometimes it doesn't.

For me, being obsessed with the details comes with the territory. Seeing how ALL users interact is necessary. You have to get a feel for the system. It is almost like a living beast.

You have to know the characteristics (and all of them if you can). 

  • Learn everything you can about the patterns of workload
  • Learn what stats a metric can be at any point of the day
  • Figure out which ones are important (this helps massively when diagnosing problems)
  • Did you size and cost things properly ? Without size you cannot cost it nor know it works.
  • How does it work when someone does something stupid ? They will.
  • What breaks first ? (Second, Third and Fourth etc)
  • What is giving us our worst workload ?
  • How does this impact other workloads ?
  • Does fixing one thing kill another ?
  • How are you going to secure it ?
  • What happens when the business changes direction ?
  • Did you think about high availability, failover and recovery ?
  • Do you know your RTO/RPO ?
  • Can you actually achieve it ?
  • Did you practice that ?
  • Backups and maintenance ?
  • Do the files actually restore properly ?
  • Backups and maintenance when everyone is doing something stupid ?
  • What about all of that when the caching tier is dead ? 
  • You did realise that people aren't going to capacity plan didn't you ?
  • Did you think through Dev, Test, QA, Sandbox ?
  • How about poor releases and doing these at full tilt without downtime ?
  • Did you actually do the maths or did you just guess ?
  • Did you think about what the business is likely to do that they haven't thought of yet (like a massive import of data, or batch processing hundreds of millions of rows) ?
  • and so on.....
Getting an answer for one use case is NOT building a robust platform.


So, don't build a platform that works. Build one that always works.

It is far more technical, far more difficult and requires a long term commitment and good forethought. I'm less interested in a solution that works (this is bread and butter stuff so should always be easy), but I want to know I can guarantee that we can run with a broken leg. Saying 'I don't know' isn't going to cut it when the site is down.

We had an occasion a while ago where our caching tier was in tatters. We managed to run without caching for 3 weeks. This is for a multi-million pound dot-com business. On the DB server side we handle 25k queries per second (with caching working). We could take the strain. We had options.

So when you think about building a platform, think well beyond what you think you need. It isn't easy, believe me. Even building my most recent platform with something I've worked with for nearly 20 years has been difficult. I'd say 12 months went into getting things workable. 2 years then went into making it right and 2 more years planning the next generation to the extent that I now only need to think about the schema and have a scalable platform to cope. So when you come to me and say 'we've read a blog' or 'we've been to a conference' and 'we think we can do it better next week', then I'm sorry to say you are in for a hell of a surprise. I don't mind you learning to swim in the deep end. It might do you some good, but don't think I haven't thought things through.

No comments:

Post a Comment

CV Driven Development

Over recent years I've watched a worrying new trend emerge which I think of as CV Driven Development. What I mean by this is that people...