OLTP for Brain Surgeons and Rocket Scientists
Mr. OLTP writes ...
I love feedback, and we've had a fair bit that would suggest that the thrust of this site is slightly too technical. I've therefore decided to write a paper that aims to be even less technical than the executive summary. To this end the target audience is Brain Surgeons, Rocket Scientists and the rest of us that might not know what an RPC is. So this isn't a preachy essay; we'll imagine that I'm having an imaginary conversation with my friends in the Pub after a hard day OLTPing. They're curious as to what I do (and since Mr. OLTP is supposed to be an imaginary character too, aren't we all).
Send more Feedback on this page. I've been doing this OLTP stuff for some time and I'm surrounded by similar sad, sad, people, so I tend to take it for granted that folk know what I'm talking about. Please ask if anything needs clarification.
Some Computers are Better than Others
|Getting all Transactional after a few beers|
Mr. OLTP ponders for a while contemplating the table in front of them and then launches into it.
"It's like this. Some computers are better than others at doing special tasks; in fact they are designed to do these special tasks. For example a computer may be better at doing a large number of simultaneous calculations (Dr. Rocket Scientist may be familiar with Finite Element Analysis, but we won't worry about this too much)", he grinned at his friend and continued, "and other computers may be better at presenting pictures".
A swig of beer and he continued, "A further class of computers is good at storing facts and other computers are good at talking to users (and at being cheap)."
The Brain Surgeon mumbled something about the various bits of the brain being specialised to do various jobs too. Mr. OLTP felt he was on a roll and carried on.
"A very important kind of computer is the computer that gives or
takes money. Well I think I've made my point. Although computers, have
been rightly talked about as the `universal machine' they have become
specialised at various tasks. OLTP techniques can be applied to all
computing tasks, with varying degrees of relevance from the completely
pointless to the absolutely must have."
Computers Can Talk to Each Other
"And computers can talk to each other, like the various bits in the Brain." said the Brain Surgeon, in a burst of enthusiasm.
"Yes, exactly." said Mr. OLTP. He continued "they talk to each other and this is where OLTP comes in".
"Computers and Brains are an easy analogy," said the Rocket Scientist, gruffly, "I've not heard anything about Rocket Science yet."
Mr. OLTP ignored the interjection and continued. "Firstly we need to know why they would want to talk to each other"
That's easy", interjected the Rocket Scientist, "the ones that are good at somethings and bad at another can ask other computers to do the stuff they find tricky".
"Absolutely! This is where all this so called Client/Server computing comes in. A client can ask a server to do stuff for it. It might be to perform incredibly big calculation; it might be to get or store some facts; it might even be a request to display a picture".
The Rocket Scientist asked "I guess, for you job, getting and storing facts is the most important then?"
"Yes. If you asked most computer people what was client/server
computing they'd tell you that it was about small computers, like PCs
asking bigger ones for facts."
Keep All Your Facts Together
"Now as any clerk knows you need to keep your facts together"
"Oh oh, here comes the big Filing Cabinet metaphor ..." interjected the Rocket Scientist.
"Yes, I think we're all familiar with that. But it is important not to smear things around. To work out things from your facts it is necessary to access several different Filing Cabinets, as you would have it, simultaneously. You'd best keep these Filing Cabinets together or you'd spend inordinate amounts of time running about."
"Computers that store facts are much the same when it comes to their facts. A significant amount of time can be spent getting and sending facts over communication links if your facts aren't all together. This economic fact means that the specialised computers that store facts tend to be big to start with and get bigger with time. Some of the biggest computers in the world are dedicated to storing facts, even bigger than those that do stuff like Finite Element Analysis for Rocket Scientists."
"Hum I'd have to ask my computer folks about that" interjected the
Remember, Talk Is Not Cheap
"Now that all your facts are together its not that clever to send large amounts of them off to another computer to do some small calculation on them".
"Most of the calculations that are done in business aren't that clever".
"What! they're not Rocket Science?" asked the Brain Surgeon.
"No, usually get a load of facts based on some detail, then add all the numbers up or even just count them. Economics therefore dictate that these computer programs stay close to the facts in these big computers, although, it has to be said that several people have made a healthy living writing programs which do this kind of calculation on PCs, with the facts travelling to them from some central machine".
"That's Client/Server, isn't it?" somebody asked.
"Yes, in the classic sense. But, folks frequently find that these kind of systems rapidly run out of puff as they get bigger".
"They don't scale" noted the Brain Surgeon to the Rocket Scientist, dryly.
"Of course lots of folks are going to do much the same thing on the big computer as a result. It is therefore necessary to have some other program controlling all this activity, distributing work to these programs and making sure that they're all there and in touch with their Filing Cabinets."
"And that's what a Transaction Processing thing-a-magig does then?"
"Well, part of it", there was a pause as Mr. OLTP reflected for a moment, "infact, a very important part of it! A very great deal of the work I see in the OLTP world is ..."
"But that's not all ... No the other great feature of TPM,
Transaction Processing Monitors, is their ability to coordinate
Oops! Forget about That
There was a pause as more beer was purchased and consumed.
"One of the more important things that a Transaction Processing Monitor does is that it coordinates the update of, er, what we're calling Filing Cabinets. Hum, how am I going to explain this? The Filing Cabinet metaphor rather brakes down with this stuff."
"Let's say that there's one bunch of Filing Cabinets in say New York, and another in Cockermouth. There's a clerk sitting in front of each and they're in telephone contact. So they need to exchange data and update their records mutually. Lets say they're doing something like, I don't know, updating bank balances".
"Oh oh, here comes the big Bank Balance metaphor ..." interjected the Brain Surgeon.
"Well, not such a metaphor!", recalled Mr. OLTP, remembering the stuff he'd recently been engaged on.
He continued, "So they, these clerks, want to move money between those well know financial centres, New York and Cockermouth. They set about it with their quill pens. So when money from New York has to move to Cockermouth the clerk has to enter a debit in his ledger and the clerk in Cockermouth has to enter a credit in his. These things have to be coordinated, you don't want debits being added willy-nilly or you'd have your money disappearing into thin air.
"Importantly the debit and credit operations must be undo-able up to
a certain point. Should there be a break down in communications the
operation should not proceed and each clerk should have the ability to
shout `Forget about That' at any point. The ledgers should be both
updated or not at all.
"Lets put it another way. Say you, Brain Surgeon, would like to buy more beer."
"Is that a hint?" asked the Brain Surgeon.
"No just an example. However, you haven't enough money, so you'd like to ask the Rocket Scientist for a loan. You'd have to write an IOU, so that the Rocket Scientist would have a record of the loan. So you write your IOU. At the same time the Rocket Scientist gets some money out of his wallet. Now it might be that the Rocket Scientist doesn't have enough money, or you find a secret source of funds and no longer need his money. Either of you will want to be able to abort the exchange at any time. You'll want to be able to say `Forget about That' just like the clerks in the previous example. In computer terms the Transaction Processing Monitor takes care of this coordination ...
"Ah! so that's it, you sit in front of a computer and push buttons then. It's about computers and stuff!"
There was a pause. "Yes, it is" said Mr. OLTP wearily.