ADSD with AOA and Udi – Day 4

It has been four days since I slept.

I am hallucinating Authorities (aka Services), Bounded Contexts, or is that Business Components? Up is down, down is up. Everything is abstract. Everything is physical but different. Or not.

Today we moved at a much steadier clip through our materials. I was more alert by necessity, and there were fewer tangents, although still enough. There’ve been a few cases of not-really-questions-more-comments-to-try-and-impress, but far more frequent are in-depth tangents that feel like individuals trying to get some free consultin’ out of Udi.

It is of course hard not to bring your real-world scenarios into the learning experience, but there is a difference in the feel of a question motivated by not-quite-understanding and a question that is looking for a solution.

Today was actually surprisingly more concrete and nuts-and-bolts. Still provocative and even surprising in places though, but I wouldn’t have *that* any other way. Why yes, yes, let’s connect the javascript client straight to the database; and the case he made was surprisingly compelling all things considered.

I cannot quite tell how he felt about CQRS; the tone and body-language was somewhat dismissive, but he explained it with a level of nuance and determination at odds with that posture. He was definitely dismissive of Event Sourcing though. And we’re not allowed to use Udi Says for justification, but it was hard not to sympathize with his assessment of the limitations on its value.

He still reveals some things with a larger sense of mystery and caginess than I think is warranted, but at this point I’ve decided the showmanship is just getting the best of him.

And… I was so hopeful.

We got to 200 pages out of 250 around 4pm. I thought today was going to be an “early” one (i.e. 5:30pm for example), since I knew he had a further speaking gig in the evening, and surely he eats?

In the end he raced through to page 237 by about 7pm. I’d have said that bodes well for an early mark tomorrow, but I really have no idea what to believe anymore. I’m doing my best to stay focused and absorb everything throughout the day, but it is … so … hard.

One more day.

I can do this.

And then, hopefully, a more in-depth summary of what I got out of the experience.

The Answer Might Surprise You.

ADSD with SOAAOA and Udi – Day 3

Dear diary, today is day 12 of my 5-Day Training Course.

I would complain about the energy drain if not for the appreciation that Udi is investing so much of his time. Every day starts at 8:30, and goes well past 6 pm with very limited breaks. It’s a … marathon? (I hope?) We’re now 30 hours in with at least 20 more to go that I can tell, excluding further homework tomorrow.

I am a bit mystified why Udi uses the word “Service” so much when he clearly has a distaste for its nebulous definition and general appropriation. “Authority Oriented Architecture” sounds like a much better descriptor overall, even if Authority isn’t ideally unambiguous either.

IT managed to go through all the good words by the end of last century, re-defining them all into meaninglessness.

The pattern in Udi’s style is abundantly clear by now; cleverly selected examples without singular answers, and a well-honed skill at arguing, together make for a lot of head-scratching around the room. I am enjoying thinking around the provocative propositions he throws out there, but I cannot help but feel there’s a level of empty calories about the exercise.

There will be no technology advice anywhere along the way. That’s an implementation-detail that is case-specific and therefore not something he can (or will) give us. I think some in the class are still hoping/thinking we may end up there, but that’s not the direction this course is following.

There will also be no scientific underpinnings for the theories. De-composing architecture along the lines of his advice is a good thing, because. And by squinting just right I am convinced overall that’s true, but I wish I had something more concrete to hang that on. Case studies. Empirical evidence. A rigid mathematical proof (I can dream…), but that’s also not where this is heading.

It’s a very valuable exercise at stretching the mind, and learning new ways to approach architectural and design decisions though, and that’s not to be sneezed at.

Still no silver bullets, sadly.

ADSD with SOA and Udi – Day 2

So,…

Apparently I am back in school now; after a long day (8:30am – 6:30pm) I have a homework assignment for tomorrow. I had hoped to get some extra sleep tonight, but no luck.

Using Thing-Oriented-Architecture, I am modelling the service boundaries for a hotel booking system tonight. I probably will save some for on the train tomorrow morning, because I could barely keep awake today and if I don’t sleep well, tomorrow will be worse still.

As much as yesterday felt like the set-up for some grand unified theory on distributed design, after today it feels like there aren’t going to be any answers, just increasingly vague questions. And a lot of my own opinions. So maybe more than anything this is a course to help me figure out what I believe myself? With some rules-of-thumb thrown in?

So far the single most useful piece has been a helpful question to determine whether services are sitting in the right context together (or not). I can tell it’s going to get a big work-out in time.

And I’m looking forward to the suggested approach to pull information back together into a cohesive interface. I can kinda see where Udi’s leading, but it is still a little bewildering. This may be exacerbated by the fact that he is clearly purposely constructing worst-case examples to push boundaries.

I’m hoping tomorrow brings more answers than new questions.

I’ll hold off on holding my breath.

ADSD with SOA and Udi – Day 1

I am learning this week.

Advanced Distributed Systems Design with Udi Dahan.

So far, I have acquired many new questions that I didn’t think I had need of, and I am hopeful that in another 4 days they will all have disappeared again whence they came. I am an optimist.

One thing missing from the copy of the slides we all got was the reference table for quick lookup of relative latencies in computers; it’s good to keep in mind how much slower memory is than the CPU, and how much slower an SSD is than memory, and network than SSD and reboots beat everything. I kinda feel an urge to start suffixing method names for nasty latency surprises to make it a bit more obvious.

As my mind wandered onto tangents, Conway’s Law took on a whole new dimension too. I wonder if software organisations should ever re-structure if there isn’t a need for software re-architecture.

I have so many provocative notes in my little booklet that I’m not sure how to turn into cohesive provocative statements. I’m also not sure which ones I actually believe yet, so maybe I will have a more nuanced view to filter them through towards the end of the week.

There are definitely things I disagree with, possibly strongly, but I haven’t given them as much thought as Udi, so I do not feel qualified to disagree overtly just yet.

First, I need to get through all these damned questions.

Testin’, What is it Good For?

Not quite absolutely nothin’, but I am starting to wonder.

More tests means more coverage means more green that changes to red at the slightest change. 100% test coverage means 0% freedom to change a line of code without changing a test as well.

At the start of the month we retired a truckload of tests at work, and the world didn’t end. We instated a rule that tests that are red for 3 consecutive days get terminated with extreme prejudice. Always red = no value.

But I have been thinking. What is the value of a green test? I mean, a test that is always green. Tests that have never been red are no more valuable than tests that do not go green. But it is so hard to let go; so tempting to think that a test surely inherently has value.

But do they really?

What makes a test worthwhile? What are tests for? How many?

Bug-free software is a white whale. Every test is a constraint to change. Like any other code, it isn’t free; keeping it is costly. So, I guess the answers are “just enough” and “giving us confidence where we need it” and “when it proves a real invariant truth”.

I just need to work out a practical applications of those holistic answers. But it definitely starts with “less is more”.

Day 349 – Go PRO

17 – Digital Video Production Cookbook: 100 Professional Techniques for Independent and Amateur Filmmakers

Technically I have all the pieces of the puzzle.

I have a valid Camtasia license, I have a Canon 6D to work with, and in a pinch the Nexus 5 will do some decent video as well. Everything I need to put together a decent video on my own time.

But I suspect I need a few more pieces.
Continue reading Day 349 – Go PRO

Day 342 – How To: DIY

24 – The Ultimate Cheat Sheet For Starting And Running A Business

I have ideas. Some of them even seem like good ideas. I’m really not sure what I am waiting for exactly. Probably for that moment of clarity where the good ideas suddenly come into sharp focus, and I jump.

And it doesn’t even need a very big jump to begin with. You don’t jump off a cliff before you have jumped off a hill without bruising yourself. That’d be insanity. And an unnecessary insanity.
Continue reading Day 342 – How To: DIY

Day 85 – Almost a Disaster

I planned the day somewhat hopefully, and I really should have known better. An internal Confluence system was moving between servers, and I wanted to take the opportunity to do a software upgrade.

Calendar/Plan before faced with reality:

  • 4:00pm – Networks guy takes system down, does last backup and then restores on new hardware
  • 4:40pm – I run an upgrade to the latest version, and everything is sunshine and rainbows
  • 4:50pm – Worst-case-scenario, I tell networks guy to re-do the restore and we’ll live with the earlier version
  • 5:30pm – Done and dusted

Overlaid on this plan, I had booked a Pilates Reformer class at 5:30pm, so that if everything goes well I can leave the office at 5pm and make my class. And if not, I just cancel it at 5pm when things go pear-shaped.

At first, everything exceeds expectations. At 4pm the migration starts, and it completes in only 25 minutes! Awesome!

So, my turn arrives to upgrade the software. I run the installer… done in 2 minutes. Awesomer! And more-over, when I browse to the new install, the pages load and everything looks happy. Until I try to escalate to Admin privileges.

Oh dear, I broke authentication.

The system spits out lots of messages at me, and I decide there is just no time to fix this on-the-fly, so I make the call to restore the backup and just live with the earlier version of the software.

No big deal. It’s a shame not to be on the latest version, but on the upside, it is now 5:35pm and after another restore it will still be shy of 5pm, so at least I will make my gym class.

The restore completes.

As part of the software upgrade, the installer upgraded the database server which resides on a separate host that is now incompatible with the earlier version of the software.

Okay, so the only way is forward. I cancel my gym class, since that’s just not going to happen now.

I make a backup copy of the software folders, and re-run the installer.

There was a message about something to do with “cacerts”… that sounds like it might be relevant. Another Google search points me to the location of this file in the installation.

It turns out that the certificate file got replaced as part of the update. The version of this file in the backup I made earlier has a different size from the one that’s there now.

So, I make a backup of the new version, overwrite with the old version, and see what happens…

And the Software Gods Smiled Upon Me, and Behold! The System Now Worked. And It Was Magnificent. In that way in which everything is magnificent when it works right after you thought you were going to be there all night.

I guess I’ll have to go on a long walk after dinner to make up for the missed exercise tonight. I could do with the soothing evening air.

Day 51 – Fractional Resource Plan

The Problem

I like being systematic and scientific about things where I can. Today I had to figure out what could be done to add bandwidth at work so we can take on more projects.

Let me paint a hypothetical that has slightly easier numbers than the real-world scenario I was working through.

Let’s say:

  • I have no spare bandwidth across my existing employees
  • I have 100 days of work to do
  • Contractors are going to take about 1.5 times as long due to lack of experience with the systems to complete tasks
  • Contractors need oversight, and for every day of original effort I will need to leave an employee on the work for 1/4 day to supervise and explain things

How hard can this be?

Trial-and-Error

I just needed a number, so let’s start from the top:

  • 100 days of work done with contractors will take 150 days
  • 100 days of work will leave 25 days in-house for oversight

Done! … Oh, wait… the reason I was doing this was because I had no in-house resources left, so I need to contract out 25 days of already planned in-house work to free up in-house resources for oversight:

  • 25 days of work done with contractors will take 37.5 days
  • 25 days of work will leave 6.25 days in-house for oversight

Ah, but again, the same problem… still… 6.25 days is almost negligible, I think one more iteration and we’ll have this worked out:

  • 6.25 days of work done with contractors will take 9.375 days
  • 6.25 days of work will leave 1.5625 days in-house for oversight

And let’s just call that a rounding error. So the total then becomes:

  • Contract resource: 150 + 37.5 + 9.375 = about 197 days
  • In-house oversight: 25 + 6.25 + 1.5625 = about 33 days

It looks like we end up with an endless series of ever-more-fractional contract resources that we need to hire, but luckily it converges quickly. But I’d rather not work this out step-by-step in the future.

Mathematics to the Rescue

I decided that working out the formulas to get straight to the totals based on variable parameters for oversight and the contractor-multiplier would give me a handy tool to assess ballpark figures in the future, so here goes.

I got out some of my old University textbooks to get some inspiration for the right approach to work this out. Luckily my instinct to go straight to my number theory books quickly delivered a winning strategy.

Definitions

To make the following formulas easier to work with, I use the following definitions throughout:

  • R = the number of in-house effort days to fill with contractors (100 in the example above)
  • M = the effort-multiplier when using external contractors, the more experienced and knowledgeable the contractors are in the systems they will work on, the closer this number approaches 1.0 (1.5 in the example above)
  • S = the supervision-multiplier for the amount of in-house effort that stays in-house as oversight (0.25 in the example above)
  • O = the cumulative total number of in-house oversight days needed to supervise the contractors we need
  • C = the cumulative total number of contractor days needed to resource the extra work

Total Oversight “O”

The formula for “O” is slightly easier to derive, so I’ll start there. First, I’ll quickly recap the example I worked through before:

  • O = 25 + 6.25 + 1.5625 + …
  • O = 100*0.25 + 25*0.25 + 6.25*0.25 + …
  • O = (R*S) + (R*S*S) + (R*S*S*S) + …

To get a completely accurate result I would have to keep going on indefinitely adding further ever smaller pieces of employees. (I hope HR doesn’t find out about my plans to slice employees into ever more fractional parts!)

With a bit of trickery though I can collapse that infinite formula into a much more compact version:

  1. O = (R*S) + (R*S*S) + (R*S*S*S) + …
  2. O = (R*S) + S * ((R*S) + (R*S*S) + (R*S*S*S) + …)
  3. O = (R*S) + S * (O)
  4. O – S*O = (R * S)
  5. O * (1 – S) = (R * S)
  6. O = (R * S) / (1 – S)

Step 1 is our original formula. In step 2 I isolate the first term and split out one “*S” from the remainder of the infinite series. The piece between brackets at the end of step 2 looks very familiar… it’s exactly what “O” is defined to be in step 1! In step 4 I subtract “S*O” from both sides of the equation. In step 5 I factor out the “O” on the left hand side. And a quick division takes us to step 6 with a three-operation formula for the oversight component.

Now, note that the division by “(1 – S)” from step 5 to 6 is obviously only valid if S is less than 1. But then, if your supervision factor is 1 or above there is really no point trying to bring contractors in. I’m sure we’ve all worked with people like that.

Unless you are in the enviable position of having contractors available that are so good they do not need supervision, then S will also never be too close to 0.

My gut feel at the moment is that realistic values for S probably are somewhere in the range from 0.2 to 0.5; where it falls exactly depends on the complexity of the work you want to get done, and how much of the work you are prepared to entrust to contractors.

Using this formula on my original hypothetical suggests that in-house oversight would actually be: O = (100 * 0.25) / (1 – 0.25) = 33.3333…

Total Contract Resource “C”

After explaining the derivation of “O”, doing “C” is actually a little easier. Going back to the example again for a recap:

  • C = 150 + 37.5 + 9.375 + …
  • C = 100*1.5 + 25*1.5 + 6.25*1.5 + …
  • C = (R*M) + (R*S*M) + (R*S*S*M) + …

Solving this infinite series of fractional contractors follows a similar pattern to my earlier attempt:

  1. C = (R*M) + (R*S*M) + (R*S*S*M) + …
  2. C = (R*M) * (1 + S + S*S + …)
  3. C = (R*M) * (1 + S*(1 + S + S*S + …))
  4. C = (R * M) + (R*M)*S*(1 + S + S*S + …))
  5. C = (R * M) + S * (R*M) * (1 + S + S*S + …)
  6. C = (R * M) + S * C
  7. C – S*C = (R * M)
  8. C * (1 – S) = (R * M)
  9. C = (R * M) / (1 – S)

I won’t explain the steps, because the tricks used are pretty much the same as in the previous formula.

The bounds on S were already explained above. M should never normally be less than 1, unless you make a habit of hiring the wrong people. How high M could get depends on how much you are prepared to spend on a contractor.

Once again, if you are in the enviable position of having a contractor that doesn’t need supervision because they are already familiar with your systems due to working with them before, then M could theoretically be 1.

If you are solving this problem for S = 0 and M = 1 though, I suggest that you just hire the contractor already because they are probably practically working for you anyway… and a salary is going to cost you far less than contract rates.

Realistically I’d say M is probably somewhere between 1.25 and 2. With values greater than 2, I’d suggest spending a little more and getting a better contractor instead.

Using this formula on my original hypothetical suggests that the required contract resource would actually be: C = (100 * 1.5) / (1 – 0.25) = 200.

Summary

To summarise, assuming you have no employees available at all in-house, then you can calculate the amount of contract resource and oversight you are going to need by picking:

  • R = number of days an employee could do it in
  • M = effort-multiplier for contractors (probably between 1.25 and 2)
  • S = in-house supervision-multiplier (probably between 0.2 and 0.5)

Then the total amount of in-house resource you will spend is: O = (R * S) / (1 – S).
And the total amount of contract resource needed is: C = (R * M) / (1 – S).

These are obviously fairly idealised formulas, but by playing around with the values of M and S around where you think they should be will give a pretty good sense of what the range of possible real-world outcomes might look like.

And if you have some amount of employee resource available, you’ll probably always want to use that first and subtract it from R before doing anything else.

Link Triage – Serious Links

This is a few buckets mashed together for convenience.

Programming

Software Design

(Web) Design

Writing

Other Work-related