Tag: atomicity

  • 2020 year in review

    2020 year in review

    Survival

    First things first: I’m grateful for surviving this difficult, weird and straight-up dystopian year. 2020 was the absolute worst; although the year will permanently leave its mark in our memories, we’re all ready to leave it behind, ready to move on. Who could have, apart from maybe Bill Gates during during 2014 Ted Talk, predicted a global pandemic forcing all of humanity into stay-at-home lockdowns? To add fuel to the fire, forest fires broke out in the Pacific Northwest, smoke blanketing the sky, rendering the air unbreathable, tightening the lockdown’s grip and exacerbating the already untenable cabin fever.

    The lockdowns and the constant bombardment of never-up-lifting coronavirus news ate away my health: physically, emotionally, mentally. I miss playing tennis with friends; I miss striking up conversations with both friends and strangers — I miss pre-pandemic life. But above all else, I miss not fearing that the person breathing next to me will sneeze and spread the virus. That’s the thing with COVID-19: even when it’s not on your mind, it’s on your mind. It’s always just beneath the surface, swimming around in your subconscious. Is it normal to dream nightmares where you are sitting on a public bus and the only one wearing a masks?

    Notwithstanding the global pandemic, 2020 blessed me in many ways. Below, I’ll share some life updates — the good and the bad — that tend to revolve around two north stars (who says you can’t more than one north star): family; and personal development. Then, I’ll close the post out with what’s lined up for 2021.

    Looking Back

    Family

    On Parenting

    “(Parenting) is a young person’s game – Mom”

    After becoming a parent, I stopped snapping harsh judgements of other parents for their shortcomings. Because surprise surprise: parenting is HARD. These days, whenever I witness some toddler throwing a tantrum because their cup happens to be colored blue, my heart goes out to their parents. Parenting has taught me to hold more sympathy, more understanding, more patience, towards all parents, including my own. Because the old adage rings true: “We never know the love of a parent till we become parents ourselves”.

    Jess and Elliott smiling for the camera

    The way Jess raises Elliott motivates me to become a better father. Watching Jess mother is like watching Picasso show up every day and paint his canvas — it’s an honor. And really beautiful. Jess speaks so softly to Elliott, never losing her patience, her tone always somehow miraculously combined with light-hardheartedness, seriousness, curiosity, warmth, humanity, and above all else: love. Without skipping a beat, Jess will dive face first into a ball pit, crawl around on all fours, and proceed to chase Elliott. She’ll neatly decorate Elliott’s plate of food every day — every meal. She’ll fly up the stairs as soon as Elliott makes a peep in the middle of the night. All these moments … it’s all art unfolding in front of my very eyes. With Jess leading the way, I’m confident that Elliott will grow into a well adjusted human being.

    I’m still the same person

    Yes — I’m a dad now. My life looks radically different. But fundamentally I remain the same person (apart from the new salt and pepper hairstyle). Before fatherhood, I used to think that once I stepped into my new role, the very core of who I was would somehow shift, that all my previous dreams and desires and aspirations would somehow get tossed the window. Because you hear that sort of story all the time, right? From books, from friends, from everyone. Maybe the cessation of one’s desires does really happen for some parents: but not me. Don’t get me wrong, being a dad is one of the proudest titles I hold. There’s just still so much I want to accomplish in my life. And I’m lucky that I’m in good company; they get to join my journey and I get to join theirs.

    Unexpected moments of happiness

    Elliott breathes joy into my life and constantly puts a much needed smile on my face: every time she smiles; every time she lays a wet one on either Metric or Mushroom. Sometimes, she acts cute on purpose: she’ll slowly tilt her her head to the side and send you a smirk. She knows how to tug at my heart. But most of the times, she’s just doing nothing, just being herself, and I catch love feelings washing over me.

    Elliott kissing her “deer” (it’s a llama, but she loves deer…so its a deer)

    Fur daughters

    Before becoming a human father, I was first a fur father to Metric and Mushroom. I continue to appreciate them, for guarding Elliott at night, for licking up all of Elliott’s food that she splatters on the floor, and for teaching me more about humanity than any human.

    Two silly dogs occupying the front and passenger seats in the car

    House move

    We packed up all of our belongings and moved out of our rental house located in North Seattle, relocating to the suburbs of Renton. Even though Jess and I will always miss North Seattle — Cloud City Cafe, Maple Leaf Park, Magnuson Park, Grateful Bread — moving to Renton, in retrospect, was the right decision. We simply had outgrew the previous house; Elliott was constantly crawling back and forth, from one corner of the living room to the next, not much square footage for a baby locked inside in the midst of a pandemic. And for that reason alone, we traded our city lives for a home that offers some more breathing room.

    U-haul filled to the brim

    Personal Development

    Graduate School

    I completed the second year of graduate school and it continues to serve its purpose: deepening my understanding of computer science. Interestingly though, my acquisition of new knowledge does not always reflect in the grades that I receive. For example, I bled sweat and tears while taking “Compilers: Theory and Practice” course, burning the midnight oil, pouring roughly 30 additional hours per week (on top of work) when I normally clock 10-15 hours for every other course. Despite all the additional time I threw into the course, I received the lowest grade I ever received in graduate school. But receiving a lower no longer irks me. Because graduate school is not about earning high marks. It’s about changing the way you think.

    Collaborating with other students

    Earning a masters can feel lonely. So last semester, Fall 2020, I stayed active on the course forum, replying to other student’s questions as well posting new threads to spark conversation. I would share links to relevant blog posts. Also, I started something called “war room” study sessions, where a handful of us students would hop on a Zoom call together and study together for the exams; I’d share my screen and together, we would tease out the right answers. This student collaboration was the highlight of the course: connecting with other students wards off loneliness. Wanting to stay connected with other students once the course ended, I started a private mailing list for other graduate students who are also specializing in computing systems at Georgia Tech. To date, over 50 students subscribed and the list continues growing.

    Career as a software engineer

    I love my job as a software engineer. Every day, I make magic happen behind the scenes, continuing to breathe life into the Amazon (Web Services) Cloud. But this past year, work sucked the soul out of me. First, several on call rotations melted my brain into mashed potatoes. I turned into a drooling zombie after being alarmed out of bed at 3:00 AM and after staring at the computer screens until 10:00pm — three nights in a row. Second, workplace politics threw a wrench into the game and for the first time in my career, I was viewed as someone who no longer wanted to advance their career: all because I turned down a senior engineer’s offer to lead a particular project; to make matters worst, I used to consider that senior engineer as someone in my corner, someone who advocated for my career. The entire experience left a poor taste in my mouth and I still haven’t fully recovered from the sense of betrayal.

    Getting in touch with my feelings

    Separating self-worth from work

    “But there was a chance to chart your own course”

    – Dolores from Westworld. Season 3

    For most of my career, I’d measure my self-worth by the quality of the code or prose that I write. I often would only publish my work once I considered it to be “perfect”. Not anymore. I no longer buy into perfectionism because perfect does not exist. Perfection is subjective. I now focus on “shipping it”, delivering work at an accelerated rate. Ironically, my work quality has not degraded; in fact, I would say has improved in some aspects since I’m now producing, practicing and flexing my skills more than before.

    Getting lost in one’s work (aka “blackholes”)

    “I see your brain”

    – Jess Boyd

    I cannot count the number of times when I’m stuck solving a difficult problem, gluing myself to the keyboard, spinning my wheels, never breaking focus for hours and hours: Jess calls these my “blackholes”. Sometimes, intense focus pays off. Sometimes I arrive at the answer, all the self-induced tension resolving. But most of the times I fail to move forward, fail to make even an inch of progress, stuck in the same spot. Only after stepping back from these difficulty problems do I realize that I should’ve distanced myself earlier, allowing some time — even 5 minutes — to pass in order to see the problem with fresh eyes.

    Identifying as an introvert

    In December, I had picked up a book while walking the aisles at Barnes and Noble, the book titled “Networking for people who hate networking”. The book ships with a friendly, short 10-question quiz that helps you assess where you land on the spectrum of introversion. After answering the quiz and tallying up the points, I discovered that I’m highly introverted! Learning about introverted tendencies has helped me explain — not only to others, but to myself — some of my quirks, including the never-ending craving for alone time. Being introverted helps explain both why large social events drain my energy dry and why I wake up at 04:00 AM: no wife, no kids, no dogs — just me time. So I’m thankful for stumbling on the book and now I feel less guilty about my own introverted tendencies.

    Marketing oneself

    On a daily basis, I fear coming off as someone who excessively boasts, someone who reeks of arrogance. Not wanting to be perceived this way, I usually stop myself from sharing my original content (e.g. writing, music, videos); up until recently, I’d cringe when hearing the words “marketing oneself”. But my adverse reaction to marketing has been replaced with a shift in perspective: I now define marketing as solving other people’s problems and adding value to their lives. This new mind-set, combined with separating my work from myself, enables me to more freely share my thoughts.

    Saying goodbye to Trump

    I burst into tears of joy while listening to the radio, when NPR broke the good news that Trump lost the 2020 presidential election. Trump being out of the picture restores some of my faith in humanity (despite the fact that an overwhelming number of Americans voted for him). Of course, Trump will somehow continue stealing the spotlight; like cancer, he’ll reappear and crawl his way back into politics over the next few years. Nonetheless, he’s out of the presidential picture for at least the next four years.

    Leaning forward

    Good bye New Year’s resolution. Say hello to habits

    New years resolutions can be useful, but more often than not, most people abandon them within a few weeks or months. I’m no exception. So instead of penciling in some lofty goals for the year, I’m directing my energy towards cultivating healthy habits: existing habits I want to retain; new habits I want to develop. Because I believe that how we live everyday is how we live for the rest of our lives.

    Masters in computer science

    In fall 2021, I’ll graduate with a masters in computer science. Between now and then, I’ll need to complete three more courses: high performance computing; distributed computing; graduate algorithms. The main motivation for graduate school has been — and will continue to be — stretching my brain and forcing myself to see problems through a different lens. Because when all you have is a hammer, everything looks like a nail.

    Communication skills

    Every morning I sit down and write. And I write. And I write. I’ve committed myself to the craft for three reasons. First, writing helps me untangle the web of thoughts constantly buzzing around in my head; it’s easy to trick ourselves into believing we fully grasp a topic … that is until our incomprehensible prose exposes our lack of understanding. Second, writing, I think, is the key ingredient that distinguishes good engineers from great engineers. Some of the best engineers I worked with don’t just “know more”; they leverage their writing skills to influence the roadmap. Third, most simply, I enjoy the never ending pursuit of becoming a great writer. And someday soon, I’ll have the chops necessary to write my own memoir.

    Human Connections

    Cultivate marriage

    Before having children, I never understood how children coming into the picture would cause parents to drift apart. I get it now. Unless you carve out time for one another, unless you deliberately nurture your relationship, raising children fills up the entire day. So Jess and I are tossing ideas out in the air, looking for creative ways to turn into each other. Some ideas we toyed with so far include: starting a book club, writing together, recording song covers together. Really, I don’t think the activity itself matters — it’s just spending some quality time together.

    Stay connected with friends and family

    Family zoom call

    Earlier this year in the midst of the pandemic, I text messaged some old friends and after some back and forth chit-chat, I realized that I both miss and crave human connection. Because a warm, fuzzy feeling warmed my body after they shared updates around their family, their work, their world; me staying off of social media — Facebook and Instagram — for close to 5 years doesn’t help either. I essentially miss their moments, big and small. Wanting to stay more connected to friends and family, I often question should rejoin social networking. Probably not. From my perspective, the positive benefits are outweighed by the negative ones; the mindless thumb scrolling and lack of privacy are both the primary reasons I severed myself from these closed-in platforms. So, instead of plugging back in into social media, Ill continue with my own method for keeping tabs on people’s lives: a simple excel sheet.

    Closing

    Elon Musk offered some brilliant career advice that can be summed up into a single sentence: “If you’re not progressing, you’re regressing; so, keep moving forward.” But for 2021, I’d be completely content with regressing back to the way society looked prior to the pandemic. So, come on 2021, let’s do this. I hope — I pray — that the pandemic ends this year and that we all return back to some sense of normalcy.

     

  • Enterprise Java Beans – notes and summary

    Enterprise Java Beans – notes and summary

    Introduction

    Key Words: EJB, enterprise java beans

    Discuss how we can structure system software for large scale distributed sytem service

    Inter Enterprise View

    Inter Enterprise View: The motivation of using enterprise java beans

    Key Words: monolithic, supply chain model, amalgam, survivability, complexity

    From a user perspective, we view a system (like Ebay or Google) as a blackbox. But in reality, much more complex than that and within the system, there may be multiple enterprise working together and this can be difficult when trying to handle failures, complexity, and so on

    An Example

    Key Words: scheduling, parallel systems, synchronization, communication, atomicity, concurrency, object technology, reuse

    Using a system like Expedia, we face same issues in parallel systems like synchronization and concurrency and scheduling and atomicity and so on

    N-tier applications

    N tier applications

    Key Words: concurrency, parallelism, embarrassingly parallel applications

    Want to reduce network communication (latency), security (for users) by not compromising business logic, and increase concurrency

    Structuring N Tier Applications

    Structuring N tier applications

    Key Words: JEE, protection domain, bean

    We can split the protection domain uses containers, at the client or at the presentation layer, business layer or database layer. Each container contains N beans, bundle of java objects

    Design alternative (Coarsegrain session beans)

    Coarse grain approach. Although this approach protects business logic from outside network, fails to expose concurrency at the EJB container.

    Key Words: monolithic, concurrency

    Each session bean is very granular, the session bean encapsulating most of the logic. The upshot of this approach is that the container offers little service and the logic is not exposed outside the corporate network. The downside is that we do not exploit concurrency. There’s a missed opportunity where the EJB container and pull in data for multiple sessions

    Design Alternative

    Key Words: trade offs, persistent, bean managed persistence, container managed persistence, data access object

    With data access object design, we confront the short comings of the coarse grain session bean, by exploiting concurrency for data access, limiting I/O and network latency when accessing the database. The trade off? Business logic is exposed to the web container

    Design alternative (session bean with entity bean)

    Design alternative: session bean with entity bean. Hybrid approach of coarse grain and data access object.

    Key Words: session facade, design pattern, remote interface, RMI

    We now embed a session facade, that provides concurrency AND does not exposed business logic. To that end, we use RMI (remote interface) to communicate between the containers and/or between the session facade and entity bean

  • Recovery management in Quicksilver  – Notes and Summary

    Recovery management in Quicksilver – Notes and Summary

    The original paper “Recovery management in quicksilver” introduces a transaction manager that’s responsible for managing servers and coordinates transactions. The below notes discusses how this operating system handles failures and how it makes recovery management a first class citizen.

    Cleaning up state orphan processes

    Cleaning up stale orphan processes

    Key Words: Ophaned, breadcrumbs, stateless

    In client/server systems, state gets created that may be orphaned, due to a process crash or some unexpected failure. Regardless, state (e.g. persistent data structures, network resources) need to be cleaned up

    Introduction

    Key Words: first class citizen, afterthought, quicksilver

    Quicksilver asks if we can make recovery a first class citizen since its so critical to the system

    Quiz Introduction

    Key Words: robust, performance

    Users want their cake and eat it too: they want both performance and robustness from failures. But is that possible?

    Quicksilver

    Key Words: orphaned, memory leaks

    IBM identified problems and researched this topic in the early 1980s

    Distributed System Structure

    Distributed System Structure

    Key Words: microkernel, performance, IPC, RPC

    A structure of multiple tiers allows extensibility while maintaining high performance

    Quicksilver System Architecture

    Quicksilver: system architecture

    Key Words: transaction manager

    Quicksilver is the first network operating system to propose transactions for recovery management. To that end, there’s a “Transaction Manager” available as a system service (implemented as a server process)

    IPC Fundamental to System Services

    IPC fundamental to system services

    Key Words: upcall, unix socket, service_q data structure, rpc, asynchronous, synchronous, semantics

    IPC is fundamental to building system services. And there are two ways to communicate with the service: synchronously (via an upcall) and asynchronously. Either, the center of this IPC communication is the service_q, which allows multiple servers to perform the body of work and allows multiple clients to enqueue their request

    Building Distributed IPC and X Actions

    Bundling Distributed IPC and Transactions

    Key Words: transaction, state, transaction link, transaction tree, IPC, atomicity, multi-site atomicity

    During a transaction, there is state that should be recoverable in the event of a failure. To this end, we build transactions (provided by the OS), the secret sauce for recovery management

    Transaction Management

    Transaction management
    Transaction management

    Key Words: transaction, shadow graph structure, tree, failure, transaction manager

    When a client requests a file, the client’s transaction manager becomes the owner (and root) of the transaction tree. Each of the other nodes are participants. However, since client is suspeptible to failing, ownership can be transferred to other participants, allowing the other participants to clean up the state in the event of a failure

    Distributed Transaction

    Key Words: IPC, failure, checkpoint records, checkpoint, termination

    Many types of failures are possible: connection failure, client failure, subordinate transaction manager failure. To handle these failures, transaction managers must periodically store the state of the node into a checkpoint record, which can be used for potential recovery

    Commit Initiated by Coordinator

    Commit initiated by Coordinator

    Key Words: Coordinator, two phase commit protocol

    Coordinator can send different types of messages down the tree (i.e. vote request, abort request, end commit/abort). These messages help clean up the state of the distributed system. For more complicated systems, like a file system, may need to implement a two phased commit protocol

    Upshot of Bundling IPC and Recovery

    Upshot of bundling IPC and Recovery

    Key Words: IPC, in memory logs, window of vulnerability, trade offs

    No extra communication needed for recovery: just ride on top of IPC. In other words, we have the breadcrumbs and the transaction manager data, which can be recovered

    Implementation Notes

    Key Words: transaction manager, log force, persistent state, synchronous IO

    Need to careful about choosing mechanism available in OS since log force impacts performance heavily, since that requires synchronous IO

    Conclusion

    Key Words: Storage class memories

    Ideas in quicksilver are still present in contemporary systems today. The concepts made their way into LRVM (lightweight recoverable virtual machine) and in 2000, found resurgence in Texas operating system