Posts
573
Comments
513
Trackbacks
1
Sunday, February 07, 2010
Blog Comments or “Saint jdn – fighting Those Who Cared”

I have to explain the new tag line.

In the meantime, don’t forget the first rule of the Blogosphere: opinions are like assholes.  Everyone that has one, is one.

Because of the weird phenomenon of people in Eastern Europe posting spam links that advertise porn or poker or whatever, I have moderation turned on for the site.  It’s annoying because almost no one reads this thing and almost no one comments on it (except maybe to say “DOH!  I did that too!”), but if I don’t have moderation turned on, once one test spam comment gets through, hundreds a day come in, and it’s just a pain in the ass to deal with.  Right now, the big thing appears to be selling term papers to college students who don’t want to actually do the work themselves.  One gets submitted every couple of days, which I then kill.

Anyway, other than spam, I’ve never deleted a comment for any other reason, and except for something that was just blatantly racist or something, I don’t know what I would delete.  Maybe completely off-topic comments about politics or something.

I have this general policy for a reason, and one that ties back to the ‘birth’ of this piece of crap blog.

Back when Scott Bellware was blogging on CodeBetter, he was going on in his general humble (</sarcasm>) way about something he said or did, and I submitted a generic snarky response commenting on how nice it must be to be superior to everyone else.  Which, of course, he deleted.  And then he wrote a post about it (I think it was titled ‘BlogCoward’).

Anyone who’s read this blog or, well, ever met me, knows that I can have somewhat of, uh…an aggressive personality.  (Translation: “I’m kind of a dick”….what do you mean, kind of?  “Fine.”).

Naturally then, I commented about it.  I don’t remember if he deleted the first one, but eventually, one stayed and general frivolity ensued.  “Who are you jdn?  Are you just a troll?”  Which eventually led to my “My name is John Nuechterlein, I got a Ph.D. at the age of 25, I’m a good cook, I play a mean guitar, and I’m a snazzy dresser” comment, and there we go. (i’m no where near being a snazzy dresser, the rest is fairly accurate….but I digress).

From all of that, I have what I might call the ‘pot meet kettle’ moderation policy.  It would be rather cheezy for me to just delete comments if I didn’t agree with what was being said, or if the comments were somewhat…’aggressive’.   This was what was so funny about Bellware’s old blog, he’d post really rude and obnoxious comments about everything and everyone, but if anyone posted the slightest thing critical of him, he’d get all offended and wussy.  I’d link to examples (especially that didn’t involve me) but he deleted all of his old posts when he split from CodeBetter.

If you are going to have a blog and allow comments and say provocative things, don’t be a loser and delete stuff without a reason.  That’s true blog cowardliness…or something like that (i guess my attitude also stems from being on USENET back in the day, as the things that people call trolling today ain’t nothing like then.  There’s nary an H. West amongst them.  Not even a Plain and Simple Cronan.  Moment of silence for Cronan, rest his soul with God………….thank you.  The world misses that guy, and doesn’t even know it.  but i digress).

So, the new tagline came from a comment that Rob Conery made on his blog to a comment I made before he deleted the whole exchange and banned me from the commenting system altogether.  Burning bridge?  What’s that?

true story digression: after I graduated from the University of Miami with a Ph.D. in Philosophy at the age of 25 (Hi Jeremy, Hi Rob!), I stayed around for a year or two before finally leaving the hellhole that is South Beach (City motto: It’s a great place to visit, but you wouldn’t want to live here), and so during that time I was still around the Department for meetings, colloquiums, parties, etc.  Anyway, for a few months I dated one of the graduate students in the program, and some of my former classmates and colleagues asked her what it was like to date this jdn guy.  When she told them that I was very sweet and kind, the unanimous reaction was pretty much that she couldn’t have possibly understood the question properly, or she was actually dating someone else.  I consider the time when she told me about this one of the highpoints of my life, if only because it was so funny…lol, sorry, I digress.

Rob’s been on a kick about getting rid of relational databases and using NoSQL type databases (which are entirely different topics, which he doesn’t get), and supplying a lot of useful code, all of which is good.  He seems to think that if he does something good in one area, it means he’s excused for harmful actions in other places.

The ultimate problem is that advocating getting rid of relational databases would make this industry worse on orders of magnitude.  He doesn’t like to hear that, so he deletes comments.

This has always been the problem with Alt.NET.  Really smart people advocating really stupid business practices, e.g. all of the good that could come from examining NoSQL possibilities drowned out by dumb ideas that you have to get rid of relational databases. 

Anyway, Rob was making some generally ignorant comments and so I posted the following:

"In the 24 years that I’ve been doing this, I’ve changed a column name on a DB precisely twice"

So, in other words, you don't have a lot of experience in this area.

Rob really didn’t like this, I guess.  What I said was accurate (if you’ve ever worked on a DB system with hundreds of tables worked on by dozens of people over 5+ years, changing column names is pretty common.  Not every day common.  But common.).

Oh, he didn’t like this at all.  Because he’s too lazy, err, because he uses Disqus to handle comments to his blog, I got the full response in the email that gets sent out.  It was a brilliant rant.  I wish he had had the guts to keep it online, but it included the following:

“You, my friend, are the smartest of them all. You see me for what I am - a sham. And when I spend 5 hours of my Saturday trying to concoct yet another Lame Blog Post to try and answer the Good People of the world (whom I've completely fooled) - you're there to call me out. You should be commended. No you should be Sainted. Saint JDN - savior of the Geeks. The guy who understood what no one else did and saved the masses from the tyranny of Those Who Cared.”

I love this.  I really do.  The sarcasm is awesome.  Rob has never been able to handle challenges to his positions, so he resorts to this sort of thing.   Brilliant.

He didn’t actually get around to banning me from his site until my follow up comment:

“Why do you insist on things like:

- copying the points made by Udi and Greg and others, but without attributing them at any point, as if you were an original source on any of this (which you aren't, you are simply repeating what they have said, for the most part).

- thinking that your criticisms about relational databases actually relate to them, since your critiques of them seem irrelevant to how they are actually used in the real world”

That did it for him.  As the ultimate Gloryhound, he likes to post stuff where he rips off material from other people and pretend that he was the source.  When I post about cqrs, I make it clear that I am building on the work of others.  Rob thinks it is okay to plagiarize.   Good for him.  Derik has been doing with Dimecasts what Rob is doing with Tekpub, except Derik doesn’t charge for it (Dimecast official motto: “learn something new in 10 minutes or less, average running time of episodes is 12 minutes”).  Good for him.  As I said to him in an email, Tekpub is as popular as it is because people like Ayende are part of it.  It’s not like anyone thinks his blog series is real world code.

As I mentioned to him in my response to his email, I have an open invitation to have a Skype session to go over all of this.  I’d be fine with recording it so that everyone could hear it and come to their own conclusions.  He’s too scared to do that.

From his last email to me, he seems to think that I hate him or that I have a lot of anger towards him.  He’s a blogger guy.  So was Bellware.  If I don’t hate Scott (who has actually blogged a bunch of good stuff in the last few days since abandoning Twitter), why would I hate anyone?  This is all just talking about code.  I think Rob is killing the message of the advantages of using NoSQL stuff with this silly and ignorant comments about relational databases.  Not surprisingly, he has a different opinion about.  Okay, so what?  We differ about that.  I’m willing to talk about it in any open forum he wants.  Like SB, he runs away from that.  No problem.

Summation

If you have a blog, and you allow comments, be a man about it and allow comments that disagree with you.  You aren’t as smart as the people who disagree with you, and the people who disagree with you aren’t as smart as you either.  I think that makes sense.  Besides deleting whatever comments I had on his blog, he’s deleted a bunch of other things as well (there’s some guy named Eric that really riles him up…anybody know who this guy is?), and left in all the stuff where people thank him for what a great guy he is.  Which is okay.  It’s his blog, he can do what he wants with it.

And remember the first rule about the Blogosphere: opinions are like assholes.  Everyone who has one, is one. 

Deal with it.

posted @ Sunday, February 07, 2010 9:28 PM | Feedback (5)
It’s OK to do Reporting off of a RDBMS

Well, that’s a little misleading.  It’s OK to do Reporting off of a RDBMS as long as you do it right, and you should consider other options before committing to it. 

note: I’m using “Reporting” here in the traditional sense, not in the cqrs sense where pretty much anything that doesn’t involve a command is called “Reporting.”  Also, since I mostly know SQL Server, that’s what I’m going to be discussing here.  Also, yes, I know I’m glossing over a hell of a lot of stuff here.

The ‘Problem’

Suppose you have your traditional transactional system (it could be an eCommerce store, trading system, whatever), designed and optimized to handle inserts into it.  Indexes are aimed at preventing locking, data files (especially the transaction log) are located in different places to minimize hot spots and maximize I/O (SAN technology is pretty amazing these days), code is written correctly so that minimal numbers of query plans are generated which are then maximally used, yada yada yada.

Then along comes Sally Business User who wants to write a report that gets back whatever data she’s all hot to get information on, and happens to construct the query in such a way that joins on ten tables, all of which get locked, and which unfortunately returns the Cartesian Product of whatever table you have with the most rows.  Needless to say, the DB locks up and becomes unavailable, requiring a reboot, much gnashing of teeth, yada yada yada.

Of course, if your users are idiots, bad things can happen

But, of course, this is a straw man presentation.  Anybody can come up with stupid scenarios that don’t really address the pros and cons of using an RDBMS for reporting (or using one at all).  Instead, let’s take a closer look at why reporting off of an RDBMS can be problematic and how these problems can be addressed.

Joins can be costly

As a general rule, relational theory says that normalization is good (though this can be taken to an extreme…I once worked on a system where it took something like 8 joins to get a person’s cell phone number, but I digress).  This tends to lead to a proliferation of tables.  This means that when you want to read back related data, you have to join between a larger number of tables than in a denormalized system, and this can be a bad thing for a number of reasons.

A surprisingly large number of developers don’t really understand as much about transaction isolation levels as they really should, and so often times don’t even know how to write their queries with “(nolock)” properly implemented, which can lead to quite a lot of table locking.

The overhead of join conditions themselves (which, BTW, can also use “(nolock)”) isn’t that much (assuming you have proper indexes), additional conditions in the where clause increase, and can lead to very inefficient and costly execution plans if there aren’t proper indexes, they are in the wrong order, or aren’t sargable in the first place.

Aggregation can be costly

One of the greatest managers I ever worked with didn’t really like relational theory or SQL (which was somewhat ironic since data services was his department), and would at times dismissively wave his hand and say “blah blah blah, group by, order by, whatever.”  He knew it was important but didn’t really care much about the details (that’s what I was being paid for).

Well, all that ‘group by, order by, whatever’ can also greatly impact your execution plans for obvious reasons.  Simply selecting a group of rows is much different from selecting a group of rows while also finding your sums, maxes, mins that typically show up in a report.

Functions in where clauses are bad

Taking a piece of code and putting it in an UDF seems like a good idea.  The problem is that putting functions in where clauses makes the where clause non-sargable in most cases.  Even worse, if the function is doing any sort of complicated logic itself, it gets called for *every* row in the result set, not just once.

All this is getting in the way of the business anyway

Back in the dot.com heyday when working on eCommerce systems, the general principle was that our DB should ideally only be used when a customer was trying to give us their credit card number.  Obviously, this was an impossible ideal, but it was still a guiding principle (just as “eliminating crime” is an impossible ideal, but still a guiding principle). 

Well, obviously, reporting goes completely against that principle, which means that your scalability is limited by the amount of resources that are used for it, and as we’ve seen, that amount can be disproportionate to what you really want to be doing.

So, what to do?

Stop using an RDBMS for anything

One tactic to take is to “stop the madness” and not use an RDBMS at all.  Learning set theory, query optimization, etc. seems to require a lot of work, and can be never-ending.  An index that is good today might be bad tomorrow.  Statistics get out-dated.  And Joe the Developer is going to forget some table hint and lock the order table anyway.

And the experience of the Internet has shown that there seem to be hard limits in just how much data can be stored/processed/managed in an RDBMS.  That’s why Google and Amazon (the obvious examples) don’t center their businesses around them (the white papers on their internal architectures are fascinating to read). 

However, throwing the baby out with the bathwater isn’t generally a good option.  Most of us aren’t going to be building systems that scale to the size of Google or Amazon.  It’s good to dream, but deciding on how to architect a system should be based on realistic expectations as to the needs of the business it is supporting, and for almost all businesses (except maybe at the highest of high-ends and lowest of low-ends), an RDBMS hits the sweet spot.

Moreover, while you certainly don’t have to be a Google or an Amazon to use something other than an RDBMS, making that choice requires learning different ways of doing things, with less supporting literature.  SQL has been around for a long time and in many different environments.  While ‘NoSQL’ style databases have been around for ages, there simply isn’t the high level of ‘Google it’ knowledge that you can rely on to solve any particular practical issue you might be facing.  If you don’t know much about SQL, but know that your system is experiencing blocking, you can pretty quickly learn how to identify the causes of it and devise a solution.

Don’t use an RDBMS for reporting, that’s why God invented OLAP

If you want to limit the resources that are hitting your database for non-‘credit card submission’ purposes, then obviously, you should move those ‘non-critical’ resources somewhere else, and an obvious solution is another database.  In fact, if you really want to do it ‘correctly’, put in place an OLAP system.  Take your highly normalized transactions and ship them off to another system that denormalizes it, aggregates it, precisely for data mining and reporting purposes.  The output of such a system will be familiar to anyone who, for instance, uses the Pivot function in Excel.  That’s right, your business users, the ones who want the reports in the first place.

With SQL Server, it comes with the product (well, not the Express version, I guess) as Analysis Services, so if you can already afford the cost of the license, you get it with no additional cost.  So, since it was designed precisely to do the reporting that needs to be done, and it comes with the product, why wouldn’t you use it?  You do have to afford additional hardware (you could use it on the same instance, but that kind of defeats the purpose), but that’s going to be true just about no matter what.  Seems like the obvious answer.

The problem is cost.  Not cost of the product, but opportunity cost.  Learning OLAP concepts and technologies appears to be something like an order of magnitude more difficult than learning OLTP concepts.  Normalization is easier to understand than star schema.  T-SQL is an easier language to work with than MDX.  Because of this, it is harder to find people to staff a business if it uses it.  Significantly harder.

Is this a definitive argument against OLAP?  Of course not.  In fact, if you are the sort of person who likes data, and who would like a fairly secure, fairly well-paid profession so that they could support and raise a family (in other words, the truly important stuff in life other than this geek crap), I would encourage you to learn this stuff.  Action pack subscriptions or MSDN subscriptions aren’t free, but they can give you licenses of SQL Server versions that include SSAS.

But, the main reason why OLAP hasn’t taken off as much as one might think (though I guess that is changing over time) is that there is another, cheaper option.

God also invented Replication

Part of every version of SQL Server (though with some limitations), replication allows you essentially to take your database and copy its data, in near real-time and in as close to the form as it exists in as you want, to another database, more or less automatically.

You still need the additional hardware (since replicating to the same server kind of defeats the purpose), but you can keep your better understood schema, write your reports in T-SQL, and offload almost all of those resources from your main database.  There is a slight overhead in setting up and running replication but it isn’t much, and improves with each version (so, with SQL 7, setting up replication caused table locks, so you had to do it at 3AM, where in 2000, it only caused row locks, etc. etc. etc.).  If a bad query hits your replica and locks it up, then it won’t affect the main DB (as long as was setup that way). 

Is it perfect?  Nope.  You still have to do things right, you still are querying against a highly normalized database (leading to the common “why is my report timing out” problem), there is overhead involved both in terms of actual CPU as well as human overhead in terms of additional monitoring and support, etc. etc. etc.

But many businesses find that it is a perfectly acceptable solution in many situations.

Relational Databases aren’t going anywhere, neither is reporting off of them

It really is okay to do reporting off an RDBMS.  Despite what people think, they are going to be around for a long, long time, and that’s okay too.  Will non-relational databases grow in the market?  That’s hard to predict, but because of the experience of running systems on the Web, I think it will.  And that’s okay too.  The idea that there’s only one way to architect a system is generally nutty anyway.

posted @ Sunday, February 07, 2010 4:20 PM | Feedback (0)
Saturday, February 06, 2010
Melissa McClelland – Brake (live)

A snippet of this song was played on Hockey Night in Canada, related to the death of Maple Leafs’ GM Brian Burke’s son.

Obviously, I don’t know Mr. Burke at all, but condolences and prayers to him and his family.  I’ve never understood how people recover from the death of a child.  It’s something I wish on no one.

Anyway, here’s a beautiful rendition of a beautiful (albeit depressing) song.  Resolution kind of sucks, but there you go.

posted @ Saturday, February 06, 2010 10:17 PM | Feedback (0)
Thursday, February 04, 2010
How Toyota Does Software

Oops.

"The company changed braking system software in January as part of what it called 'constant quality improvements,' but did not say what it would do about vehicles manufactured before then."

I'm waiting for the first post from someone about how the problem is that Toyota didn't follow the Toyota Production System.

posted @ Thursday, February 04, 2010 10:58 AM | Feedback (2)
Friday, January 29, 2010
Toyota Production System in Action

Oops.

There are people who have tied their practices in Lean Software to Toyota and how they do things.  Some have seem to have set their sights on being a ‘Chief Engineer’ for reasons of ego.

It was always dumb to do this, and this simply proves it.

“We need to start today to build the learning organizations and learning cultures that will produce the Chief Engineers that our industry needs.”

Uh, no.

posted @ Friday, January 29, 2010 11:34 PM | Feedback (0)
Thursday, January 21, 2010
Why don’t TV Sports Announcers Watch Their Own Broadcasts?

Okay, I understand why they wouldn’t actually watch TV while broadcasting the game, but it’s starting to get ridiculous.

I’ll focus on hockey and football, because that is what I watch mostly.

Watching tonight the big Ovechkin/Crosby rematch…err, the Caps/Pens first game since their epic (Jim Rome shout-out for a member of the crowd) playoff battle, and Crosby scores on one of those weird goals where the goalie wanders out to play a puck and it takes an odd bounce to sit in front of the net for the opposing team to knock in.  This one was doubly-weird because a) the Pens usually have goals scored against them like this because of Fleury’s tendency to act like he’s going to get a sandwich when playing the puck and b) Fedotenko missed the open net and it took an extra second or two for Crosby to poke it in.

This is all clearly viewable, but the announcer (PS, up in the booth) and the color commentator (BE, between the benches) both miss this fact, and debate whether the goal will go to Fedotenko or Malkin (who dumped it in) (and yes, I’m too lazy to type out the names of the announcers…I’ve been up since 5 AM).  They even remark on the fact that the ref took a while to point to the goal.  “He must have lost sight of it” says PS.  Uh, no, ref-y don’t point-y to net-y until puck-y cross line-y.

Multiple replays are going on at this point (I mean, not all at once) which shows clearly that the puck didn’t go over the line until Crosby scores, but they keep missing it.  The arena announcer comes on the PA and *announces* the goal to Crosby and they are still debating if Fedotenko got it.  Finally, BE sees the 5th (or whatever) replay, and notices that the reason why the ref took so long to indicate the goal is because it wasn’t scored until Crosby, well, scored the goal.  Brilliant.

Later on, Caps go up 2-1 when Fehr shoots towards the net and Orpik ends up chipping it into his own goal.  Although the highlight reel goals are the ones that make it onto SportsCenter (official motto: “We haven’t started sucking since 1989”) because, well, they are highlight reel goals, the deflection goal, either off of your teammate or the opposition, is pretty typical.  Once again, the announcers miss this for half a minute until BE finally sees the 19th (or whatever) replay and sees that it goes off of Orpik.

And this is one game.

Now, I understand why you wouldn’t want the announcers to just sit there and watch an HDTV broadcast of the game and announce off of that.  At least while the game was going on.  For hockey, you couldn’t fit a set between the benches anyway, and even with HDTV, you can’t see the entire ice and things going on behind the play, off wing, etc.  Fine.

But the broadcast company could and should have some guy sitting in front of a large HDTV, and talk with the producer to clear up screw-ups like this.

digression: unless you can’t afford it or don’t have HD sources in your area, if you are a sports fan, you *have* to get HDTV.  I mean, not in a moral sense, but you have no idea what you are missing.  I got HD a few years ago during the NBA playoffs and there was something…mesmerizing about Charles Barkley’s bald-ass head during the studio show, especially since TNT’s HD broadcasts are among the best, along with CBS’ SEC football broadcasts.  You really can tell the difference between HD quality.

Football broadcasts, for various reasons, are even worse.

For one thing, a large group of Football announcers are, well, getting up there in age.  They seem to have trouble recognizing basic things like, oh, noticing if a play resulted in an actual touchdown or not.  Or which players were involved in a play.

Also, with all of the on-screen eye candy, like the generated first-down line, there are way too many cases of the announcer saying something like “And that will be a 3rd and two” even if the play ends up a yard past the line.  Yes, we know the generated first-down line is not official, but can you have someone in the booth watching this? 

And there are *way* too many cases when the Umpire is indicating a penalty or something, and the announcers seem oblivious to it, to the point where the broadcast team simply fails to indicate what is happening on the field, even when it is clearly visible to any viewer.

Any and all of these things should be fixable.  It’s rare now that an incident doesn’t happen every weekend.

posted @ Thursday, January 21, 2010 8:53 PM | Feedback (1)
Wednesday, January 20, 2010
MapReduce Patented

http://arstechnica.com/open-source/news/2010/01/googles-mapreduce-patent-what-does-it-mean-for-hadoop.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss

Though it isn’t quite the same thing, I’m thinking of trying to patent Cut and Paste, just to see if it gets awarded.

posted @ Wednesday, January 20, 2010 11:49 AM | Feedback (0)
Thursday, January 14, 2010
The EchoChamber Software Craftsman Cooperative

A bunch of guys at ElegantCode have announced what they are calling the The Software Craftsman Cooperative.

At a very high level, it is hard to see what could possibly be wrong with this:

“All members are dedicated to working collaboratively with clients, which means alternative ways of doing business.

The Software Craftsman Cooperative members maintain the following values:

  • Working together produces better results than working alone
  • Transparent and collaborative client relationships are healthier than fixed bid contracts
  • Delivering business value does not always mean delivering lines of code
  • Deliberate action is preferred to reactive heroics
  • Well crafted software produces more value than utilitarian execution “

I mean, you can’t really argue against working together.  Well, you could, but it would be silly.

I met Jarod and Jason at the Alt.Net Conference in Seattle in 2008 and, along with Sergio, to my recollection, we had a good time, very productive.  So, the fact that they are involved in this initiative is good.

But then you get to this:

“Some things about SCC membership:

  • Membership is by invitation only
  • Membership is subject to a vote of the standing members”

Gosh, I can’t see how this couldn’t degrade into any sort of highly political and/or personal issues.  Really, it will all be just a happy family, since everyone agrees on what ‘Software Craftsmanship’ means.

And the ultimate goal, really, seems to be this:

“The goal of the Cooperative is for all Members to contribute to each other’s mutual success in the delivery of excellent software, specifically:

  1. Provide the ability to secure larger contracts (most of the the members will be individuals or small companies).
  2. Provide access to experts in a particular field, either on a paid contractual basis (see #3 below) or simply for advice.
  3. Shared marketing, specifically:
    1. Help to alleviate the "feast or famine" problem that is inherent in the consulting business by providing access to a larger pool of opportunities.
    2. Members can refer opportunities (either in totality or specific pieces thereof) to each other.
    3. Potentially a brand for the Cooperative could be created and marketed.
    4. An online community used to share knowledge of business opportunities between the Cooperative members.”

Unlike some people, I'm not against making money.  But combine an invitation-only group designed to financially better members of said group…can’t imagine what could go wrong there.

I mean, for example, if someone who wanted to join the group believed the following:

- unless you are developing a framework (as opposed to an application, however you want to discriminate between the two), TDD is a harmful software practice.  You should be testing scenarios, not methods, and doing otherwise, causes harm.  If you aren’t doing BDD, you suck.

I’m guessing you wouldn’t get voted in.  Even though that belief is, arguably, correct and true.

Instead, you’ll get the Least Common Denominator beliefs of what makes someone a ‘Software Craftsman’.  And combine that with a motive to make money….not a chance that will be a problem.  Nope.

All that said, I guess it’s better than having a Big Ball of Mud Cooperative.  Maybe.

Curious if when people apply for this thing, will the vote be public on applications?  Hmm…..

But, I’m sure it will all work out without controversy about who voted for or against whom.

    posted @ Thursday, January 14, 2010 9:16 PM | Feedback (0)
    CQRS Presentation, Chicago Alt.NET, 1/13/2010 Recap

    I’ll update this post with the link to the screenshot and the slide deck when Sergio posts it.

    Update: here they are.

    On a scale of 1 to 10, without thinking too much about it, I would give myself a 4 or a 5 on this one, and for a couple of (somewhat related) reasons:

    • - a fundamental flaw of the presentation is that I was trying to give a high-level summary overview of the things that Udi and Greg and Mark are talking about, without having the benefit of the width and breadth of their knowledge and experience of actually implementing it in multiple situations (as I mention in the talk, I do hope to have a system in production this year that implements a fairly robust version of cqrs, but even if I’m successful, that’s still quite a bit short of having done it for years in highly scaled environments).
    • mild digression:  Bellware, in a post to the alt.net mailing list a while ago, made a point about something he called “Talking with a Full Mouth” which, to crudely paraphrase it, was that you shouldn’t try to ‘educate’ people about software practices unless you’ve practiced them for years, and in fact, should really just STFU about it.  As someone who was paid to educate people about philosophy and logic in a previous career, there is something to this.  There were times when I might sit in on other people’s classes, and there were times when it was painful because the educator didn’t have a firm grasp of the subject matter and I felt the class suffered from it.  I don’t feel too bad about the presentation in this regard because I was very clear about what I was doing, giving a high-level summary overview of what CQRS was about, but didn’t have all the answers, and pointed them to the authoritative sources.   When I was teaching students about, say, Utilitarianism, there’s no way that I could claim to be as intelligent as Mill, but that didn’t mean I couldn’t explain to beginning philosophy students the difference between Act and Rule Utilitarianism.
    • - I don’t have a firm grasp of the right way to do Event Sourcing, which I think is really how CQRS needs to be done.  There’s something about how the code I’ve seen that implements it that strikes me as….sub-optimal, for lack of a better term, but I can’t quite but a finger on why it strikes me that way.  As I mentioned in the talk, I’m pretty convinced that this is because I don’t quite get it deeply enough.  I explicitly made this point, and so, like dogs sensing fear, a number of the questions focused on this area.
    • - You can’t really explain any topic in-depth in an hour, much less CQRS.
    • - Half of the purpose of the presentation was, frankly, to have people react to how I presented it, and ask questions that I might not be able to answer, not only to guide how I continue my blog posts about it, but, more selfishly, guide me in terms of what I need to work on more deeply to increase the chance of success of my own implementation of it.  So, mission accomplished there. 

    Other than that, I thought it went well.

    Anyway, I think that one of the things that is much clearer from the talk is that the importance and attractiveness of CQRS is tied into a couple of crucial areas:

    • - having scalability built in: a couple of comments that people made to me during and/or after the talk was about how they wished they had something like CQRS in previous projects to handle scalability.  Short of violating laws of logic and/or physics (some laws of physics appear to violate laws of logic, which is why they are probably false, but not even I can digress that point here), nothing is impossible, but trying to retrofit CQRS into an existing software system/application appears to be, well, really really hard.  So, if you’ve paid a price in the past for not having scalability you didn’t know you needed, CQRS will seem, at least on the surface, more attractive.
    • - having an audit log built in: the conceptual idea of having an exact record of everything that has happened in your system over time is something that has incredible appeal.  Almost any system of significance runs into the problem of trying to figure out the answer to the question, “How did the application get to this state?”  Whether you are a developer or an operations manager, a hell of a lot of time can end up being spent trying to determine this.  Even a system that doesn’t technically have bugs can end up in a state that the end users didn’t expect.  When constructed properly, a CQRS-system at least offers the promise of being able to answer this question.  You can figure out how you got to the state you are in by examining the record of the events that got you there.  In theory, you can set up a UAT environment and replay those events, debug them closely, and see exactly how you got there.  In theory, if you construct the system properly, you can rollback those events that got you into the state you don’t want to one that you do want.  In theory, as you develop new code, you can replay events (and possibly even commands, more on this below) and see what the effects of the new code will be on events that have already occurred.  All of these things will appeal to people who have had to deal with this.
    • - Eventual Consistency: do you understand the concept and does it apply to your system?  Do you accept the notion that all data is stale?  At the highest-level, I think this can be seen as a deal breaker.  It’s one thing to accept the idea that, say, Amazon has no choice but to deal with this, yet another to think that your own system, which really will never need to scale to Amazon levels, has to deal with it. 

    My own list of questions that I wrote down after the presentation are around the following:

    • - if, as a Customer, I change my Address information, I expect to see that the information is updated when I press that Submit button.  But if my screen is populated from data from my eventually consistent data store which is gathered from my Query layer, how do I ensure this?  In an eCommerce situation, Order Submission is a question here.  I expect to see the Order ID (or whatever) on the Order Confirmation screen after I press that Submit button, especially since I’m often asked to print out the Order Confirmation screen.  When I was part of a team that handled sales for the eCommerce store for the NBA, we sold a hell of a lot of product in the seconds/minutes/hours after the Lakers clinched their 3rd title (I think that’s when it was).  Eventual consistency in terms of getting an Order Confirmation email is one thing.  As an end user, if it takes a minute or three to get that confirmation email, that’s expected.  But while placing the order, I expect that Order ID to be there ‘immediately.’  How do I ensure that this happens?  My Query Layer might query the Domain directly because my system issues an ReallyImportantOrderThatHasToBeReflectedImmediately query, but is this a well-thought out architecture or a hack?  In other words, what’s the well-thought out way of handling Eventual Consistency for those UI queries that just have to be consistent, especially in situations of high traffic?
    • - Commands issued from the UI become Internal Events that are saved to an Event Store that produces External Events that are published.  How exactly should this work?
    • - Should there also be a Command Store, as well as an Event Store?  I’ve not seen any discussion about this, but it seems like you might want to have this, if only so that you can replay commands against a future code base to see what the effects are.  You want the Event Store as your audit log, and because you want to replay them given the business rules of your Domain at the time they occurred, but why wouldn’t you also want to have the Commands themselves recorded so that you can replay them given new business rules?  Or can the Event Store inherently handle that?

    And I’m sure there are others.

    In any event (pun intended), I hope that my presentation at least got some people to be interested in CQRS, and thinking about if it might work for them.

    posted @ Thursday, January 14, 2010 8:43 PM | Feedback (0)
    Monday, January 11, 2010
    When jQuery scrolling sucks

    Rob Conery wrote a post about how traditional paging on web pages sucks.  And, generally speaking, he’s right.  As he puts it:

    “we know that people rarely go to pages 2- whatever and that when they do, they rarely come back to page 1. We have 3 seconds to capture a user’s attention on a new visit – that’s it. If you make them page they will leave, and it’s amazing how many applications still use this dated way of showing information.”

    Though he doesn’t specify it, he’s obviously talking about (among other things), Google.  An entire industry exists (called “SEO”, which means “Search Engine Optimization” or as I like to say, means “SEarch snake Oil”) to help you get your web site/page to appear on the first page of a Google search, since the amount of traffic/sales that you can get by being on the first page is, well, really ridiculous compared to what you get if you are on, say, page two.  Since I’m lazy, I won’t link to anything here, but, well, you can Google it and find pretty solid real-world studies about it.  It’s fascinating/depressing to think about if you are a business trying to get your business to appear on page one.

    Anyway, as a replacement, Rob talks about the ‘bottomless scrolling’ option, one that you can see on Twitter.  You go to a person’s Twitter page, and at the bottom, there is a “more” link that does some nifty AJAX type stuff, and the next series of Twitter entries appear.  And you keep clicking and get more entries.

    This is all fine.  Except it also sucks, and in some cases, sucks more than traditional paging.

    The first obvious point is that if the imagined end user isn’t going to go to Page 2, they aren’t going to want to click on the “More” link either.  There’s no end-user improvement to having the “More” link instead of having a “Page 2” link.

    More importantly, in some cases, there’s an end-user degradation to having the “More” link.

    Suppose someone sent me an email that said “Hey, Rob twitted about you, you should check it out.”  And though it isn’t critical to the point, suppose it was more than a week ago.

    Given the ‘bottomless scrolling’ option, I would have to keep hitting that “More” link over and over and over to get to the relevant point.  If I had a paging option, I could center into the appropriate date range by entering in, say, ?page=10, and seeing the date range there, then, say ?page=47, or whatever, and very quickly find what I was looking for. 

    So, when considering whether one should abandon paging, you should consider what the end user scenarios are.  If the end user scenario expects Page 1 to be the be all and end all of what they are looking for, then ‘bottomless scrolling’ might be the right thing to do (though you should also think about what if anything it actually gains you…I’m thinking nothing usually).  If the filter criteria of the search is something that an end user might be able to control, paging is still the right thing to do.

    posted @ Monday, January 11, 2010 10:22 PM | Feedback (2)