The Hitchhiker's Guide to the Galaxy of Lost Time
The Hitchhiker's Guide to the Galaxy of Lost Time
He couldn’t just hide a dead man and hope he evaporated. But what other option did he have? The database was literally dying minute by minute. And he didn’t know why.
Join the DZone community and get the full member experience.Join For Free
New whitepaper: Database DevOps – 6 Tips for Achieving Continuous Delivery. Discover 6 tips for continuous delivery with Database DevOps in this new whitepaper from Redgate. In 9 pages, it covers version control for databases and configurations, branching and testing, automation, using NuGet packages, and advice for how to start a pioneering Database DevOps project. Also includes further research on the industry-wide state of Database DevOps, how application and database development compare, plus practical steps for bringing DevOps to your database. Read it now free.
For century upon century, scientists, academics, and plain argumentative sods have been debating, shouting, and occasionally bashing each other over the heads about one of the biggest questions the galaxy faces. Which came first: the sloth or the Silmarillions? You’ve probably pondered the very same question, and it’s one of the many monumental intergalactic puzzles this tale will attempt to solve. So sit back, stop bashing heads, and relax with a coffee and a comforting digestive biscuit. The answers start here, in a salute to Douglas Adams.
Dan Thurret was not having a good day. His database — actually, not his database, but the one he was paid to mollycoddle, nurse along, and dust now and again — was running poorly. His boss was angry. His cat was coughing up furballs of an extraordinary size. And there was a dead man sitting in his chair.
He knew the man was dead because… well, because he was dead. No pulse. An off-grey pallor to his face. No movement. Cold, clammy skin. Dead.
Right now, though, he couldn’t call the police, his mother, a friend, or even a passerby because his boss was on the phone. His angry boss. Even angrier than usual because it was six thirty in the morning and he didn’t like being angry this early in the day.
“The latency on the database is causing us big problems — problems so big, your tiny, tiny mind can’t even comprehend the size of them,” he was saying. “Call yourself a Database Administrator? What kind of DBA lets a database get into this kind of mess?”
“I was going to —”
“What? Scratch the side of your nose and give me excuses about partition sizes, traffic shaping, and performance tuning again? And where on earth have you been? I’ve been calling you since six o’clock.”
“I was at home, sleeping.”
“Sleeping!” Dan could actually feel his ear drum try to escape from his ear and find a quieter, more relaxing home. “Why are you sleeping when we’re losing customers so fast we can’t even keep count as they run out of the door?”
“I did work until midnight,” he said plaintively.
“What were you doing? Updating your CV? Fix the damn database!” The receiver was slammed down so hard, Dan jumped in fear.
He slumped into his chair and leaped up again. Sitting on the knees of a dead man wasn’t what he needed right now. In fact, a dead man wasn’t what he needed at all. His boss would probably blame him for that, as well.
He looked around in desperation. The desk drawer? Too small. The cupboard by the door? Too obvious. A cardboard box in the corner? Better, but he needed to find a box big enough. Hiding a dead man was harder than it first appeared.
He stopped in his tracks. What was he thinking? He couldn’t just hide a dead man and hope he evaporated. But what other option did he have? Galaxy Life Insurance was literally dying minute by minute. The database was running so slowly that customers were waiting to complete forms online, staff was waiting for reports to run, normal daily tasks were becoming weekly tasks. And he didn’t know why.
His office door crashed open and he looked up quickly. Was it his angry boss, ready to kick him ceremoniously out of the window? Luckily he was on the second floor. He wouldn’t be damaged too much and being out of here — away from the damn database and the puzzling dead man — would be a relief.
“Time We Had a Chat.”
“Good morning, Dan,” said a tall thin man in an overcoat, a fedora, and a remarkably long scarf. He was carrying two paper cups in one hand and a shopping bag in the other. “Sorry about the door — hands full. Coffee?”
Dan took one of the cups. “Er, thanks. Why are you here?”
“It’s time we had a chat. Hope you like sugar. There’s six in there, and in mine. We might need it soon.”
“What for?” Dan said, taking a sip of coffee. It was sweet; very sweet.
“Oh, you know, just in case. I see you’ve met Desmond.”
He moved away from the dead man. “Desmond? That was his name? Poor chap.”
“I got tired of waiting for you, so I went off hunting for coffee and supplies. Desmond said he’d wait here and sort out the problems with the database.”
“Are all of your sentences so short and non-descriptive? If your coding’s the same, it’s no surprise your database is in such a mess.”
Dan was getting irritated now. This damn stranger had left a dead body in his office, put too much sugar in his coffee, and was now ridiculing his SQL abilities. “Who the hell are you?” he said as coldly as he could.
“Ah — apologies. Should have introduced myself.” The stranger thrust a hand out. “Punch Card.”
He looked at him, puzzled. “What?”
“Punch Card,” the stranger said slowly, as if to a child. “That’s my name.”
Dan laughed. “Your first name is Punch? And your second name is Card?”
The stranger’s smile faded. “I thought it was quite apt, coming here. It has a ring of technological innovation about it.”
Dan laughed even louder. “If we were in 1932 it might. What are you going to call your children? Commodore 64 and Sinclair ZX Spectrum?”
Punch Card stood there, unsmiling. “I might be a few decades out, but it’s the thought that counts. I was trying to fit in.”
“Fit in? Where are you from?”
He waved the answer away. “Later — how long have you been having problems with your database?”
Dan thought for a moment. “Three or four months. It’s getting slower and slower. I’ve been trying to get to the bottom of it.”
“How many customers do you have?”
“Around five million.”
“And how often do they access the database?”
“All the time. They apply for insurance online, get quotes, make payments, all kinds of things.”
Punch looked at the floor and spoke, almost to himself. “So, that’s why they’re here.”
“What? What are you talking about? And forget all of that anyway. This is my problem, not yours. Yours is to get rid of your friend, Desmond. Now.”
“Get rid of him? Why in a Panavanian, sun-filled, double lunar month of Sundays would I do that?”
“Because he’s dead.”
Punch burst out laughing. “He’s not turned himself off, has he? He promised me he wouldn’t do it again. Last time, a Jopital garbage collector on the third moon of Ooolah nearly ate him. He was lucky he wasn’t turned into gaudy festival decorations.” Walking around the desk, he calmly slapped Desmond in the face. When nothing happened, he did it harder.
Eyes wide, Dan could only look on in surprised shock. It was early in the morning and a stranger was in his office slapping a dead man across the face. Life really couldn’t get any odder than this.
And then it did.
“Stop Wasting Time.”
Desmond’s eyes suddenly snapped open and a red light shone out from his pupils. A whirring sound started and his head turned in a circle three times very fast. It stopped, the light faded and Desmond looked at Punch Card with sad, sad eyes. “Oh, the grieving mother of the sorry, heir to the planet of lost souls, I’m still alive. How depressing.”
“Hey, Desmond,” Punch said brightly. “Good to see you again, old buddy.”
“Buddy? Who needs a buddy when databases all over the galaxy are run by people who should be on the planet of lost souls?”
Dan drank his coffee very quickly, needing the sugar and the caffeine to help his brain process what was going on. “Um, what just happened? Could someone please explain?”
“I restarted Desmond, that’s all. The engineer who designed him thought it was amusing for the restart button to be in his cheekbone.”
“And the red lights? And the head spinning like a top?”
“Environmental scan, so Desmond can be sure it’s safe to restart. Wouldn’t want him waking up in the middle of a hot lava ocean, would we?”
“So, Desmond is …”
“A humanoid. It’s a good likeness, isn’t it? The skin’s a bit gray for my taste, but Desmond likes it. He says it expresses the way he feels.”
“Grey and dull and forever depressed,” Desmond said in a gray and dull and forever depressed voice.
Dan put his empty cup down and moved away from the two strangers, one human, one not so human. “This has been an entertaining start to my day, but could you please leave now? I’ve got a lot to do and very little time to do it. My boss will be in soon and I’ve got to find the answers to the problems with the database before he gets here or I’m dead meat.”
“The answer’s obvious,” said Desmond. “Which is why it’s so depressing to be alive.”
Half annoyed, half hopeful, Dan stepped forward. “So what is it?”
“The meaning of life? I wish I knew. A friend once told me it was 42, but he was even more depressed than me. If that’s non-humanly possible.”
“No — the problem with the database.”
“Oh, that’s because you don’t do database lifecycle management.”
Desmond turned to Punch. “You see? I wish I’d never been engineered so perfectly that I can’t even get annoyed. I’m going to sleep. Wake me up if there’s the smallest chance that I’ll be crushed out of existence by the Sleeping Titan of Titan.”
Punch sighed. “Sorry, Dan, he can be very trying. You don’t have to do all of the database lifecycle management. Just bits of it can help.”
“Bits of what?”
“Version controlling your database code, using Continuous Integration in your development environment, employing a release management tool to automate releases. Any one of those would have reduced the problems you’ve got.”
“But I’ve looked at this stuff before and it means I have to change the way we work. Why should I change the way we work just to keep a damn robot from killing himself?”
“You don’t have to change the way you work. If you get in tools that work with the systems you’ve already got, you’ll enhance the way you work.”
“Oh, I get it,” Dan said, a bulb the size of the moon lighting up inside his head. “You’re a salesman, probably from those folks at Redgate. I hear they’ve got lots of clever database tools. Why don’t you just call me or email me? I’m busy.”
“I’m not from Redgate. I’m from the Hitchhiker’s Guide to Database Lifecycle Management — DLM for short. The ultimate guide to managing databases. Every DBA in the galaxy reads it.”
“A magazine, then, probably online. No, I don’t want a subscription.”
Punch Card moved closer to Dan, grabbed his shirt and pulled him close. He spoke through gritted teeth. “Stop wasting time. I’m not selling anything. Your database is causing problems throughout the galaxy. I’m here to fix it.”
“I’m glad to hear it,” Dan said, also with gritted teeth. “So fix it and leave. Close the door behind you.”
“Don’t you want to know why it’s causing problems, you hopeless excuse for a DBA?”
“Yes, please, you hopeless excuse for a Redgate salesman.”
“I’m not a Redgate salesman.”
“And I’m not a hopeless excuse for a DBA.”
Punch let go of Dan and pushed him away. He sighed. “You’re not going to like this, but Galaxy Life, the company you work for, is responsible for threatening all of life across the galaxy. Quite apt, don’t you think?”
“No Time to Lose.”
“Four months ago,” Punch continued, “time started to leak out of this galaxy. Three months ago, the leak got worse. Last month, the Time Lords traced the leak to this solar system, this planet, this country, this city, this company and this database. I popped over to get a scoop for the Hitchhiker’s Guide to DLM.”
“Time Lords? Are you mad?”
“No, but they are. The time is being stolen and sold to the Galaxy of Lost Time by a race of time-thieves called the Silmarillions. This is the first time they’ve come to our galaxy to steal time and if it succeeds, they’ll do it again and again and again. The Galaxy of Lost Time could even be reborn, and no one in any galaxy wants that. Their time was taken from them because they’re the evilest galaxy there ever was and ever will be. Is that enough for you?”
Dan stared at him, open-mouthed. “That’s the biggest bunch of hogwash I’ve ever heard of. You sound like a particularly bad Star Wars movie, and I have to tell you that’s pretty hard to be because every Star Wars movie is shockingly bad. The fourth movie in what was originally a trilogy ended up being the first, believe it or not.”
“Don’t you understand what happens when a database doesn’t run properly?”
Dan squared up to him. “Enlighten me.”
“Time is lost. Customers have to wait to fill in online forms, payments are slower, staff is ineffective. Then there’s the added time lost because people talk about it, worry about it, complain about it when they could be living their lives usefully.”
“Are you more brain-dead than a boil on the backside of the not very bright Boonslacker Beast of Bozzle? Where do you think that lost time goes?”
“Goes? It doesn’t go anywhere. It’s just gone.”
“No, it’s sucked up by the Silmarillions. If time is wasted, they can steal it and the balance of the universe isn’t affected. No one notices, no one cares, no one even thinks it’s a problem. Every second of time lost in an inefficient database is a second that can be stolen and sold on by the Silmarillions.”
“So what do you want me to do about it?”
“Let us fix the database, solve the problem, get out of your hair. Now. There’s no time to lose. We have to stop the Silmarillions stealing time.”
Dan thought about it for a second — less than a second, perhaps a millionth of a second. Where was the downside? The database could be fixed and the madman and his strange robotic friend would be gone from his life. “It’s a deal.”
Punch smiled and shook Desmond’s shoulder. “Come on, old buddy, do this and we’ll take a holiday. No databases, no lost souls to depress you, just dancing girls, hot engine oil and a straw, and the triple moons of Kylos.”
Desmond opened his eyes, sighed deeply, and then closed them again.
Which was probably the moment that sealed the fate of Earth itself.
“Time’s Nearly Up.”
“So he’s not going to fix the database,” Dan said, feeling almost as depressed as Desmond now that the one slim hope that had emerged had disappeared in a pall of gloom.
Punch grinned. “If I’m not mistaken, he already has.” Grabbing the keyboard on the desk, he opened up SQL Server Management Studio. “Ha ha, that’s Desmond’s coding, alright. It’s so damn perfect; it’s beautiful.”
“What?” Pushing Punch aside, Dan opened file after file. And there it was. Beautiful code everywhere. In, literally, the blink of an eye, Desmond had refactored everything, rebuilt the database, and made it lean, mean and fast. “How did he do it?” he whispered in amazement.
“Desmond may be the most depressed DBA in the galaxy, but he’s also the most intelligent. He has a brain the size of two planets.”
“But he didn’t even touch the keyboard.”
“That’s his party piece. If he could be proud, he would be proudest of his ability to connect wirelessly to any database in the galaxy, however complicated.”
“Or however Stone Age,” Desmond said, opening his eyes again. “Can we please go to Kylos now? That was so ridiculously easy, I feel utterly ashamed of myself.”
“What was slowing it down?” Dan said urgently.
“Apart from the horrible table indexes, the technical debt in the code, and the astonishing amount of bad data, someone — presumably the Silmarillions because you wouldn’t be clever enough — sneaked in some code to slow down every I/O process by a factor of ten. Can we please leave now? The triple moons of Kylos beckon me.”
Punch nodded. “Just let me check one thing and we’ll be out of here faster than the crows in Roswell when BartySlartBetter crash-landed because he was watching re-runs of Lost in Space.”
“So there was a crash at Roswell?” Dan said in wonder.
Punch didn’t reply. Instead, he was staring intently at his watch. “Damn,” he said quietly, almost regretfully. “Oh, sweet Gertrude, damn, damn, damn.”
“But the database is fixed. Desmond fixed the database, so everything is fine,” Dan said.
“Oh, the database was bad. But this is badder than bad. So badder that bad won’t even exist in this solar system in a few minutes.”
“What do you mean?”
Punch thrust out his wrist and showed Dan his watch. It looked like one of those digital watches from the 1970s, with a dark black screen and red numerals. “That’s how many years of time are being stolen from this planet.”
“So 1914 isn’t because you set the date wrong? Oh, it just changed to 1963.”
“That’s the point. The Silmarillions are still stealing time. More time than ever.”
“But you fixed the database,” Dan said, pointing at the monitor screen.
“And I think they got a tiny bit annoyed. They were onto a good thing, stealing little bits of time from your database. They didn’t think anyone would notice. Now it’s fixed, they’re stealing it from everywhere. They must have promised the Lounge Lizards in the Galaxy of Lost Time a lot more time than they’ve already stolen. And you don’t make the Lounge Lizards in the Galaxy of Lost Time a promise you can’t keep. Not if you want to avoid ending up on the planet of lost souls. Now they’re trying to make up the shortfall.”
“Where are they getting it from? They’ve not broken into the database again, have they?”
“No — far, far worse than that. They’re stealing time from everywhere.”
“Simple — human beings waste so much time, the Silmarillions can pretty much scoop it up by the monthful.”
“What do you mean, we waste time?” Dan said, offended. “We certainly do not.”
“Are you kidding me? You jog from one place to another — often back to the same place — when you could get a cab instead. Wasted time. You watch Jerry Springer. Wasted time. You swim in oceans when you have speedboats. Wasted time. You climb up mountains — and then climb down them again. Wasted time.”
“That’s called leisure time, not wasted time.”
“Call it what you like, it’s wasting time.”
“It’s semantics — and what does it matter anyway?”
“Boy, it matters,” Punch said. “Time is infinite if you look at it chronologically, but at any given moment, there’s only so much time to go around. If the Silmarillions take too much from this point in time, there won’t be enough left to reach the next point in time. Get it now?”
Dan nodded slowly. “Kind of. What happens then?”
“Kaboom! Time collapses. This part of the Galaxy becomes a wormhole.”
“What about Earth?”
“Gone. As if it never existed.”
“Oh crikey, what are you going to do about it?”
“Get out of here. Steal a ride on the Silmarillion’s star cruiser and get to Kylos. I promised Desmond.”
“But what about me? What about Earth? What about my cat? She’s spitting out hairballs the size of mice.”
“Hitch a ride with us if you like. Be nice to have some company other than a depressed DBA ≈— you will promise not to be depressed, won’t you? One depressed DBA is too much.”
“How can I not be depressed?” Dan said, staring at him. “Earth is about to end and you’re telling me I shouldn’t be depressed?”
“Of course not. You’re a DBA, aren’t you? What’s one of your most important jobs?”
Dan thought. And thought. And thought.
“You do it daily, probably, weekly at a minimum.”
Dan thought. And thought. And thought.
Desmond opened his eyes and sighed. “Oh, for the sake of the nine heavens of Mutter, you do backups.”
“And…” Dan said, puzzled.
Punch slapped him on the shoulder. “The galaxy gets backed up too. So we just need to find the backup of Earth and restore it.”
“Where on earth is the backup of Earth?”
“Haven’t got a clue, but I know who will. The biggest fixer in the galaxy. Humphrey Gobart.”
“I’m sure I’ve heard that name before. Who is he?”
“He’s got a place called Rick’s Cafe, but everyone else in the galaxy calls it something else.”
“The Restaurant at the End of the Pipeline, of course. Let’s go. Time’s nearly up.”
Published at DZone with permission of Matt Hilbert , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.