Posts

I can't think in NoSQL (and neither can you)

If you're like me, a programmer taught how to think in terms of relational databases, you just can't design a NoSQL. Wait. No one can design a proper NoSQL database for relational data because it's a data store built on tradeoffs.  I have very relational data that I am being forced to feed into Firebase just because of how convenient Firebase is to set up. Here's a simplified problem statement: There are User s, each of whom has an email , name , and gender . These users can be friends , and have to consent  to their friendship - sent , pending , and accepted . Create a NoSQL json table such that there is no duplication of data, and each user is able to query a list of their friends including invites with all the user details. Your tradeoff is effectively choosing between optimizing one of either read or write . No matter how you structure your code, you'll end up with either: Optimize reads, data duplication ( View Code ) Each user contains all of their friend&#

Circumstantial

Image
“You know we’re still friends because life has it this way” she remarked, “there are certain things in life you chose. That you have complete control over and no matter which way the river flows, you’re always headed north. Then, there are other things that just work out in your favor. Like our friendship. You live in Europe and I live in UK, and what’s more when we go back home to India we live half an hour away from each other. How big a coincidence is that. Sure we plan trips and we make time to speak with each other. But that’s all hinged on being in close proximity. The further away we’d stay, the more our lives would change, and slowly our boats would drift apart. Imagine if I had taken up the offer to study at CMU. I’d be a poor student looking for a job. Right now, we bond over having moved away from home and setting up our own lives. As a student you just wouldn’t get my everyday problems. Heck, current me wouldn’t identify with student me. I think that’s it. We’re still close

Relationship Alphabet

Image
At dinner in New York, A told me how he waited many years for the right one. He always wanted children. Now he sacrifices his career to pick them up and drop them off to school everyday at age 50. At lunch in the office, B told me how his wife decided to take a step back from her career and take on a part time job. Her mother was never there for her. She wanted to be there for her kids. On our monthly catch-up, C tells me they’re pregnant. He was very happy. He later told me she’s 5 years older than him and that it was a real challenge to conceive. He’s ecstatic. At his desk, D told me he broke up with his girlfriend of 6 years. He’s 32, but he’s moving to California to start a new life. He can always come back to Germany, he says. On a video conference, E told me he’s quitting his job to move to Barcelona. This was the first time in 2 years he mentioned he had a daughter. This was also the first time he said he’s a divorcee. Right before our half marathon, F tells me they’re enga

She's a canvas

Image
The first time I met her, she was a canvas. A mystery, a piece of art yet to be painted. Was she 25? Was she 30? She looked like she had a grip on life. Like she knew what she was doing and why she was here. She moved her hair away from falling in front of her eyes. "Hi", I said breaking the invisible barrier. "You're gorgeous and I want to get to know you" is what I wanted to say. We spoke for an hour of things she was working on while sitting there, of things I was working on while sitting there. I felt as though I had uncovered a brush stroke on this artwork I was unravelling.  The next we met, we spoke of the stars and the universe, of our pasts and of our plans. There was depth beyond what one first sees. Getting to know the state of mind of the artist during the creation of the now finished piece you're looking at. The third time we met, she told me of her traumas. Of her struggles and of her worries. I realized then that what was once a mystery was no

You aren't in control

Image
He wakes up and asks his clock what time it is. The clock answers faithfully, just as it does every single morning. As he wakes up, he thinks to himself "the brain isn't meant for keeping track of time or todo lists". As he stands up, out of his bed, he then takes a quick glance at his wrist watch, once again in an attempt to control time. He has about 10 tasks ahead of him - mundane ones that every half decent human should do in the morning before leaving for work.  He's been trying to optimize how quickly he can leave for work in the mornings without dilly-dallying. He knows time passes the fastest when you're not looking. "It's like leaving your milk to boil", he thinks to himself, "don't pay attention to it for just a second , and 10 minutes will have passed by and the milk overflows". So he makes a note of what minute the clock shows. He then starts his routine, checking in on the clock completing one task after the next. And sure

Be on Instagram, ok. But tell me a real story instead.

Image
Why'd I stop posting on Instagram? Because Instagram stopped being about the lives of people -- the  stories aren't about everyday things they do, but just photos of the places they visit, or the food they eat, or the concert they go to, or the relationship they're in, or the dog they own. That's dull. The mantra: Spend money, show the gram you spent money. Go to the beach on vacation, ok. But show me your progress on the new sport you're learning instead. Take a picture of your food, ok. But tell me the funny art piece you saw in the restaurant instead. Show me your dog, ok. But tell me its everyday peculiarities instead. Listen to your favorite band live, ok. But tell me why they are your favorite band instead. Go to America for the first time, ok. But tell me what felt different to you about the country instead. Bought new clothes, ok. But tell me about that funny interaction with the attendant instead. Biked to work today, ok. But tell me about that funny numbe

The Little Man’s Theory

Image
Three Little People sit in their little living room, drinking their three little drinks. Invisible air bubbles of conversation - like little chat heads constantly flickering float above each one’s heads. The Little People are deep in conversation. “I have a theory” says The Little Man1. “What is your theory?” asks The Little Woman. The Little Man2 just sits and sips his drink. “Well it’s more of an experience. But of late, I’ve been going through life looking at myself — this situation — every setting that I’m in, from a third person’s perspective” says The Little Man1.   “Like a camera following you everywhere you go, and seeing yourself through it, instead of just living your life?” asks The Little Woman. “Ha, reminds me of The Sims, that computer game where the characters just do everyday life things” says The Little Man2. “Yes! A lot like The Sims!” exclaims The Little Man1 as he continues “Do you know why they’re called that?” “Because it’s a catchy name for a video game?” says Th

Write more, so that you can write more

Image
I was inspired by a post titled "Write more, but shorter" (do read!) that says writing shorter brings clarity to thought, while keeping the content digestible. The article resonated with me a lot - but missed a key point. Writing more frees up your brain to be able to have new ideas.  For a year now, I've had 10 ideas floating in my mind that I want to solidify. I've tried writing about them, but I would constantly struggle to draw analogies, make a convincing argument, make it read like a story, all while still getting the point across. I would then not publish them at all, leaving the thought lingering in my mind. These thoughts have rented my mindspace for a year now. (!) This limits how much more I can think of, because my mind keeps coming back to the old thoughts I haven't completely thought through. Humans are idea machines that need an environment to allow for more ideas to flow in; I don't know where ideas come from, but what I do know is the more I

When Practice Meets Opportunity, Magic Happens

Image
"Ah I've been learning and practising and it feels so futile! I really don't want to learn to play the piano anymore. What's the point anyway?", she complained over the phone as she went on "there'll never be a time when I will think I'm actually proficient, it's just so time consuming and I don't even know why I'm learning this anymore". A year ago at the start of the lockdown, she started learning to play the piano. And as the usual pattern of picking up a new hobby goes, her enthusiasm shot up the day she decided she would learn to play, skyrocketing with every day she had to wait, until finally peaking on the day it was delivered to her house. Then came the heavy sinking feeling the moment she put on a YouTube tutorial and tried to follow along. She whispered under her breath with her motivation crumbling, "man, this is actually very hard". "Okay, picture this", I started to respond. "The lockdown is final

On Things Seeming Obvious Once You Know Them

Image
There's a complicated mess of wires, most connecting several of the five metal boxes, amongst others which are just loose ends dangling, that together make the system you're working on. There's a phone connected to this complicated mess that puts the system in configuration 1. Your task is to put the system in configuration 2 by reconnecting the phone to a different port. The problem is, no one is around and you don't know how or where it's supposed to connect. But as soon as you have the right connection, the system will tell you it is in configuration 2. So you go on your journey to figuring it out: Hit and trial You start off by disconnecting the cable connecting the phone to the system. So now you have a phone connected to a cable with a loose end, and you have to figure out where it fits.  You start looking around. You have no idea where it goes, so you make a quick scan of all the ports, but find nothing that the wire could connect to. Break it down You grunt