[{"content":"My favorite kind of vacation is where I can explore and get to know a new place and also see some cool wildlife and learn more about their behavior and their life. Orangutans were something that always fascinated me, and when planning a trip to Indonesia, they had to be on the schedule.\nI was trying to remember where I got interested in Sumatran orangutans, and I guess I watched a documentary. Not sure which.\nNorth Sumatra, and specifically Gunung Leuser National Park, is a great place to see them up close.\nAnd there is no better way to see them than a trek in the middle of the jungle, and to have better chances, a two-day, one-night trek was something that interested us. It sounded long enough without being too wild. Also, my wife wouldn’t do more than this.\nGetting to Bukit Lawang The starting place is a small village called Bukit Lawang. It is 3 and a half hours away from the closest airport in Medan (KNO), and honestly, getting there is the worst part of this trip. Bring cash, as withdrawing money at the airport was a challenge. One ATM had a limit of 1M IDR, another 1.2M, and one was not working well. I found a BNI one with a limit of 2M and still had to do 4 withdrawals. We arranged the transfer with the hotel, so the driver was already waiting for us when we got there. He was nice but didn\u0026rsquo;t speak English. My wife slept almost the whole way, while I watched the landscape and the people.\nThe village is very nice. After a point, you cannot go by car anymore, so you have to go walking or by motorcycle, and that’s most of the tourist area with the hotels, resorts, and everything. The people are very friendly, almost always saying hello and smiling. The village is very small, and you can walk around it in 10 minutes. There are a few restaurants, and the main street is along the river.\nWhere we stayed We stayed at the Garden Inn hotel, which was really nice and had a very good view of the river. The staff were really nice. The room was comfortable, and it had hot water and no air conditioning, but there was a fan, and the room was kind of open, with screens to keep the bugs out. One side of the room is made of big rocks, and hearing the river from the balcony is really cool. The only downside is the humidity: clothes never fully dry, so the room has a bit of a smell of damp clothes.\nThe view from our room at Garden Inn\nThe breakfast was a menu, and you could pick one option from each category, which was good, but if you stay three nights like we did, it starts to get a little bit repetitive. The local coffee is made with the grounds, like a Turkish coffee, and it is better and stronger than the Americano. On our first night, we had dinner at the hotel restaurant. We had the Nasi Goreng Ayam, a good meal and cheap compared to Canadian standards.\nBooking the trek The trek was our main goal, and we initially wanted to book in advance with some other companies that we found on the Internet, but they required us to stay at their hotel, which was not an advantage for us because their hotel was a lot more expensive than the one we found, so we ended up booking the trek with our own hotel, Garden Inn, as they also offered the trek. We arranged everything with them through the messages on Booking.com, and the process was very easy and smooth. After finishing the trip, we realized this was the best option anyway. The trek cost 4M IDR for the two of us, plus 450k in tips for Erwin, Jo and the cook.\nWe went on September 12, which was already the end of the season, so even though we didn’t book a private tour, we were the only ones in our group and basically got a private tour.\nWe had one guide named Erwin and an assistant guide called Jo. Erwin has been working as a guide since 2007, the last 6 years or so for Garden Inn, and according to him, we were the first Brazilians he had ever guided.\nMy wife and I with our two guides, Erwin and Jo\nDay 1: Into the jungle Before we even left, the jungle said hello. Right after breakfast, a snake dropped from the ceiling of our room and kind of followed us. According to the staff, it was poisonous. My wife was really afraid, and the hotel moved us to another room right away. They said that it is not something really common, and I believe them because they looked concerned when we showed them the video.\nWe started the trek right after that. The guides picked us up at the Garden Inn hotel. We saw a hornbill, but it was with its back to us, so we didn\u0026rsquo;t see it very well. Later we saw two of them flying.\nEven before we reached the national park, we saw some Thomas leaf monkeys. They are beautiful animals and jump all around.\nA Thomas leaf monkey, one of the first animals we saw\nThe first orangutan we saw was also not inside the park, but it was a bit far, and we really could not see it well. The best ones came after we entered Gunung Leuser National Park.\nThe best view we had that day was a big male we were trying to track down. It was close to us, so it was really nice to watch it for a few minutes. It even made a nest so it could sit more comfortably.\nThe big male, the closest orangutan we saw on the first day\nHalfway, we had our lunch, which was prepared with great care. They really pay attention to details and did a great job. It was also really good.\nLunch time in the jungle\nWe walked around 9.5 km, which is not that much, but in that heat and humidity, we were exhausted. We had never sweated so much in our lives, I guess close to sauna sweating. We were wet from head to toe the whole day, and so was everyone else. I also discovered new smells I didn\u0026rsquo;t know I had, not good ones. If you go, bring clothes that dry quickly.\nThe camp is very basic, but better than I expected. When we arrived, they served us fresh fruit, which we were kind of missing.\nOur camp, right next to the river\nOur shower was a river shower. It was so hot that we went straight into the river to cool off. The water was really good and cool, so we enjoyed it a lot.\nNot long after, the rain started. Being in the middle of the forest, hearing the river and the rain, set a great mood.\nDinner was around 7 PM, and it was really good and well prepared. We ate a lot more than we expected, and we were really surprised they could make such good food in the middle of the jungle. They put a lot of care into preparing every meal. The fruits were always cut really well, like the pineapple in nice shapes, and the plates were always nicely decorated with banana leaves. After dinner, there was nothing else to do, so we went to bed.\nThe bed is ok. It is not a luxury hotel, but we cannot complain, as we are in the middle of the jungle. We didn\u0026rsquo;t sleep that well, as my wife was a bit scared, and it was not super comfortable. But it was a good enough sleep to rest.\nInside our tent for the night\nDay 2: The mother and the baby We woke up early, around 5:30. A cook comes and prepares everything. They have their own tent, which is also a kitchen.\nThere was a pig-tailed macaque that came close to our campsite. Actually, pig-tailed macaques are pretty common, and they are usually around when you are having meals.\nA pig-tailed macaque visiting our camp\nThey prepared a nice breakfast for us by the river, so we could enjoy it in peace and calm. The food was really good, and the coffee was strong and good too. The breakfast was served on banana leaves, which was a nice touch.\nBreakfast by the river, served on banana leaves\nWe left the campsite around 9:30 AM. We saw the big male again on our way back. It was even on the ground, moving between the trees. It was such a great time.\nThe highlight came after our fruit stop around noon: a mother, a young one and a baby. The young one was moving quite a bit, and we even saw it grab a termite nest and eat the termites. The baby was so young and fragile. Seeing the different ages of orangutans together was really special.\nA young orangutan having a snack\nHanging around and looking right back at us\nAfter a quick lunch, the way back was by tubing down the river. It was better than expected, fresh and not scary at all. The team put all our things in a waterproof bag, so nothing got wet. A great way to end the trek.\nIn total, we saw around 8 orangutans in the two days.\nThe extra day in Bukit Lawang We had one more day in the village. In the morning, I walked about one hour to the bat cave. The cave is big, and the second chamber had a lot of bats. Crossing from the first chamber to the second was really hard, but it was worth the morning. On the way, I even tried to talk with a local farmer. Talking is a stretch; it was more like sign language.\nMy wife does not like the jungle so much, as there are not many things to do, so she stayed relaxing by the river. The monkeys were very active in the morning, jumping around on the roof and the wires, and I found them quite aggressive.\nFor food, we found a better option than the hotel. We saw some locals sitting by the river at Madam Resto and thought if it was good for the locals, the price must be good. Beer was 50k compared to 80k at the hotel, and the food was a lot cheaper too. We had gado gado and chicken satay, and both were really good. On the last night, we went to the IDA restaurant for chicken and fries to take a break from the local food, again picking a place with beer around 50k.\nFinal thoughts North Sumatra was a good surprise. I thought Bukit Lawang was going to be a very simple and poor place, but the village is well taken care of and organized, and the people are really friendly. The village relies on tourism, so everyone makes you feel very welcome. We said so many hellos walking around.\nThe trek was challenging, but it was the second-best experience of our whole trip to Indonesia, right after scuba diving in Komodo. Seeing orangutans of different ages in the wild, being so well fed by the team and sleeping in the middle of the jungle are things I will remember for a long time.\nI took the orangutan photos with the same Canon R7 I used for the wildlife of Kenya and Tanzania, and some of them are available on Adobe Stock as part of my stock photography experiment.\nCheers.\n","permalink":"https://luizvieira.me/sumatra-orangutan-trek/","summary":"Our two-day, one-night jungle trek from Bukit Lawang into Gunung Leuser National Park to see Sumatran orangutans in the wild.","title":"Wild Orangutans on a 2-Day Jungle Trek in Bukit Lawang"},{"content":"Africa was number one on my travel list, and in August 2025 my wife and I finally did a 10-day safari in Kenya and Tanzania. That post covers the planning, the lodges and the parks. This one is just about the animals we saw during the trip.\nWe visited Lake Nakuru, the Masai Mara, the Serengeti, Ngorongoro Crater, Tarangire and Amboseli, and we saw everything we hoped for and more, including the Big Five and the wildebeest crossing the Mara River. In total, there are 57 different animals in this post: 23 mammals, 1 reptile and 33 birds.\nHere I will try to collect my photos of the wildlife we saw along the way, all taken with my Canon EOS R7. They are grouped by type, starting with the Big Five.\nHere they are:\nBig Five The Big Five are the lion, leopard, elephant, buffalo and rhino. The name comes from hunters, who considered them the most dangerous animals to hunt on foot. Today, it is the list every safari visitor wants to complete, and we were lucky to see all five.\nLion We saw lions several times, but the Masai Mara and the Serengeti gave us the best moments. In the Mara, we saw lionesses with cubs playing together, and then a male lion appeared slowly and majestically behind the pride. He was limping a little, but he still looked magnificent. We also saw two sleepy males lying in the shade. In the Serengeti, we saw two lionesses with six cubs, and in Amboseli, two young males walking towards a group of wildebeest. They got close but did not charge.\nThe most amazing scene was in Tarangire, where we watched a lioness hunting. We saw her getting into position and then running after her prey. We missed the exact moment because it happened behind another car, but then we saw her eating a small wildebeest. Seeing a predator hunt is completely different from seeing one resting in the shade.\nWhat surprised me the most was how little they cared about us. Most of the time, they just continued doing their own thing.\nA lion cub resting in a tree in Northern Serengeti. Get this photo on Adobe Stock\nLeopard Our first leopard was Luluca, a well-known leopard in the Masai Mara. She was trying to get away from the people watching her, and the drivers were quite aggressive trying to position their cars closer so everyone could see.\nThe second one was much more interesting. In the Serengeti, we saw a male leopard in a sausage tree, eating a wildebeest he had taken up into the branches. It was already partly eaten and smelled bad, so it looked like he had been keeping it there for a few days. Leopards do that to keep their food away from hyenas and other predators. It was one of the most memorable animals of the trip.\nA leopard snarling while eating its kill in the Serengeti. Get this photo on Adobe Stock\nAfrican elephant We saw elephants almost everywhere, but our first ones were at the Sheldrick Elephant Orphanage in Nairobi. We spent about an hour watching them eat, play in the water and interact with each other, and we were even able to touch some of them.\nIn the Masai Mara, we saw a small herd with a baby grazing. In Tarangire, there were lots of elephants around the river. We watched them drinking, playing and making noises, a baby drinking milk from its mother, and even some trying to mate. One evening, there was even an elephant standing right next to our camp.\nOne of my favorite moments was in Amboseli, watching baby elephants learning how to use their trunks. They were still figuring out how to control them. We also saw elephants shaking the grass to remove the dirt before eating it.\nA family of elephants crossing a dirt road in Amboseli. Get this photo on Adobe Stock\nCape buffalo Buffaloes were very common in Lake Nakuru. We saw them many times during our first game drive, together with zebras, giraffes and impalas. We saw them again in the Masai Mara and Amboseli.\nThey look calm while grazing, but they are powerful animals and can be unpredictable.\nA Cape buffalo grazing on the green plains of Lake Nakuru. See my collection on Adobe Stock\nWhite rhino We saw our first white rhino even before reaching the hotel at Lake Nakuru, and during the game drive we saw around 15 of them. We had already seen so many animals on that first day that we started wondering what would be left for the rest of the trip.\nUnfortunately, we did not see any black rhinos, and Nakuru was the only place where we saw rhinos at all. A fun fact: white rhinos are not white. The popular story is that the name comes from a mistranslation of the Dutch word \u0026ldquo;wijd\u0026rdquo;, meaning wide, because of the shape of their mouths, but there is no real evidence for it, and nobody knows for sure.\nA white rhino resting under a tree in Lake Nakuru. Get this photo on Adobe Stock\nOther predators The big cats get most of the attention, but there are many other predators on the savanna. Some of them hunt, some scavenge, and most do a bit of both.\nCheetah We saw our first cheetah in the Masai Mara, with the remains of a Grant\u0026rsquo;s gazelle or an impala. In the Serengeti, we saw a mother with two cubs, which was really nice to watch, and another one standing on the spare tires of a safari vehicle. In Amboseli, we saw a few more, but they were quite hidden and hard to see.\nClose-up portrait of a cheetah in the morning light, Serengeti. Get this photo on Adobe Stock\nServal We spotted this one in Central Serengeti. It looked like a big cat with cheetah-like colors. It was the only one we saw during the whole trip. They are not easy to spot.\nA serval standing in the tall grass of the Serengeti. See my collection on Adobe Stock\nSpotted hyena We saw three hyenas on our first game drive in Lake Nakuru, and later more of them, sometimes in groups, in the Masai Mara and the Serengeti. We even saw some on the road between parks.\nIn Amboseli, we learned that female spotted hyenas are bigger than the males, and that their front legs are longer than their back legs. Also, they are not just scavengers, they are good hunters too.\nA spotted hyena looking for food in Lake Nakuru. Get this photo on Adobe Stock\nJackals We saw a golden jackal in the Serengeti. It looked like a small dog. In Lake Nakuru, we saw another animal that looked like a fox but was not a fox. That one is in the photo below, and it is actually a black-backed jackal.\nA black-backed jackal on alert in the tall grass of Lake Nakuru. Get this photo on Adobe Stock\nBanded mongoose We saw a group of banded mongooses in the Masai Mara. In the photo, they are foraging together. They usually live in groups of 10 to 20, and the whole group helps raise the pups.\nA band of banded mongooses foraging in the Masai Mara. Get this photo on Adobe Stock\nOther mammals This is the biggest group. Grazers like zebras, wildebeest and antelopes were everywhere, and they are the reason the predators are there.\nHippopotamus We saw hippos in many places. At Zebra River Camp in the Masai Mara, we could see them from our room. Sitting outside with a beer and watching them at dusk, without even needing a game drive, was a highlight in itself. We also saw them in the Mara River, with crocodiles nearby.\nIn Ngorongoro, we had lunch at a beautiful spot overlooking a lake with hippos, including a baby with its mother. In Tarangire, there were lots of them in the river close to our picnic.\nOne thing we learned: hippos use their tails to spread their poop and mark their territory. It is as unpleasant as it sounds.\nHippos on the riverbank and in the water in Amboseli. Get this photo on Adobe Stock\nGiraffe Our first giraffes were at the Giraffe Centre in Nairobi, where we were able to feed them. In the parks, they were everywhere in Lake Nakuru, and in Tarangire we watched them awkwardly bending down to drink from the river, together with zebras and elephants. Seeing such different animals sharing the same water was beautiful.\nTwo things we learned: giraffes have seven neck vertebrae, the same as humans, just much longer. And the horn-like things on their heads are called ossicones.\nA giraffe standing alone in the savanna of Amboseli. Get this photo on Adobe Stock\nPlains zebra Zebras were everywhere. In Lake Nakuru alone, we saw more than 200 of them in a single day. In the Serengeti and Ngorongoro, they were often mixed with huge herds of wildebeest, and by the time we reached Ngorongoro it felt a bit repetitive.\nIn Tarangire, we could hear them. Their call sounds surprisingly similar to a donkey.\nA herd of plains zebras grazing in the golden savanna of Tarangire. Get this photo on Adobe Stock\nWildebeest The wildebeest migration was one of the main reasons we picked late August. In the Masai Mara, we found a really big herd during a picnic stop.\nIn Northern Serengeti, we waited around five hours for the Mara River crossing. There were huge numbers of wildebeest at the riverbank, but they were hesitant. They would move closer to the edge and then go back to the herd. Many other drivers gave up, but our driver Jackson encouraged us to stay. We were already looking at the clock when, at around 1:56 PM, one brave wildebeest finally went into the river and the others followed. It was a magical moment and one of the highlights of the trip.\nUnfortunately, we also saw dead wildebeest in the river that had drowned while trying to cross.\nThe Great Migration: wildebeest crossing the Mara River in Northern Serengeti. Get this photo on Adobe Stock\nImpala We saw impalas even before reaching the hotel at Lake Nakuru, and there were lots of them during our first game drive. Later we saw many more in the Masai Mara.\nA female impala and her calf standing alert in the bush of Lake Nakuru. See my collection on Adobe Stock\nThomson\u0026rsquo;s gazelle We saw Thomson\u0026rsquo;s and Grant\u0026rsquo;s gazelles in Lake Nakuru, the Masai Mara, the Serengeti and Amboseli. They are small antelopes and a common prey for cheetahs, so they always need to stay alert, even when they look relaxed while grazing.\nA male Thomson\u0026rsquo;s gazelle walking through dry grass in Amboseli. Get this photo on Adobe Stock\nTopi We saw many topis during our morning game drives in the Masai Mara, including the day we went looking for the wildebeest migration. We also saw them in the Serengeti.\nA topi grazing on the open plains of the Masai Mara. Get this photo on Adobe Stock\nEland We saw them in the Masai Mara and again in the Serengeti. I didn\u0026rsquo;t know they existed. Together with the giant eland, they are the largest antelopes in the world, really big and majestic. In the photo below, there are oxpeckers on its back, small birds that feed on ticks from large animals.\nA common eland with oxpeckers on its back in the Masai Mara. Get this photo on Adobe Stock\nCoke\u0026rsquo;s hartebeest We saw hartebeests in the Serengeti. It looked similar to a topi, but with horns shaped a bit like a heart. These were the only ones we saw.\nA Coke\u0026rsquo;s hartebeest standing alert on the short-grass plains of the Serengeti. Get this photo on Adobe Stock\nWaterbuck We saw waterbucks in the Serengeti, near swampy patches, and again in Tarangire. They are large antelopes usually found near water, and many have a pale ring around their rump.\nA small herd of waterbuck in the golden grass at sunrise, Tarangire. See my collection on Adobe Stock\nWarthog We saw warthogs in Lake Nakuru. People call them Pumbaa, and it is easy to see why. The one in the photo is from Amboseli, and you can see its big tusks and mane. When they run, they hold their tails straight up in the air, like an antenna.\nA warthog with big tusks in the grasslands of Amboseli. Get this photo on Adobe Stock\nOlive baboon We saw baboons in Lake Nakuru and Tarangire. This one was in Ngorongoro. It was sitting on a rock in the forest area of Ngorongoro. Baboons live in big troops, and they are smart enough to steal food from cars and camps, so it is better to keep an eye on them.\nAn olive baboon sitting on a rock in the forest of Ngorongoro. Get this photo on Adobe Stock\nVervet monkey At our picnic in Tarangire, we had some very cheeky monkeys around us. One stole Jackson\u0026rsquo;s banana, and another grabbed May\u0026rsquo;s juice, but I was able to get it back. It was funny to see how comfortable they were around people, but it was also a reminder to keep your food close.\nA vervet monkey eating a banana in Tarangire. Get this photo on Adobe Stock\nReptiles We only saw one reptile during the trip, but it was a memorable one.\nNile crocodile We saw crocodiles in the Mara River, the same river where the wildebeest were trying to cross. We also saw the remains of wildebeest that had drowned during the crossing. It was a reminder that the migration is not just huge herds moving across the plains. Crossing the river is dangerous, and the crocodiles are waiting.\nWe also tried crocodile meat at The Carnivore Restaurant in Nairobi. It had a strong, unique flavor, and I actually really liked it.\nA Nile crocodile resting on a sandbank in the Masai Mara. Get this photo on Adobe Stock\nBirds of prey Eagles, kites, vultures, a tiny owl and the secretary bird, which hunts on foot.\nSecretary bird We saw a secretary bird in Amboseli. They are unusual birds of prey because they spend most of their time walking on the ground instead of hunting from the air, and they are known for hunting snakes.\nA secretary bird running across the grassland of Amboseli. Get this photo on Adobe Stock\nAfrican fish eagle We saw an African fish eagle in Amboseli. In the photo, it is standing in the tall dry grass, away from the water where it usually hunts. Its call is one of the most famous sounds in Africa, and it is the national bird of several countries, including Zambia, Zimbabwe and Namibia.\nAn African fish eagle standing in the dry grass of Amboseli. Get this photo on Adobe Stock\nLong-crested eagle We saw this one in Lake Nakuru, and we also saw one in another park, but I don\u0026rsquo;t recall which. In the photo, it is perched on top of a thorny bush, and you can see the long crest of feathers on the back of its head that gives it its name. They usually hunt from a perch like this, watching the ground for rodents.\nA long-crested eagle perched on a thorny bush in Lake Nakuru. Get this photo on Adobe Stock\nBlack-winged kite We saw a black-winged kite in Amboseli. It was eating some kind of animal. In the photo, it is perched on a dead tree, feeding on what looks like a small mammal. They are known for hovering in the air, staying in the same spot while beating their wings, before dropping on their prey.\nA black-winged kite eating a small mammal on a dead tree in Amboseli. Get this photo on Adobe Stock\nYellow-billed kite We saw a yellow-billed kite in Ngorongoro Crater. It was flying close to a lake, so the photo was not as good as I expected. Kites are very agile in the air, and they are known for snatching food, sometimes even from people\u0026rsquo;s hands.\nA yellow-billed kite soaring over Ngorongoro Crater. Get this photo on Adobe Stock\nVulture We saw vultures in the Masai Mara, the Serengeti and Tarangire. They are easy to overlook when you are focused on the big animals, but they play a very important role by cleaning up the carcasses.\nTwo vultures feeding on a carcass in Tarangire. Get this photo on Adobe Stock\nAfrican scops owl Early one morning in Tarangire, we saw a very small owl. It was the first owl of the entire trip, and it was a nice surprise because they are not easy to find during daytime game drives. But it is even hard to spot it in the photo.\nAn African scops owl camouflaged in an acacia tree in Tarangire. See my collection on Adobe Stock\nWater birds Lake Nakuru, the lake in Ngorongoro Crater and the swamps of Amboseli were full of water birds, from thousands of flamingos to pelicans, herons and storks.\nFlamingo We saw thousands of flamingos in Lake Nakuru on our first day, and again in Ngorongoro Crater, where some of them were fighting in the lake. The water there was so salty that we could see salt forming around the edges. Their pink color comes from the pigments in the algae and tiny organisms they eat.\nLesser flamingos squabbling in Lake Magadi, inside Ngorongoro Crater. See my collection on Adobe Stock\nPelican We saw pelicans in Lake Nakuru during our first game drive. It was really nice to see them fishing in a group and diving. I was even able to capture one with a fish in its mouth.\nA great white pelican eating a fish in Lake Nakuru. Get this photo on Adobe Stock\nWhite-breasted cormorant Another one from Lake Nakuru. Cormorants dive to catch fish, and their feathers are not completely waterproof, so they often spread their wings to dry.\nTwo white-breasted cormorants resting on rocks in Lake Nakuru. Get this photo on Adobe Stock\nGrey heron We saw a grey heron in Lake Nakuru. In the photo, it is wading in the shallow water. They hunt by standing very still and then striking fast with their long bills to catch fish. It is the same species found in Europe and Asia.\nA grey heron wading in the shallow water of Lake Nakuru. Get this photo on Adobe Stock\nGoliath heron We saw a Goliath heron in Amboseli. Goliath and grey herons look similar, so I may have the name wrong here. It is the largest heron in the world and can stand up to 1.5 meters tall. In the photo, it is wading in shallow water hunting for fish.\nA Goliath heron hunting for fish in the shallow water of Amboseli. Get this photo on Adobe Stock\nCattle egret We saw cattle egrets in Amboseli. They were usually in the swamps around the elephants. In the photo, one is riding on an elephant\u0026rsquo;s back. They follow large animals to catch the insects they disturb while walking and grazing.\nA cattle egret riding on an elephant\u0026rsquo;s back in Amboseli. Get this photo on Adobe Stock\nAfrican spoonbill We saw spoonbills during our first game drive in Lake Nakuru. Their bills really look like spoons, and they sweep them through the shallow water to find food.\nAn African spoonbill wading in Lake Nakuru. Get this photo on Adobe Stock\nSaddle-billed stork We saw a saddle-billed stork in Amboseli. It is a very tall bird with black, white and red colors and a yellow saddle-like mark on its bill.\nA juvenile saddle-billed stork foraging in the grass of Amboseli. See my collection on Adobe Stock\nYellow-billed stork We saw yellow-billed storks in Lake Nakuru. In the photo, you can see its bright yellow bill and red face. They feed by walking with the bill open in the water and snapping it shut as soon as they touch a fish.\nA yellow-billed stork with its yellow bill and red face in Lake Nakuru. Get this photo on Adobe Stock\nMarabou stork We saw marabou storks in Lake Nakuru and in other places. They are known as the ugly stork. In the photo, one is feeding among lesser flamingos. They are huge birds, with one of the largest wingspans of any land bird, and they often eat carrion together with vultures.\nA marabou stork among lesser flamingos in Lake Nakuru. Get this photo on Adobe Stock\nAfrican jacana We saw an African jacana in Amboseli. They are also called Jesus birds. In the photo, you can see its big feet. Their very long toes spread their weight, so they can walk on floating plants, and it looks like they are walking on water.\nAn African jacana walking by the water on its big feet, Amboseli. Get this photo on Adobe Stock\nBlacksmith lapwing We saw blacksmith lapwings in the Masai Mara and Amboseli. It was nice to see a different lapwing from the ones we have in Brazil. The name comes from its call, which sounds like a hammer hitting an anvil.\nA blacksmith lapwing foraging in the grass of the Masai Mara. Get this photo on Adobe Stock\nRed-knobbed coot We saw red-knobbed coots in Amboseli. In the breeding season, they have two small red knobs on top of the white shield on their heads, which is where the name comes from.\nTwo red-knobbed coots swimming in Amboseli, one carrying nesting material. Get this photo on Adobe Stock\nEgyptian goose We saw an Egyptian goose in the Serengeti. In the photo, one of them is spreading its wings. Despite the name, they are not true geese, they are closer to shelducks. They were also considered sacred in ancient Egypt.\nEgyptian geese on muddy ground in the Serengeti, one spreading its wings. See my collection on Adobe Stock\nOther birds The rest of the birds, from the ostrich, the largest bird in the world, to small colorful ones like starlings, weavers and the lilac-breasted roller.\nOstrich We saw ostriches in the Masai Mara and Amboseli. We also tried ostrich meat at The Carnivore Restaurant in Nairobi. The photo is from Amboseli, where a pair was taking a dust bath. The black one is the male and the brown one is the female. Ostriches are the largest birds in the world, and they can run at around 70 km/h.\nA pair of ostriches taking a dust bath in Amboseli. See my collection on Adobe Stock\nKori bustard We saw a kori bustard in Ngorongoro Crater. It is one of the heaviest flying birds in the world. They spend most of their time walking slowly through the grass looking for food, like in the photo.\nA kori bustard walking in the dry grass of Ngorongoro Crater. Get this photo on Adobe Stock\nGrey crowned crane We saw our first crowned crane in Ngorongoro Crater. It was a new bird for us, which made the sighting even nicer. The photo below is from Amboseli.\nTwo grey crowned cranes foraging in the marshes of Amboseli. Get this photo on Adobe Stock\nSouthern ground hornbill We saw this one in the Masai Mara. It is a large bird that spends most of its time walking on the ground looking for food.\nA southern ground hornbill walking in the dry grass of the Masai Mara. Get this photo on Adobe Stock\nRed-billed hornbill In Tarangire, we saw red-billed hornbills from very close. We called them Zazu, after the bird from The Lion King. It was nice to see the real version of a character we already knew.\nA red-billed hornbill foraging on the ground in Tarangire. See my collection on Adobe Stock\nVon der Decken\u0026rsquo;s hornbill We saw Von der Decken\u0026rsquo;s hornbills in Tarangire. The one in the photo is a male, which has a red and ivory bill, while the female has a black bill. They are related to the red-billed hornbills, the Zazus we saw in the same park.\nA male Von der Decken\u0026rsquo;s hornbill perched on a branch in Tarangire. Get this photo on Adobe Stock\nLilac-breasted roller We saw lilac-breasted rollers in the Masai Mara and the Serengeti. With all those colors, it is one of the most beautiful birds of the savanna, and it is often called Kenya\u0026rsquo;s national bird.\nA lilac-breasted roller perched in the Masai Mara. Get this photo on Adobe Stock\nRed-and-yellow barbet We saw a red-and-yellow barbet in Tarangire. In the photo, it is perched on a termite mound. They dig their nests into termite mounds, which is why they are often seen around them.\nA red-and-yellow barbet perched on a termite mound in Tarangire. Get this photo on Adobe Stock\nSuperb starling We saw superb starlings in Amboseli. In the photo, it is standing on a rock, showing its shiny blue and green feathers and orange belly. They are very common in East Africa and often seen around lodges and camps.\nA superb starling standing on a rock in Amboseli. Get this photo on Adobe Stock\nAshy starling We saw an ashy starling in Tarangire. Unlike the superb starling, it is plain grey-brown, and it is only found in Tanzania.\nAn ashy starling on the sandy ground of Tarangire. Get this photo on Adobe Stock\nTaveta golden weaver We saw Taveta golden weavers in Amboseli. In the photo, there are four of them together. Weavers build their nests by weaving grass, and this species is only found in a small area along the border between Kenya and Tanzania.\nFour Taveta golden weavers perched together in Amboseli. Get this photo on Adobe Stock\nPied crow We saw a pied crow in Tarangire. It is different from the crows we have here in British Columbia. In the photo, it is calling from a metal railing. It is easy to recognize by its white chest and the white collar on the back of its neck.\nA pied crow calling from a metal railing in Tarangire. Get this photo on Adobe Stock\nIf you\u0026rsquo;d like to see more photos from this trip, they are available in my Africa collection on Adobe Stock. I also wrote about why I started selling my photos on stock websites.\nIf you enjoyed this one, I also keep a gallery of the wildlife of British Columbia, and I saw wild orangutans on a jungle trek in Sumatra.\nCheers.\n","permalink":"https://luizvieira.me/kenya-tanzania-wildlife-photos/","summary":"My photos of the wildlife of Kenya and Tanzania, from leopards and cheetahs to rhinos, elephants and flamingos.","title":"Wildlife of Kenya and Tanzania Through My Lens"},{"content":"British Columbia in Canada is an amazing place with beautiful nature and plenty of wildlife. From humpback whales in the blue ocean to the bears in the green trees to the eagles in the white mountains, this province has it all.\nThis page brings two of the things that I love in one place: nature and photography. Here I will try to collect images taken by me of some of the beautiful wildlife we have around British Columbia.\nI’m probably not going to be able to document all the beautiful wildlife we have here, but I will try my best in my free time as my hobby.\nHere they are:\nMammals Black bear We saw a bunch of them in the last few years. Some in Whistler, a few around the Vancouver area. The most abundant place we saw them was in Minnekhada Regional Park. On the same day, we saw 3 mothers with 2 cubs each. The photo below is from Minnekhada Regional Park at the beginning of spring.\nBlack bear cub, Minnekhada Regional Park. See my collection on Adobe Stock\nHumpback whale This humpback whale was a real treat for us. We took a day trip to Bowen Island in early May to enjoy a sunny day on the ferry and on the island. After a short walk on the island, we got to a viewpoint and we could hear the blows and there was this whale feeding around the island. We even saw it bubble-net feeding, but this photo is from when it was almost leaving the beach.\nHumpback whale, Howe Sound. See my collection on Adobe Stock\nSteller sea lion They are not usually easy to spot, and we never saw many of them, except for a great spot we found on Bowen Island, BC. We took a day trip there to enjoy the summer once and we heard the noise from far away. There were tens of them on a small fishing pier.\nSteller sea lion, Bowen Island. Get this photo on Adobe Stock\nBeaver It took us more than 4 years to see them. We even thought they were just an urban legend. But on a beautiful day while hiking in Minnekhada Regional Park we saw one in the water. The picture wasn\u0026rsquo;t as good as I expected, but at least we saw one of them.\nBeaver, Minnekhada Regional Park. Get this photo on Adobe Stock\nCoyote I saw a few coyotes around Central Park, but this one was on a sunny day in Iona Beach Regional Park in Vancouver where we just went for a walk. It was a beautiful place for a walk.\nCoyote, Iona Beach Regional Park. Get this photo on Adobe Stock\nEastern gray squirrel These are everywhere, everywhere. Maybe just less everywhere than crows and Canada geese. This specific one was in Central Park, Burnaby, which is a great spot in general.\nEastern gray squirrel, Central Park, Burnaby. See my collection on Adobe Stock\nReptiles Western painted turtle I was surprised to see turtles in the marsh in Minnekhada Regional Park. They are not hard to spot on a sunny day, they are usually just sunbathing on some of the logs in the pond, especially on the left side of the lower pond.\nWestern painted turtle, Minnekhada Regional Park. See my collection on Adobe Stock\nBirds Bald eagle They are majestic. They are not that rare to see, but really hard to take pictures of. They are either flying far away or on a branch too far to capture easily. This one was taken around Minnekhada Regional Park while flying.\nBald eagle, Minnekhada Regional Park. See my collection on Adobe Stock\nGreat blue heron Beautiful birds, especially when flying, as they have a really huge wingspan. They are common around the Vancouver area. I saw this one in Minnekhada Regional Park, but I have seen them in Central Park, Iona Beach and everywhere.\nGreat blue heron, Minnekhada Regional Park. See my collection on Adobe Stock\nRed-breasted sapsucker This one was hitting the park sign. It was making so much noise that from far away I even thought it was people. It just stayed there looking at me and hitting the sign.\nRed-breasted sapsucker, Minnekhada Regional Park. See my collection on Adobe Stock\nRed-winged blackbird I guess this one was the only one that I saw. It was just around Iona Beach Regional Park. Nice birds.\nRed-winged blackbird, Iona Beach Regional Park. Get this photo on Adobe Stock\nBlack-capped chickadee I like their call, it is really easy to identify. This one was taken in Pemberton, but they are everywhere.\nBlack-capped chickadee, Pemberton. See my collection on Adobe Stock\nNorthern shoveler If it wasn\u0026rsquo;t for Merlin, I wouldn\u0026rsquo;t have told this apart from a mallard, but it is a female northern shoveler taken in Minnekhada Regional Park in October.\nFemale Northern Shoveler, Minnekhada Regional Park. See my collection on Adobe Stock\nMallard It is really interesting that the male and female are so different, and in this picture we have both. They are really common, and Central Park is my favorite spot to see them. But these ones are from Minnekhada Regional Park.\nMallard ducks, Minnekhada Regional Park. See my collection on Adobe Stock\nCanada goose Beautiful and super common everywhere. You can really watch them through their whole lifecycle. It is really nice to see the goslings at the beginning of spring. Their young ones are not so pretty, but the really young are nice. This family was photographed on Bowen Island.\nCanada geese and goslings, Bowen Island. See my collection on Adobe Stock\nPileated woodpecker I saw the first one in Central Park, but I didn\u0026rsquo;t get a good picture. This photo was taken in Minnekhada Regional Park in April while it was looking for food in a log.\nPileated woodpecker at Minnekhada Regional Park Get this photo on Adobe Stock\nMost of these photos are on Adobe Stock, as part of my stock photography experiment. If you enjoyed this page, I also have a gallery of the animals we saw on our safari in Kenya and Tanzania.\nCheers.\n","permalink":"https://luizvieira.me/bc-wildlife-photos/","summary":"A growing collection of my photos of the wildlife in British Columbia, from black bears and beavers to bald eagles and herons.","title":"Wildlife of British Columbia Through My Lens"},{"content":"I haven\u0026rsquo;t been posting that much here. I was trying to keep it half professional and half random things that I\u0026rsquo;m interested in, and the work part has been the hardest to write about.\nBut it is not because I have not been productive at work. I have been more productive than ever now with AI, and that is probably the biggest reason I have been writing less.\nToday, a good AI setup can do wonders. It can find the deepest root causes of issues and also do a lot of new work by itself, so while I fix things faster, I don\u0026rsquo;t get the deep understanding that I got before. I get a summary, but I don\u0026rsquo;t go through all the frustration and the phase where you feel proud to have found the solution. Because of that, I don\u0026rsquo;t feel I learned anything meaningful and worth sharing, so I don\u0026rsquo;t write about it.\nI write so I can put my thoughts into structured text and maybe help someone out there. But with so much context change, I also don\u0026rsquo;t have organized thoughts to write about.\nAnother thing is that AI writes so much better than I do, and if I want to give you the best here, it makes more sense to have AI do a lot. But then, it is not my blog anymore, just some other thing that I have little interest in keeping.\nI\u0026rsquo;ve used varying levels of AI on this blog already. I have posts with no AI at all, some posts with minimal proofreading and even one or two that were almost all AI-organized.\nRight now, my thought is that I should only use AI to do mechanical stuff like tagging and organizing, and at most use it to proofread and maybe give me insights, but not to change anything in the text.\nIf I\u0026rsquo;m to be invested and interested in posting, I need to really want to write myself. It will probably not be as good as AI, but it will be my shit, not AI shit.\nI also need to get rid of the idea that all posts are going to be long, complete and really well crafted. I probably need to write smaller, simpler and lower-effort posts instead of waiting for the perfect one.\nThis post is an attempt at doing it. I also felt that I needed to rant a bit, and this is maybe a good outlet for it. I know that probably no one will even read this one, but just ranting already makes it useful.\nCheers.\nPhoto by Markus Winkler on Unsplash.\n","permalink":"https://luizvieira.me/why-ai-made-me-stop-writing/","summary":"AI made me more productive at work and less willing to write here. Why I will keep AI out of my words and write smaller, imperfect posts myself.","title":"Why AI Made Me Stop Writing (and Why I'm Starting Again)"},{"content":"We just did the Spring Boot upgrade from 3.5 to 4.1 in our services, and it was definitely a lot easier than my previous upgrade from Spring Boot 2 to 3. Back in January I wrote a Spring Boot 4 Migration Analysis trying to guess where the pain would be. This is what actually happened.\nA few things made it easier. We didn\u0026rsquo;t have a lot of deprecated libraries like we did last time. Last time we needed to rebuild the auth server, the API server, and a lot more, and I wrote all of it down in a detailed 2.7 to 3.2 migration guide.\nAnother thing that helped was that we were keeping the libraries up to date. Not perfectly on the latest ones, but at least not lagging too far behind, and a lot of that is Dependabot doing the boring part for us.\nWe also had greater test coverage, in unit, integration, and E2E tests. This helped find issues a lot sooner and gave us confidence in the final service.\nExperience from last time also helped, as I knew a bit about what broke before, so it was easier to verify and to think outside the box this time.\nAnd lastly, the biggest change since the previous update was the existence of AI. Since the beginning of this upgrade I went AI first, which allowed me to have a markdown knowledge base of the stack, what should be done, and known issues.\nThe first step I did was to upgrade our core library BOM. While doing that, I started to create a markdown file with the knowledge base.\nAfter the library was upgraded and the tests were passing, I published it locally, chose 3 to 5 of the biggest and most unique services, and went one by one, compiling and fixing the tests.\nFor every learning on that service, AI documented it in the markdown file. So the next service was easier, as we already knew how to fix the issues found in the previous ones. After a few services were done, we had a good enough prompt that could upgrade a service in a few hours.\nLast time I did most of the upgrades myself. This time the owner teams of each service did their own. As we had a shared prompt, their job was easier.\nThe upgrade by the numbers I like numbers, so once the last PR was merged I went back through the tracker to see what the upgrade actually looked like. 33 repositories, 91 pull requests, 70,870 lines changed across 3,970 files, 36 people involved, and 35 days from the first PR to the last merge, with no reverts and no rollbacks.\nFour of those numbers are worth passing on, because they say where the work actually lands.\nWe changed more test code than production code. 29,186 lines of test code against 23,893 of production code. Spring Boot 4 broke our test setup harder than it broke the applications themselves: context loading, Testcontainers initialisers, MockMvc, a few JUnit 4 holdouts and Jackson fixtures. If you are planning your own upgrade, budget for the test suite first. Every one of those breaks was also a problem found before it reached production.\nOnly 15.7% of the churn was build configuration. The version bumps everyone pictures when they hear \u0026ldquo;framework upgrade\u0026rdquo; were the smallest part of the job.\nJackson 2 to Jackson 3 was the real migration. 800 source files moved to the new tools.jackson packages, and it was the only change that produced real fallout after the merge. If you prepare for one thing, prepare for this one.\nLibrary first, then two PRs per repository. Our core library absorbed 20% of the entire churn and shipped on day one, so the 25 services behind it averaged only 2.7 PRs each. Inside each repository, a separate pre-upgrade PR before touching the Spring version kept the median PR at 18 files. We ran the formatter as its own PR too, which sounds like busywork until you see that four of the ten biggest PRs in the whole upgrade were formatting, and none of that noise landed in the diffs people actually had to review.\nThe number that made me think the most was a different one. Two of us touched almost every repository, while 13 of the 36 people touched exactly one. That\u0026rsquo;s a healthy shape, people came in for their own service and left, but it means the end to end context lived in two heads. I did a lot of this, and 36 people did the rest. The test coverage that caught everything was written over years by people nobody was asking to write it.\nSpring Boot 4 also dragged part of the toolchain forward on its own. Most repositories are now on Gradle 9, because the Boot 4.1 BOM asks for it. Separately, we moved tracing from Brave to OpenTelemetry during the same weeks. That was its own piece of work and not something Spring Boot 4 required, but doing both at once meant the services were only disrupted once.\nThe knowledge base and the prompt The knowledge base ended up being the real deliverable of this upgrade, more than any individual service.\nIt settled into two files, and keeping them separate is what made it work. The first is the agent file, the prompt itself, and it has one rule at the top: it may only hold what is reusable when upgrading the next service. Generic tasks, known fixups, the version catalog. Never the state of one particular service. The second is a report file that lives in the repository being upgraded, and that\u0026rsquo;s where everything service specific goes, the pinned versions, the checklist, what broke and what we chose to leave behind.\nThat split is what stopped the prompt from rotting. Every time we learned something, we had to decide which of the two files it belonged in, and the shared one stayed useful precisely because that decision was forced every time.\nBy the end the agent file was around 3,000 lines, with 126 known issues and 15 post-upgrade fixups written down. The instruction that paid off the most was a boring one: before trying to fix a failure, go read the known issues, because someone has probably already hit it.\nIt\u0026rsquo;s also an honest record of what actually broke. 39 of those 126 entries are test infrastructure, things like JUnit, Mockito, WireMock, Testcontainers and the test slices. It is the same story the numbers tell, one failure at a time.\nTwo other things from that file I would keep for the next upgrade:\nA readiness checklist that gets copied into every service report. The same list each time, ticked off per repository. It\u0026rsquo;s what made the tenth service feel like the first one. The agent does not run the tests. Its job ends at a clean compileJava and compileTestJava. Then it stops and asks me to run the suite. Test runs are slow, they spin up containers, and they\u0026rsquo;re exactly the part I want a human watching. So the loop is that the agent fixes, I run, I report back, and we go again. This is the same thing I was getting at in why async agentic AI does not mean free productivity. The agent moves fast, but somebody still has to look. Dependency and configuration changes These are the changes that came up in almost every service. The examples use Gradle Groovy, same as the 2.7 to 3.2 guide.\nRunning OpenRewrite first Most of the mechanical work was done by OpenRewrite, and it\u0026rsquo;s genuinely good at it. A clean rewriteRun is the start of the job though, not the end. Three things to know before you run it:\nUse two recipes. The Spring Boot 4 recipe leaves the Jackson 2 to 3 move half done, so you want UpgradeJackson_2_3 alongside it. It only processes the project it is applied to. On a multi module build, putting the plugin on the root project quietly does nothing for the subprojects. Every module with source to migrate needs the plugin, the recipe and the dependency, and any subtree that the root build excludes from its shared configuration block gets skipped without a word. It doesn\u0026rsquo;t get along with the Gradle configuration cache. rewriteRun fails in about three seconds, before any task actually runs, because the task holds a reference to the project. Run it with --no-configuration-cache. When you are done, delete the plugin, the recipe block and the dependency. That scaffolding should never reach the merged build.\nStarter renames The web starter changed name, so this\nimplementation \u0026#39;org.springframework.boot:spring-boot-starter-web\u0026#39; becomes\nimplementation \u0026#39;org.springframework.boot:spring-boot-starter-webmvc\u0026#39; The OAuth2 starters gained a security- segment, so this\nimplementation \u0026#39;org.springframework.boot:spring-boot-starter-oauth2-client\u0026#39; becomes\nimplementation \u0026#39;org.springframework.boot:spring-boot-starter-security-oauth2-client\u0026#39; The same applies to -oauth2-authorization-server and -oauth2-resource-server. OpenRewrite often misses these, and because the old names no longer exist, a missed one fails at dependency resolution rather than at compile time.\nThe test starters split as well:\nspring-security-test became spring-boot-starter-security-test spring-boot-starter-webmvc-test is new, for the @WebMvcTest slice spring-boot-starter-restclient is needed if you use TestRestTemplate And spring-boot-starter-aop became spring-boot-starter-aspectj. This one is sneaky, because it usually arrives as a runtime transitive from some other library. It compiles fine and only fails when the test or runtime classpath is resolved, so it can hide until you run the suite.\nJackson dependencies Jackson 3 folds jackson-datatype-jsr310 and jackson-datatype-jdk8 into the core, and they are auto registered. OpenRewrite rewrites each of those lines into the same jackson-databind, so you end up declaring it two or three times. This\nimplementation \u0026#39;com.fasterxml.jackson.core:jackson-databind\u0026#39; implementation \u0026#39;com.fasterxml.jackson.datatype:jackson-datatype-jsr310\u0026#39; implementation \u0026#39;com.fasterxml.jackson.datatype:jackson-datatype-jdk8\u0026#39; becomes just this\nimplementation \u0026#39;tools.jackson.core:jackson-databind\u0026#39; plus whatever format modules you actually use, like tools.jackson.dataformat:jackson-dataformat-yaml.\nOne thing to be careful with, do not blanket replace com.fasterxml.jackson with tools.jackson in your imports. Only databind and core moved. The annotations stayed where they were, so this still compiles\nimport com.fasterxml.jackson.annotation.JsonProperty; and the tools.jackson version of it does not exist. Keep jackson-annotations on the 2.x line too, Jackson 3 requires it.\nTestcontainers 2 The module artifacts are prefixed now, so this\ntestImplementation \u0026#39;org.testcontainers:junit-jupiter\u0026#39; testImplementation \u0026#39;org.testcontainers:postgresql\u0026#39; becomes\ntestImplementation \u0026#39;org.testcontainers:testcontainers-junit-jupiter\u0026#39; testImplementation \u0026#39;org.testcontainers:testcontainers-postgresql\u0026#39; Bump the Testcontainers BOM to 2.x in the same change, and do it before you run OpenRewrite. The old BOM only supplies versions for the old names, so the renamed dependencies resolve to an empty version and the recipe fails while building its AST.\nhypersistence-utils If you followed the 2.7 to 3.2 guide you are on the hibernate-63 line. Hibernate 7 needs the 73 one, so this\nimplementation \u0026#39;io.hypersistence:hypersistence-utils-hibernate-63:3.7.3\u0026#39; becomes\nimplementation \u0026#39;io.hypersistence:hypersistence-utils-hibernate-73:3.15.3\u0026#39; Do not trust the recipe here. OpenRewrite picks hibernate-71, which is the Jackson 2 line. It compiles perfectly and then throws AbstractMethodError at runtime.\nSpring Retry moved into the framework Spring Framework 7 absorbed Spring Retry into org.springframework.resilience, and you can drop the explicit org.springframework.retry:spring-retry dependency. OpenRewrite does not migrate this one, so expect cannot find symbol on the old imports. The annotations changed on the way in, so this\n@Retryable(retryFor = EntityNotFoundException.class, maxAttempts = 4, backoff = @Backoff(delay = 500, multiplier = 2)) becomes\n@Retryable(includes = EntityNotFoundException.class, maxRetries = 3, delay = 500, multiplier = 2) @EnableRetry also becomes @EnableResilientMethods. And note the 4 turning into a 3, that is the off-by-one I mentioned above.\nFeign moved from OkHttp to Apache HttpClient 5 Spring Cloud OpenFeign 5 dropped OkHttp. The spring.cloud.openfeign.okhttp.enabled property does not exist anymore, and the only client configuration that ships now is the HttpClient 5 one. If you do not add the new client, Feign falls back to the JDK HttpURLConnection, which cannot do PATCH, and you get this:\nfeign.RetryableException: Invalid HTTP method: PATCH So this\nimplementation \u0026#39;io.github.openfeign:feign-okhttp\u0026#39; becomes\nimplementation \u0026#39;io.github.openfeign:feign-hc5\u0026#39; Keep feign-okhttp only if your own code uses the okhttp3 library directly.\nThe dependency swap is one line, but the new client behaves differently in two ways that took us a while to find, and both of them were latent bugs that OkHttp had been hiding.\nThe response body is one shot now. OkHttp buffered it, so any code that read response.body() twice silently worked. Apache HttpClient 5 gives you a streaming body, and the second read throws StreamClosedException: Stream already closed. The annoying part is where this shows up. It is usually inside an error decoder, while handling a response that already failed, so a second failure about a closed stream ends up masking the real error from the remote service. If you have a custom ErrorDecoder or a response interceptor, read the body once and pass the string around.\nHttpClient 5 retries on its own. Its default retry strategy retries 503 and 429 responses, and IOExceptions, once. That sits on top of whatever retrying Feign is already doing, so every Feign attempt becomes two HTTP requests. We found it because a test asserting an exact number of downstream calls started seeing double, which in production means a struggling dependency gets hit twice as hard right when it is already in trouble. We turned it off so Feign stays the only retry layer:\n@Bean HttpClient5FeignConfiguration.HttpClientBuilderCustomizer disableHc5AutomaticRetries() { return HttpClientBuilder::disableAutomaticRetries; } Configuration properties The error properties moved out of server, so this\nserver: error: include-message: always becomes\nerror: include-message: always And if you use MongoDB, the connection properties split away from the data ones. spring.data.mongodb.uri, .host, .port, .database, .username and .password all became spring.mongodb.*. This one deserves a warning, because the old keys are simply ignored rather than rejected, so the client quietly connects to localhost:27017 instead of where you told it to go. In our case every integration test failed at context load and the stack trace pointed at whatever happened to be listening on that port.\nThere are more, of course. The ones that cost us the most time were all silent like that one: a Kotlin @field: annotation that Jackson 3 no longer reads, a security URL pattern missing its leading slash. Neither fails to compile.\nThe Jackson decisions We decided to make Jackson 3 as lenient as Jackson 2 was, so we would not break on unknown properties.\nMy favorite failure of the whole upgrade came from this. A mapper written as new ObjectMapper().disable(FAIL_ON_UNKNOWN_PROPERTIES) came out of the recipe as new JsonMapper(), with the disable call simply gone, because the Jackson 3 mapper is immutable and can\u0026rsquo;t be configured after it is built. It compiles, it reviews fine, and it fails at runtime on the exact leniency we had decided to keep. That is the kind of thing you only catch with tests.\nJackson 3 changed a handful of defaults, and each one is a small behavior change that only shows up at runtime, with real payloads, in a service you were not looking at. We have been here before on a much smaller scale, when a minor Spring Boot bump broke our object mapper. That one taught me to treat every Jackson default as something worth checking.\nThe builder gives you a configureForJackson2() that restores the whole Jackson 2 set in a single call, and it\u0026rsquo;s tempting. We didn\u0026rsquo;t use it. It also brings back FAIL_ON_UNKNOWN_PROPERTIES, WRITE_DATES_AS_TIMESTAMPS, FAIL_ON_EMPTY_BEANS, one based months and parameter name detection, and we wanted every one of those the Jackson 3 way. Delegating to it would have meant overriding more than it set.\nSo we wrote our own restoreJackson2Defaults instead, in one place, shared by every mapper we build. What it brings back:\nUnknown properties are ignored again. FAIL_ON_UNKNOWN_PROPERTIES stays disabled, so a new field from a producer doesn\u0026rsquo;t break a consumer that hasn\u0026rsquo;t been updated yet. Enums stay on name(). Jackson 3 flipped READ_ENUMS_USING_TO_STRING and WRITE_ENUMS_USING_TO_STRING to on by default, while Jackson 2 used name(). Our event bus speaks name() on the wire, so DAYS and not Days, and during the migration we had producers and consumers on both Jackson versions at the same time. Disabling both is what kept them talking to each other. Trailing tokens are ignored again. Jackson 3 turned FAIL_ON_TRAILING_TOKENS on, while Jackson 2 ignored anything after the first value. Nulls inside collections are skipped again. Jackson 3 rejects null elements in a collection, and EnumSet throws outright. Skipping content nulls means an array with a null entry still deserializes and drops the null, like before. For Kotlin we also had to disable StrictNullChecks on the Kotlin module, because in version 3 it is on by default and its per property contentNulls=FAIL quietly overrides the mapper level setting. Nulls for primitives are tolerated again, by disabling FAIL_ON_NULL_FOR_PRIMITIVES. Properties are not sorted. Jackson 3 turned SORT_PROPERTIES_ALPHABETICALLY on. Months are written as text, through a ToStringSerializer for Month. We deliberately left ONE_BASED_MONTHS alone, because disabling it would make numeric reads zero based and misread every number we have written since the upgrade. On top of that, the shared mapper disables FAIL_ON_INVALID_SUBTYPE and adds a problem handler for unknown enum values, so one value we don\u0026rsquo;t recognize doesn\u0026rsquo;t fail the whole payload.\nThere are also three Jackson 2 defaults we chose not to bring back, because none of them changes what we write:\nUSE_GETTERS_AS_SETTERS makes Jackson add into whatever a getter without a setter returns, so round tripping a derived getter throws UnsupportedOperationException. ALLOW_FINAL_FIELDS_AS_MUTATORS lets inbound JSON overwrite final fields that the constructor computed. STRIP_TRAILING_BIGDECIMAL_ZEROES renders a money value like 10.00 as 1E+1 on the valueToTree path. And one deliberate deviation in the other direction. We keep WRITE_DATES_AS_TIMESTAMPS disabled, so dates stay textual instead of going back to epoch numbers the way Jackson 2 wrote them.\nThe enum decision is the one that deserves the extra attention. It caused the post-merge fallout I mentioned earlier, and the fix had to go into five different repositories.\nThe prompt Here is the prompt I used, with the company specific parts taken out.\nWhat is below is the skeleton, the part that would work in any codebase. The two big sections at the bottom, the known issues and the post-upgrade fixups, are the ones that grew to 126 entries while we worked, and those I cannot share, because every one of them is a description of our code. The template for writing them down is there, though, and honestly the template is the part that matters. Anyone can fill it with their own failures.\n# Agent: spring-boot-4-upgrade ## Purpose Perform the Spring Boot 4 major upgrade for this service. This agent assumes the pre-upgrade preparation (latest Spring Boot 3.5.x, matching Spring Cloud release train, dependency cleanup) has already been completed. This agent file must contain **only information that is reusable when upgrading new services**: generic tasks, known post-upgrade fixups, the shared known-issues knowledge base, and the version catalog. Never record a single service\u0026#39;s upgrade state here. ## Service Report For each service upgraded, produce a report in a **new file in the root of the repository** (e.g. `spring-4-upgrade-report-\u0026lt;service\u0026gt;.md`). This report, not this agent file, is where everything specific to the service lives: the libraries and pinned versions, the readiness checklist, issues found and fixed, internal deprecations noted, and coverage gaps. Before starting, if the pre-upgrade phase left a report file in the repo root, read it first. ## Scope - `build.gradle` / `build.gradle.kts` - `gradle/libs.versions.toml` (version catalog if present) - `settings.gradle` / `settings.gradle.kts` - All source files under `src/` - The service report file in the repo root Do **not** modify: - Internal deprecated code. Note it, but do not replace it. - Production infrastructure or deployment configs. ## Tasks ### 1. Review pre-upgrade notes Read the service\u0026#39;s report file in the repo root, if the pre-upgrade phase created one. Load the pinned versions, the service-specific notes, the internal deprecations noted but not resolved, and any open coverage gaps. Use this as context throughout. ### 2. Add and run OpenRewrite Add to the root build file: ```kotlin plugins { id(\u0026#34;org.openrewrite.rewrite\u0026#34;) version (\u0026#34;latest.release\u0026#34;) } rewrite { activeRecipe(\u0026#34;org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0\u0026#34;) activeRecipe(\u0026#34;org.openrewrite.java.jackson.UpgradeJackson_2_3\u0026#34;) setExportDatatables(true) } dependencies { rewrite(\u0026#34;org.openrewrite.recipe:rewrite-spring:6.33.0\u0026#34;) rewrite(\u0026#34;org.openrewrite.recipe:rewrite-jackson:1.26.0\u0026#34;) } ``` The Spring Boot 4 recipe does not fully migrate Jackson to the `tools.jackson` namespace, which is why the Jackson recipe is there too. **Multi-module builds need more than the block above.** The tasks only process the source sets of the project they are applied to. Applying the plugin to the root project alone does not recurse into subprojects. 1. Declare the plugin on the root build classpath with `apply false`, then apply it per subproject inside `subprojects {}`. 2. In the Kotlin DSL, because the plugin is `apply false`, the type-safe accessors are not generated. Use `configure\u0026lt;org.openrewrite.gradle.RewriteExtension\u0026gt; { ... }` instead of `rewrite { }`, and `\u0026#34;rewrite\u0026#34;(\u0026#34;...\u0026#34;)` instead of `rewrite(\u0026#34;...\u0026#34;)`. The dependency goes in the regular `dependencies {}` block. 3. Watch for subproject trees the root `subprojects {}` block early-returns for. They are silently skipped unless you wire them up in their own build file. Sanity check that `rewriteRun` is registered on a sample of each group. 4. `rewriteRun` is memory heavy: it builds a typed AST for every module in one pass. If the daemon dies with a GC thrashing or OOM error, raise the heap temporarily, then restore it. 5. `rewriteRun` is incompatible with the Gradle configuration cache. It fails in about three seconds, before any task executes, because the task holds a project reference. Run it with `--no-configuration-cache` rather than disabling the cache globally. 6. Bump `testcontainers-bom` to 2.x **before** running the recipe, and apply the artifact renames in the same change. The recipe renames the artifacts but the old BOM only supplies versions for the old names, so they resolve to an empty version and the run fails. Then prompt the user: \u0026gt; Please run: `./gradlew rewriteRun --no-configuration-cache` Wait for confirmation before continuing. After the rewrite is applied and verified, **remove the OpenRewrite block** from the build file. It must not be committed. ### 3. Get compilation clean (do NOT run the test suite yourself) Your responsibility ends at a clean compilation of main and test sources. **Do not run `./gradlew test` or any test-execution task yourself.** Test runs are slow, can spin up containers, and are the user\u0026#39;s to drive. Get these two green: ```bash ./gradlew compileJava ./gradlew compileTestJava ``` - Fix compilation failures caused by the upgrade: package moves, renamed or removed APIs, signature changes, dependency resolution errors. - Before attempting a fix, check the Known Post-Upgrade Fixups and Known Issues sections below. The fix may already be written down. - For each new issue found: if it is reusable across services, add it to Known Issues below. Service-specific details go in the service report file. Once both compile tasks are clean, prompt the user: \u0026gt; Compilation (main + tests) is clean. Please run: `./gradlew test` Wait for the user to run the suite and report back. Then help fix the runtime and assertion failures they surface, consulting the known issues first and recording new reusable findings. Repeat the fix, ask, re-run loop until the user confirms the suite is green. Never run the tests on their behalf. ### 4. Address remaining deprecations Scan for Spring and third-party deprecated APIs not handled by OpenRewrite. Replace where the replacement is safe and straightforward. Do not replace internal deprecated code; note it in the service report instead. ### 5. Update the service report Update the libraries to their post-upgrade versions, add anything discovered that is useful later, and mark the checklist. Reusable findings belong in this agent file instead, so the next service benefits from them. ## Readiness Checklist Copy this into the service report file and check boxes as steps are completed. - [ ] Pre-upgrade notes reviewed - [ ] Formatter plugin updated and applied by the user - [ ] OpenRewrite recipes (Spring Boot 4 + Jackson 2 to 3) added - [ ] `./gradlew rewriteRun` run by the user - [ ] OpenRewrite scaffolding removed, nothing committed - [ ] Build file cleaned: duplicate `jackson-databind` collapsed, orphaned Jackson modules removed, starter renames applied (`web` to `webmvc`, `oauth2-*` gaining a `security-` segment) - [ ] Shared internal libraries bumped to their Spring Boot 4 release line - [ ] Dependencies audited: CVE override pins re-evaluated and removed where the new BOM covers them - [ ] Version catalog updated - [ ] `compileJava` / `compileTestJava` clean; test suite handed to the user, failures then fixed collaboratively - [ ] Known issues documented (reusable ones here, service-specific ones in the report) - [ ] Deprecations addressed or noted - [ ] Coverage gaps identified and documented - [ ] Service report created or updated in the repo root ## Known Post-Upgrade Fixups \u0026gt; Manual fixes that OpenRewrite does not handle automatically. Check these before spending time \u0026gt; debugging. ## Known Issues \u0026gt; One entry per reusable failure. Keep them short enough that scanning the list is faster than \u0026gt; debugging from scratch. ### Template **Affected versions:** the library or recipe version the issue appears on **Symptom:** the error message or observed behavior, as it actually appears **Fix:** what resolved it **Repositories affected:** where it has been seen so far If you take one thing from this post, take the two rules at the top of that file. The agent file only holds what is reusable, and everything about one service goes somewhere else. It sounds like bookkeeping, but it\u0026rsquo;s the reason the prompt was still useful on the thirty-third repository.\nYour services will have their own surprises. What broke for us came from our own mix of libraries, and there are plenty of Spring Boot 4 corners we never touched. But the shape of the work should transfer: the tests break more than the code, Jackson is the long pole, and whatever you learn on the first service is worth writing down while it is still fresh, because you are going to need it on the second one.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-4-upgrade/","summary":"What made our Spring Boot 3.5 to 4.1 upgrade easier than the 2 to 3 one, including the AI-first knowledge base we built and shared across service teams.","title":"Spring Boot 4 Upgrade: Lessons From an AI-First Migration"},{"content":"A few years ago, my wife and I made a list of our top five dream destinations. The goal was simple: make travel decisions easier and focus on places we really wanted to see.\nAlaska was third on my wife\u0026rsquo;s list, mostly because of the landscapes and wildlife. Since we do not love cold weather, we planned this trip for late June. From Vancouver, it is only about a 3.5-hour flight, so we extended a long weekend and turned it into a 5-day trip.\nWe used Anchorage as our base at first, then moved to Moose Pass to be closer to Seward for our cruise day. Our goals were to see moose, maybe bears, and do a marine wildlife tour. Compared to our 9-day Iceland Ring Road trip itinerary in May, this trip was intentionally less packed because we also wanted to rest and relax in nature.\nDay 1: Arrival in Anchorage We landed around noon on Friday, picked up the rental car, and went straight to downtown Anchorage.\nOur first stop was Glacier Brewhouse for lunch. The place has a great atmosphere and a beautiful wooden interior. As someone who really likes clam chowder, I have to say this one was excellent. It was better than versions I had in San Francisco and Seattle, and easily in my top three.\nOur first meal in Alaska at Glacier Brewhouse, where the chowder set a very high bar for the trip.\nAfter lunch, we did practical errands: Costco for bulk items and Carrs for smaller groceries. Since our Airbnb had a kitchen, we stocked up on easy meals we could heat quickly. It saved money and made the trip less stressful.\nDay 2: Moose hunt, musk oxen, and rainy views Day two became our \u0026ldquo;moose hunt\u0026rdquo; day. We first checked Potter Marsh, but it was rainy and not ideal, so we changed plans and kept driving.\nA rainy stop at Potter Marsh before continuing our wildlife search.\nOne of the best stops was the Musk Ox Farm in Palmer. Tickets were USD 16 per person, and the guided visit was very informative. Our guide, Eric, was great and explained a lot about musk ox behavior and habitat. We even saw sandhill cranes there, which was a nice extra.\nMusk Ox Farm in Palmer, one of the most informative stops of the trip.\nFrom there, we drove to Hatcher Pass and Independence Mine. The scenery looked beautiful, but the weather was rainy and very cloudy, so we could not enjoy it as much as we hoped.\nIndependence Mine in Hatcher Pass under rainy weather.\nBack in Anchorage, we checked Ship Creek for salmon, but the run had not started yet. We also did an evening attempt around Kincaid Park and nearby areas. Later, we drove north after Eric shared a few moose spots and saw three females, but still no fully mature bull with large antlers.\nOne of the moose sightings from our day-two wildlife hunt.\nDay 3: Move to Moose Pass and wildlife stops On day three, we changed Airbnb and moved to a cabin in Moose Pass so we could be closer to Seward for the cruise.\nBefore heading fully south, we made a few extra stops around Anchorage, including Ship Creek one more time, Potter Marsh, and Beluga Point. They were fine, but wildlife activity was low when we were there. We did spot a moose at Kincaid Park though, which was a nice bonus before leaving the city.\nA moose sighting around Kincaid Park before we headed toward Seward.\nThe drive toward Seward is beautiful, especially along the coast. On the way, we saw a bald eagle in the wild, which was a first for both of us and a great surprise. We stopped at a viewpoint before reaching the real highlight of the day: the Alaska Wildlife Conservation Center.\nFor wildlife photos on this trip, I used the same setup I described in why I bought a camera for our safari.\nOur first bald eagle sighting in the wild, spotted on the drive south. Available on Adobe Stock.\nViews near Moose Pass on the way to our second stay.\nSeeing moose, brown bears, and wood bison up close was very cool. We always prefer seeing wildlife in the wild, but this was still a great way to learn more and observe animals from a short distance.\nBrown bear at the Alaska Wildlife Conservation Center, one of the highlights before Seward.\nDay 4: Kenai Fjords cruise (best day, hardest day) We left very early for Seward and boarded a 7.5 Hour Kenai Fjords National Park Cruise with Major Marine Tours around 9:30 a.m. We were on a larger boat called Glacier Express.\nOne thing that was helpful was having captain narration throughout the cruise, plus a simple deli lunch included. Since this is a longer route, it also gives the captain more time to search for wildlife and reach glacier areas.\nIf you plan to do this cruise in peak summer, I recommend booking in advance because the popular departures can fill up.\nThe first part was incredible. Right after departure, we saw seals. Less than an hour later, we watched 4 to 5 humpback whales bubble-net feeding together. Birds were circling above, anticipating where the whales would surface. It was one of those moments where everybody on the boat goes silent for a second.\nA group of humpback whales bubble-net feeding together in Kenai Fjords. Available on Adobe Stock.\nThen the rough part started. Once the boat moved into open sea, motion sickness hit us hard. We do not have strong sea legs, and we were not the only ones. Waves were around 10 feet at one point, and around 30% of the boat seemed to be asking for motion sickness bags.\nEven in that state, we managed to spot a few orcas. I got a quick look, while May was already feeling very unwell. Huge credit to the crew, they were calm, helpful, and kind the whole time.\nA quick but memorable orca sighting during rougher waters. Available on Adobe Stock.\nWhen we returned to calmer waters, things got better. We saw puffins, sea otters, and Steller sea lions, then reached the glaciers. Holgate Glacier was our first tidewater glacier up close, and it looked exactly like the giant glacier scenes you see in documentaries.\nThe second glacier, Aialik Glacier, was even larger, and we saw calving. Watching chunks of ice break off and crash into the water was one of the most impressive things of the trip. It felt very different from our Canadian Rockies camping trip, where most glacier views were land-based.\nOne of the glaciers from our Kenai Fjords cruise, where we also saw calving. Available on Adobe Stock.\nBy evening, we were exhausted. We had chowder near Seward that unfortunately was nowhere near as good as day one, then went back to the cabin to rest.\nDay 5: Russian River Falls and one last slow day On the final full day, I hiked Russian River Falls while May drove around looking for wildlife.\nMy main goal was to see salmon jumping, and I did. Watching salmon leap upstream at the falls was a first for me and one of those simple moments that stays with you.\nSalmon jumping upstream near Russian River Falls, one of my favorite moments from day five.\nLater we met again, drove around, and had lunch at Two Brothers. It was arguably our best meal in Alaska, with Glacier Brewhouse still very close in second place.\nLunch at Two Brothers, arguably our best meal of the trip.\nFinal day: Back to Anchorage On the way home, we drove from Seward back to Anchorage, returned the rental car, and flew back to Vancouver.\nOne last scenic drive back to Anchorage before heading home.\nLogistics Rental car For this itinerary, a rental car made a big difference. We rented with Avis from their Midtown location, which is about a 10-minute Uber ride from the airport. Picking it up there rather than at the airport was cheaper, and the ride was quick and easy.\nWe used it every day: city errands, day trips around moose spots, the drive to Moose Pass, and the early morning commute to Seward for the cruise.\nRoad conditions on our route were generally good, and the car gave us flexibility to adjust plans based on weather and wildlife sightings.\nOne thing that surprised us was the price. Our rental car ended up being the most expensive part of the trip, even more expensive than flights and accommodation.\nIf your plan is similar, I would still recommend a car even for a short trip. It gives you much more control over timing and lets you stop when you see wildlife or good viewpoints.\nWhere we stayed (Airbnbs) We split the trip into two Airbnb stays, and that worked really well for balancing convenience and nature.\nAnchorage Airbnb - Cupples Cottage: Practical base for arrival day, groceries, and local driving. Our Anchorage stay, a practical base for the first part of the trip.\nMoose Pass - The Bear Cub Cabin: Better location for Seward and the Kenai Fjords cruise, plus a calmer nature setting. Our Moose Pass cabin, which made early Seward mornings much easier.\nBoth places had a kitchen, and that helped us keep costs under control by combining restaurant meals with simple microwave-ready meals from Costco and Carrs.\nIf I did this route again, I would use the same pattern: Anchorage first, then Moose Pass or Seward for the cruise days.\nWhat went well and what I would do differently Overall, this was a great short trip. We saw many moose, whales, orcas, puffins, otters, sea lions, and a brown bear at the conservation center.\nThe Kenai Fjords cruise was both the best experience and the hardest one because of seasickness.\nIf we go again, I would change a few things:\nTake stronger motion sickness precautions before the cruise. Plan for late summer or early autumn if the main goal is seeing mature bull moose with full antlers. Keep the relaxed pace. It worked really well for this destination. Alaska felt wild, calm, and huge at the same time. Even with some rough weather and rough waters, it gave us exactly what we were hoping for: wildlife, big landscapes, and a memorable reset.\n","permalink":"https://luizvieira.me/alaska-5-day-trip/","summary":"Our 5-day Alaska trip from Anchorage to Seward, with moose spotting, glaciers, a Kenai Fjords cruise, and practical lessons from the road.","title":"5 Days in Alaska: Moose, Glaciers, and a Wildlife Cruise"},{"content":"I already wrote on this blog about How We Manage Money as a Couple. After we defined that system, our financial life became much clearer and less stressful. In this post, I also want to share how we review our finances every month and how this meeting improves not only our financial lives, but our relationship as well. We have been doing this for more than 4 years.\nWe started doing it because money conversations felt much easier when they were regular, predictable, and written down. Also, we did not want money to be an issue in our relationship, so talking about it every month felt like the right way to help.\nOne of the main benefits of both having a document that explains how our finances work and a monthly meeting is that it keeps things explicit and recurring. Keeping it in a document outside both our heads helps us see things clearly without assuming what the other person has in mind about the finances.\nHaving a document is the first step. The second, and most important, is to stay consistent over time. Everything worth doing requires consistency.\nThe Monthly Wrapping Up meeting To help with consistency, we have a monthly meeting. We call it “The Monthly Wrapping Up”, which is a jokingly direct translation from the Portuguese \u0026ldquo;Fechamento do mes\u0026rdquo;.\nA typical meeting is simple: we review the money first, then talk about travel, work, and life, and reflect on the past while planning for the next month.\nWe have a recurring event in our calendar for the last day of the month, which we are always looking forward to for many reasons.\nThe first step in this meeting is to open a bottle of wine. Once the wine is served, we talk about money. The wine idea is to make it more fun, relaxed, and informal. Regardless of whether the month was good or bad, we toast to it. If you don\u0026rsquo;t drink, I would recommend doing something with your drink of choice. Without it, it would just be a boring financial meeting, so the drink brings a lightness to it.\nWe usually open a bottle of wine before talking about money and life.\nThen we sit on the sofa, open the computer, project it on the TV, and get started. How you do this part is up to you. You can do it in the kitchen, in bed, or wherever works best for you.\nThe financial part The order varies a bit, but we usually go through our revenue for that month. Most months it does not change, but sometimes there are bonuses or extra cash that affect our revenue.\nThen we go through the fixed expenses, which are rent, internet, car expenses, etc. This usually does not change much either. If there is something extra or if we are not happy with it, we discuss changes.\nFor example, if one of us gets a bonus or some extra cash, we usually decide together whether it should go more toward investments, travel, or just go through our normal funnel.\nNow that we know the income and expenses, we move to the part that summarizes everything. Our spreadsheet already has all the calculations done based on the fixed percentage we set once a year.\nIn this part, we see how much we will invest that month. After that, we check the travel deposit. We check how much we will save for travel, and we also check how much we have in our travel piggy bank. That allows us to know if and when we can take the next trip or how long it will take to pay for the travels we are planning.\nThe last thing is to look at the amount we each get for our own expenses. That value is then added to our Splitwise group.\nWe also check our investments and how they are doing. We check what we invested last month and how we are tracking against our goals.\nThe life part By the time we finish the money part, we are probably halfway through the wine, and then we move on to the more general life discussion.\nThere is no script here. It usually depends on that month and our perspective on the future. But we usually discuss our travel plans, our plans for life, whether we are happy with our current setup in general, how each of us is doing at work, and what our future looks like.\nI would argue that this is the main part of the meeting, as it has the most impact. After we get money out of the way, deeper subjects come up.\nFor us, it is like monthly couples therapy.\nSummary We have been doing this for more than 4 years, and this meeting has helped us be more aligned financially and in our relationship as well.\nThis is how we do it, and we keep adjusting it to fit our changing lives. You can use this as inspiration for your own meeting or not, but I think having a dedicated time and space where you can talk about money and the relationship is important.\nIf you want to try it, start with one recurring calendar event and one shared document, then adjust from there. The goal is to find whatever works for you, but the recurring nature of the event is important.\nI hope this helps your relationship.\n","permalink":"https://luizvieira.me/the-monthly-wrapping-up/","summary":"How we review our finances each month as a couple, from expenses and investments to travel savings and life planning.","title":"The Monthly Wrapping Up: Our Couple Money and Life Review"},{"content":"If you are looking for a great road trip, Iceland’s Ring Road is hard to beat. We just came back from our first full loop, 9 days and 2,258 km, and I want to share the sights, experiences, and practical tips that stood out.\nOverview map of our full Iceland Ring Road route and major stops across all 9 days.\nIs Iceland expensive? The first thing to know is that Iceland is not a cheap place to visit. Food is expensive, almost double what we pay in Canada. Gas is about 30% more expensive. Flights and hotels were also pricey. Car rental was okay compared to the rest, but get ready to spend.\nWhy we chose May Choosing May was part personal, part strategic.\nThe personal side is that it is when my birthday is.\nThe strategic side is that it is shoulder season, so it is supposed to be cheaper and less crowded than summer months.\nI am not convinced about the \u0026ldquo;cheaper\u0026rdquo; part because we still found everything very expensive.\nThe less crowded part, I do believe. We still saw many people, but there were parking spots at attractions, and it did not feel too crowded, even though a few people commented that it was a bit crowded for shoulder season.\nWe booked hotels two months in advance because we wanted to guarantee places, but I did not find them cheap. It was between 200 and 350 per night, depending on the place.\nIn the end, we agreed that spring may still be better than summer. The best part of summer is the long sunny days, and we definitely missed that because almost all our days were cloudy. But if it had been sunny the whole time, it would have been hard not to get sunburned since there are almost no trees anywhere. Constant sun without shade may not be that comfortable either.\n9-day Iceland Ring Road itinerary Let me break down the itinerary day by day, including the attractions we saw, where we ate, and where we stayed. Hopefully this helps you plan your trip the way you want.\nDay 1: Arrival and Reykjavík We arrived in the morning, close to noon, and used the first day for grocery shopping and exploring Reykjavík. The goal was to get ready for the days ahead while recovering from jet lag, which was +7 hours for us.\nDay 1 in Reykjavík, with the trip easing us into Iceland before the road trip really started.\nKökulist Bakery After a 7-hour flight outside our sleep schedule, and not sleeping very well, we needed coffee to start the day. We stopped at Kökulist Bakery, which was close to the airport and had good options for pastries and other food.\nWe got coffee and a baguette, which was not cheap but really good (we later learned everything was expensive).\nCostco and Bónus After that, we went to Costco to stock up for the trip. We wanted to save money on meals, so we bought food to have two meals in the car. We bought most things at Costco but went to Bónus for smaller items that were not available at Costco.\nStocking up at Costco on day 1 so we could keep breakfasts and lunches simple throughout the road trip.\nHallgrimskirkja After resting a few hours at the hotel, we started our touristy journey. The first stop was the famous Hallgrimskirkja church. It is really beautiful and nicely designed. We did not go inside, only stayed outside.\nHallgrimskirkja from outside, our first iconic stop in Reykjavík.\nDowntown After the church, we explored downtown on foot. We walked to the seaside, to the pond, and along the main streets.\nMostly, we appreciated the design and architecture from outside. The city is really nice, with no tall buildings, which gives it a small-town feel.\nWe strolled around Lake Tjörnin, which was really nice. We saw swans and other birds, and even a guy \u0026ldquo;talking\u0026rdquo; to a swan.\nA calm walk through downtown Reykjavík and around Lake Tjörnin on our arrival day.\nFood: Salka Valka restaurant When looking for a restaurant, May found Salka Valka. She was looking for places with good food and simple options like rice, and this one caught her attention.\nWe wanted a good meal, and I got the fish stew while May got the fish of the day.\nDinner at Salka Valka, where we had one of our first proper meals in Iceland.\nFood: Gaeta Gelato It was cold, but we used the vacation excuse and stopped for gelato at Gaeta Gelato. They had really nice flavors, and I got skyr passion fruit and Oreo.\nCold weather, vacation logic, and a stop at Gaeta Gelato for skyr passion fruit and Oreo.\nStay: Hotel Ísland – Spa \u0026amp; Wellness Hotel We stayed at Hotel Ísland – Spa \u0026amp; Wellness Hotel. The Standard Double Room was really cozy and comfortable. It was good to take a warm shower and rest before the next day.\nOur first stay at Hotel Ísland, a cozy reset before starting longer driving days.\nDay 2: Golden Circle and South Coast This is where the trip really started. With logistics handled, it was time to enjoy it. It was a heavy driving day because we did not follow the full Golden Circle route like many people do. Our priority was Reykjadalur Hot Spring Thermal River.\nDay 2 took us from hot springs to major geothermal sights and a long drive south.\nReykjadalur Hot Spring Thermal River After a well-rested night, our first destination was Reykjadalur Hot Spring Thermal River because we wanted our first hot spring bath.\nIt is a great hike where you can see a lot of things. The first is the view, which is really good. You start seeing Iceland in a very different way.\nIt was the first time we really saw boiling mud, and there was a lot of it. Also, I had never seen a river of hot springs.\nBoiling mud and steam around Reykjadalur, where Iceland’s geothermal energy feels very real.\nThe whole hike is around 9 km. When you reach the halfway point, you get to the hot spring area where you can bathe, which I really recommend. It was great to be in the water after the cold hike. When we went, there were a lot of people in the pools, but there was enough space and we kind of got a private spot for ourselves.\nThe Reykjadalur thermal river after the hike, one of our favorite hot spring experiences of the trip.\nThis was one of the top attractions of the trip.\nThingvellir National Park Our second stop of the day was Thingvellir National Park. We went to Öxarárfoss and walked around a few other attractions.\nWe saw a small waterfall, rock formations, and some scenic landscape that was nice, but nothing extraordinary.\nÖxarárfoss in Thingvellir National Park, a nice stop before the stronger highlights of the day.\nOf all the attractions that day, if we did it again, we would probably skip this one because the others were better.\nGeysir Geothermal Area / Strokkur This was one of the best stops of the trip. Strokkur erupted every few minutes, sometimes twice in a row.\nEach eruption was basically an explosion of water. It did not last long, but it was nice to see the power of the geothermal area.\nStrokkur erupting at the Geysir Geothermal Area, one of the most fun repeated stops to watch.\nThere were also hot springs always boiling around, which were really cool.\nGullfoss (Golden Falls) Gullfoss is a double cascade dropping 32 m, and it was only a 10-minute drive from Geysir. It was super windy on the upper level. The lower level has the best view, and it is really worth it, but be prepared for the wind.\nGullfoss from day 2, with strong wind but incredible views from the lower level.\nFood: Restaurant Kanslarinn We did not have time to go to Selfoss for dinner, so we looked for something in Hella, closer to where we would stay. There were not many options, so we chose Restaurant Kanslarinn.\nWe ordered the lamb steak because it was on sale, and it was really good. Really good. Maybe it was also because it was our first warm meal of the day, but it ended up being the best lamb we ate on the whole trip.\nDinner at Restaurant Kanslarinn in Hella, where we had our favorite lamb of the trip.\nStay: Loa’s Nest Loa’s Nest is located in Hella and has beautiful surroundings, since it is in the middle of the countryside. You can see horses on farms on the way to the hotel and bird nests around the guesthouse.\nIt is a guesthouse, so there is a shared kitchen area and living room. There were quite a few people staying there.\nWhile breakfast was not included, the owners, Unnur and Inke, prepared coffee and waffles for everybody in the kitchen. They were really friendly. We talked a lot with Unnur. She was very kind and even shared a place where we were more likely to see puffins.\nThis was the stay with the best overall experience because of breakfast and the conversation with Unnur and the German couple we shared a table with.\nLoa’s Nest in Hella, where warm waffles and good conversations made this one of our favorite stays.\nDay 3: South Coast Caffeinated and filled with the great waffles prepared by Inke, we headed into day 3.\nDay 3 was all about the South Coast, with waterfalls, cliffs, and a lot of wind.\nSeljalandsfoss We stopped at Seljalandsfoss because it was on the way. I went around the falls, while May did not want to risk it. It is good to have waterproof clothing, otherwise you can get very wet. I got wet from the spray.\nSeljalandsfoss, where going behind the waterfall is worth it if you have waterproof gear.\nSkógafoss Skógafoss is an iconic 62 m waterfall and probably one of the most famous waterfalls in the country. It is really beautiful and huge, and there were even sheep around it, which made it look even better.\nYou can climb up, but it is high and a bit tiring, and some steps are missing, so be careful. The view from above is nice, but the lower view is better, so if you do not go up, do not feel like you missed too much.\nSkógafoss in full force, one of Iceland’s iconic waterfalls and a must-stop on the South Coast.\nSólheimajökull Sólheimajökull is a massive glacier tongue, and it was nice to see a glacier meeting water. It was our first time seeing that. In Alberta, during our Canadian Rockies camping trip, the glacier views we had were mostly land-based.\nSólheimajökull glacier tongue meeting water, a type of glacier view we had not seen before.\nDyrhólaey Lighthouse This was not a good experience because it was super windy. So windy that we had to bend to walk, and it was still hard.\nBecause of the wind, it was very cold. We stayed only a few minutes because it was not worth the suffering.\nOn the other side of the hill, at Kirkjufjara, we saw one puffin, but even with a big zoom lens we could not capture it. We were using the same setup I described in why I bought a camera for our safari.\nReynisfjara Beach Reynisfjara Beach is huge and really nice. The problem was the weather, which did not help, so it was not as beautiful as it would be on a bright blue day.\nWe stayed near Reynisdrangar for a while, resting, appreciating the view, and watching waves hit the rocks. It is really nice to see the water disappear quickly into the rocky beach, and the sound is calming.\nReynisfjara and Reynisdrangar under dramatic weather, still one of the most memorable beaches of the trip.\nFood: The Soup Company After a cold and very windy day, we were looking for something hot to warm our souls, and The Soup Company was a great choice.\nYou can get soup in a bread bowl or a regular bowl, and you also get one free refill. May got lamb soup and creamy broccoli, while I got red hot lava and fish soup. The fish soup was the best.\nA warm stop at The Soup Company in Vík after a windy day on the South Coast.\nStay: Lækjaborgir Guesthouse A bit outside Vík, close to a river, is Lækjaborgir Guesthouse. We got a studio with a private entrance, but unfortunately ours was facing the base of the mountain.\nThe place is very peaceful, and you can hear birds singing. You can also see birds in the river, and there is a sheep farm nearby, so you can watch sheep too.\nThe cabin was really cozy. There was a small kitchenette, which was very useful for coffee in the morning, plus a table and a sofa. The downside is that you can hear noise from the neighboring cabin because they are attached and the sound isolation is not strong.\nOur cozy studio at Lækjaborgir Guesthouse, a peaceful stay near Vík.\nDay 4: Glaciers and Lagoons We were excited for day 4 because it was the first day of the trip with sun. All previous days were cloudy and cold, and in some places very windy, sometimes even rainy.\nAfter coffee, we took our time to enjoy the surroundings. From here, we started to slow down sightseeing, leaving later and arriving at hotels earlier so we could rest and relax.\nDay 4 was the first bright day and brought some of the trip’s most dramatic glacier and lagoon scenery.\nLómagnúpur viewpoint We stopped for pictures at Lómagnúpur viewpoint. It is a nice free stop right beside the road, so it is worth it.\nA quick stop at Lómagnúpur viewpoint, one of those easy roadside views worth pulling over for.\nSkaftafell (Svartifoss) Skaftafell (Svartifoss) is a waterfall framed by basalt columns. It is a 4 km round-trip hike that is moderate because it is a bit steep in the beginning. The falls are unique because of the basalt columns, and it was the first waterfall we saw with this formation.\nSvartifoss in Skaftafell, where the basalt columns make this waterfall stand out from the others.\nHofs Church (Hofskirkja) We did a quick stop at Hofskirkja, one of the last remaining turf churches. It was closed, so we only took pictures from outside.\nHofskirkja, one of Iceland’s remaining turf churches, seen from outside during a quick stop.\nMúlagljúfur Canyon Múlagljúfur Canyon was the best canyon of the trip, and honestly one of the best we have ever visited. The steep cliffs, moss-covered walls, waterfalls, and birds flying around made it special.\nTo the point we went, it was a 5.5 km walk. Steep and hard in some parts, and somewhat slippery, so be careful. But it is totally worth it. If you want to continue hiking, the trail goes farther, but we decided we had already reached the best view. It is also a bit windy because it is high up.\nMúlagljúfur Canyon, one of the most impressive hikes and viewpoints of the entire trip. Available on Adobe Stock.\nIf you do not want to do two hikes, skip Svartifoss and do this one.\nDiamond Beach A bit disappointing. There were one or two ice \u0026ldquo;diamonds\u0026rdquo; on the beach and a lot of people taking photos.\nThe nice part was the icebergs on the other side of the bridge at the lagoon. It was really nice to see them moving in the water. There were birds flying around the icebergs, and I was also able to see harbor seals from far away.\nDiamond Beach and nearby lagoon icebergs, better in motion and atmosphere than in close-up photos.\nFood: Heppa Restaurant We tried to go to Pakkhús, which is supposed to be good, but there was a 45-minute wait, so we went to Heppa Restaurant.\nI got fish soup and a double IPA, while May got a Margherita pizza and an IPA. In the end, it was a better choice because it was cheaper and simpler, the way we like it.\nA practical and tasty dinner at Heppa Restaurant after skipping the longer wait at Pakkhús.\nStay: Höfn Inn Guesthouse We had a spacious Standard Double Room with a private bathroom, but the floor was a bit weird at first because it imitates a rocky black-sand-beach texture.\nThe room was not very dark, so sleep masks are essential. Also, because it is in the middle of town, you can hear car noise.\nOur stay at Höfn Inn Guesthouse in town, spacious and convenient before the Eastfjords drive.\nDay 5: Eastfjords Day 5 involved a lot of driving and fewer stops. The good part is that the drive is incredibly scenic, with cliffs on one side and the sea on the other.\nAnother nice thing was seeing wild reindeer, which were beautiful and different from the ones we see in Canada.\nDay 5 was mostly a scenic driving day through the Eastfjords, with a few memorable stops.\nViking Village (Film Set) A few minutes after Höfn, there is Viking Cafe \u0026amp; Guesthouse, where there is a fake Viking village built as a film set for a movie that was never filmed. It is a paid attraction, but since we did not have much to see that day, we decided to stop. It was nice and worth the price.\nThe Viking village film set near Höfn, a fun paid stop on a lighter sightseeing day.\nIt is also a good place to see Vestrahorn Mountain with reflections in the water and black sand.\nVestrahorn views with black sand and reflections, one of the best landscapes on day 5. Available on Adobe Stock.\nFauskasandur We stopped at Fauskasandur, but it is mostly rock formations. It is fine to stretch your legs, but almost any other stop would do the same.\nFood: Lúna Bakery Since we had driven a lot and still had more ahead, we looked for a bakery in Egilsstaðir and chose Lúna Bakery. Simple bakery, good coffee, and a really good brownie.\nHafnarhólmi This was a big detour from our original plan while we were staying in Seyðisfjörður.\nHafnarhólmi is a one-hour drive from Egilsstaðir, and we went there to look for puffins. It was a recommendation from Unnur at Loa’s Nest, and since we had not really seen puffins until then, we decided on this 2-hour detour from our original plans.\nIt was really worth it. It was a great experience because there were many puffins and we could watch them for a while. It was really fun to see how they fly, land, and interact with each other.\nHafnarhólmi, where the puffin detour paid off with one of the trip\u0026rsquo;s best wildlife moments. See more on Adobe Stock.\nIt was definitely one of the highlights of the trip and one of the benefits of going in May.\nStay: Snæfell - Hotel by Aldan We got a double room at Snæfell - Hotel by Aldan, which is a charming old hotel in the surroundings of a lake.\nThe hotel has a shared kitchen, which may be useful for cooking or warming food. They also sell a few items there, which helps because the town supermarket closes at 6 PM.\nSnæfell - Hotel by Aldan, our charming stay in Seyðisfjörður with practical shared kitchen space.\nDay 6: Moving North Since we were in the easternmost part of the island, it was time to start heading back west through the north.\nThe area is remote, with fewer tourist attractions, but the ones that exist are really nice.\nDay 6 took us through the remote north, where the drive mattered as much as the stops.\nStuðlagil Canyon Different from the previous canyon we visited, Stuðlagil is a basalt-column canyon.\nYou can stop on both sides of the canyon, but the famous view is only accessible from the side where you need to hike.\nWe stopped on the east side, which is the wrong side if you want the main iconic view. The east side is more prepared with walkways and good viewpoints, but you do not get the famous angle.\nFor that, you need to go to the west side, near Stuðlafoss Waterfall. From there, you do a 5 km hike down to the canyon. It is beautiful, and you can get the classic photo at the most photogenic spot.\nStuðlagil Canyon and its basalt walls, a striking stop while moving north.\nOn the way there, you may see many geese and also farms with sheep and lambs, which is nice.\nDettifoss The last stop of the day was Dettifoss. It is another beautiful waterfall. It is supposed to be Europe’s most powerful waterfall, but it felt similar to other falls we had already seen.\nDettifoss, often called Europe’s most powerful waterfall, reached at the end of day 6.\nFood: Gamli Bærinn As with almost everywhere on the trip, there were not many dining options. While looking for a place to eat in Mývatn, we found Gamli Bærinn.\nWe got the all-you-can-eat soup and bread buffet, grabbed some beers, and had a good time.\nSimple comfort food at Gamli Bærinn after a long driving and waterfall day.\nStay: Mývatn - Berjaya Iceland Hotels Our fanciest hotel up to that point was Mývatn - Berjaya Iceland Hotels. It was also the only place where we stayed two nights, since we wanted to rest and relax.\nThey had hot tubs, and we stayed there relaxing. The hot tubs are geothermal, and you can smell the sulfur. It was very relaxing, and we enjoyed it a lot.\nOur two-night stay at Mývatn - Berjaya Iceland Hotels, with geothermal hot tubs for recovery.\nDay 7: Mývatn Exploration Since we stayed in the same place on day 7 as day 6, this day was all about exploring Mývatn and relaxing.\nDay 7 was a slower exploration day around Mývatn, with geothermal scenery and a bit more rest.\nNámafjall Hverir Viewpoint A very geothermally active place. There are many boiling mud pools and steam vents. It is a great place to see geothermal power up close. The downside is that parking was more expensive than average and there was no washroom.\nNámafjall Hverir, where boiling mud pools and steam vents show Iceland’s geothermal core.\nViti Crater We tried to go to Viti Crater, but it was so foggy that nothing was visible. It also looked frozen, so we would not have seen the blue water anyway.\nHverfjall Hverfell Hiking Hverfell was really nice. It is a hike of less than 5 km, and you go up and walk around the whole crater rim. It is a bit windy, but the view is great. It is also a stereotypical volcano shape, which makes you really feel like you are on a volcano.\nHverfjall (Hverfell) crater rim hike, windy but with great volcanic views.\nGrjótagjá Grjótagjá is a thermal water-filled cave. The water is really blue, and it is a good spot for pictures (if you are patient waiting for people to move). Unfortunately, bathing is not allowed.\nGrjótagjá’s blue thermal cave water, one of the most photogenic quick stops in the Mývatn area.\nGeosea - Geothermal Sea Baths May pointed out that we were already 7 days into Iceland and had only gone to a hot spring once, so we started looking for more options. We wanted free ones, but there were none nearby.\nBecause Forest Lagoon and Mývatn Nature Baths were temporarily unavailable for our timing, the closest option we found was Geosea - Geothermal Sea Baths, which required a 45-minute drive.\nIt was not cheap, but it was nice to relax in warm water with a sea view. The weather was mostly cloudy, which made the hot spring mood even better. We could see whale-watching boats, and we even saw signs of a whale from far away.\nGeosea - Geothermal Sea Baths, a relaxing detour with warm water and ocean views.\nDay 8: North to Troll Peninsula At this point, we became more selective about stops because we were getting tired after many days on the road. We had also seen many similar attractions, so some places started to feel like \u0026ldquo;just one more waterfall.\u0026rdquo;\nIt was also a day with a good amount of driving, so we kept stops limited.\nDay 8 was another long driving day, with a few practical stops and fewer big attractions.\nGoðafoss Waterfall At the Waterfall of the Gods, we stopped for the view. It was a good stop, and parking was free, so there was nothing to lose. The view was nice, but nothing exceptional.\nGoðafoss, an easy and worthwhile free stop during a long day of driving.\nFood: Nesti Ferskt og fljótt Weirdly, the best stop of the day was at a gas station/bus stop.\nUntil then, we had not eaten the famous Icelandic hot dogs, the pylsur, so a bus stop felt like the perfect place to try them.\nWe got the pylsur with egg and bacon, which was good. The plain pylsur alone is nothing too exciting, but the egg and bacon made it much better.\nPylsur stop at Nesti, where egg and bacon made Iceland’s famous hot dog much better.\nDeildartunguhver A 20-minute stop from the hotel. It was nice to see the boiling water, but nothing special. It was not that worth it for us because we had already seen better geothermal spots.\nDeildartunguhver, a quick geothermal stop near the hotel before the final day.\nStay: Bifrost Hotel The Double Room at Bifrost Hotel was very spacious, the most spacious on our whole trip.\nIt was also the first hotel where breakfast was included, and it was a good breakfast.\nThe downside was that the washroom was a bit dark and the Wi-Fi did not work in the room.\nStill, it had the best cost-benefit of the whole trip.\nBifröst Hotel offered our best cost-benefit stay, with a spacious room and solid breakfast.\nDay 9: Final Soaks and Rest On the last day, we drove back, visited a few final spots, and had one last soak.\nDay 9 closed the loop with a few final stops, a hot soak, and the drive back to Keflavík.\nGrábrók Grábrók was a short mountain peak visit very close to the hotel. It was nice to stretch our legs after breakfast and see the surrounding views.\nA short walk up Grábrók for final-day views and a good leg stretch before driving back.\nBridge Between Continents Since we were in a place where two tectonic plates divide, we decided to visit the symbolic Bridge Between Continents. It is a quick photo stop: nice, but very simple.\nBridge Between Continents, a symbolic tectonic-plate stop near the end of the trip.\nReykjanes Lighthouse We tried to see Reykjanes Lighthouse, but it was a very rainy and windy day, so it was uncomfortable to be outside the car.\nReykjanes Lighthouse in rough weather, one of those stops better in better conditions.\nIt was hard to see anything and hard to stay outside. Same for Gunnuhver: we stopped quickly but did not stay long.\nBlue Lagoon We already had tickets for Blue Lagoon because we bought them well in advance, so despite the rainy and windy day, we went.\nThe view from the lagoon was really nice with that dramatic weather, but the experience would have been better without the wind.\nWe stayed for more than two hours, since it was good to stay warm and we had the face masks and one drink included. There was kind of a cave area inside where you could escape from the cold wind.\nBlue Lagoon on a windy day, expensive but still worth it for the full spa experience.\nDespite being very expensive, the blue water and the full spa experience made it worth it.\nFood: Oriento Middle East When looking for something to eat in Keflavík, we chose Oriento Middle East because it looked like it had good options and we wanted to eat meat (we were tired of bread and carbs).\nWe got kebab, which was good but not excellent. It is hard to find truly excellent food that is not super expensive.\nDinner at Oriento Middle East in Keflavík before our final night in Iceland.\nStay: Keflavik Micro Suites Our last stay was at Keflavik Micro Suites, a comfortable room in town. They even left a complimentary light breakfast, which helped for the next day’s return.\nFinal-night stay at Keflavik Micro Suites, comfortable and practical before the return flight.\nIt was also the last chance to shower in geothermal water, which is something I miss. The water was really nice, and you kind of start liking the smell.\nPractical tips for Iceland in May Meals and restaurants We did not want to spend too much money eating out during the trip, and we also did not want to spend restaurant time that could be used for attractions.\nSo we bought groceries on the first day for almost the whole trip. The plan was to have breakfast and lunch in the car, then maybe have a proper sit-down dinner if we found interesting places that were not too expensive.\nOn some days, we skipped restaurant dinners and made our own meals.\nWe only got breakfast in one hotel. For all the others, we made it ourselves.\nWe bought bread, skyr, whey protein, bananas, ham, lettuce, tomato, mayo, salt, etc.\nBut if you plan to eat out, be prepared to spend. Menus in Iceland are not very creative. You can find fish and chips in almost any city. Another very common dish is lamb chops or steak, and Atlantic char prepared in different ways.\nAnother very common thing is soup. Icelandic lamb soup is almost everywhere.\nWe tried to look for dishes that included rice or less fast-food-style options (without fries), but it was not that easy, or the prices were too high.\nBest things on the trip The best thing overall is the landscape. It is beautiful all around the island. You get views with cliffs on one side, golden grass everywhere, sheep and horses in pastures, and the sea on the other side.\nWhen I said it was perfect for a road trip, I meant you get great views almost the whole way around.\nAlso, attractions are usually close to the road, which makes access easy. While you need to pay for parking at almost all major attractions, they usually have washrooms, so it is easier to stay hydrated.\nSeeing such a volcanic place is really cool. While we saw a few volcanic things on our Hawaii Big Island trip, we did not see boiling mud pools there. In Iceland, the number of hot springs is amazing.\nGas stations One thing people online scare you about is the lack of gas stations in some regions, especially in the east. While it is true that they are more spread out there, there were more than I expected.\nBecause we were concerned, we always refueled around half a tank, so it was never a problem for us. You do need to be mindful and not wait until almost empty, but it is not as bad as some people make it sound.\nThe simple app Bensin shows all gas stations in the country and prices, so if you want to plan ahead, you can use it to check nearby stations.\nParking Finding parking in May was not hard. The only issue is that parking is paid almost everywhere. Prices are usually around 1,000 kr, with some as low as 750 kr and others up to 1,400 kr.\nThe good part is that most places have washrooms, so you get a bit more value from the parking price.\nTo pay, many places have a payment totem, which is better because there is no additional app fee. If you want to pay in an app, Parka is the most common and the one we used. It has a small fee, but you need it for places without totems (smaller attractions).\nWeather in May People say Icelandic weather is unpredictable and changes fast, and May is especially one of those months.\nDuring our trip, we got almost everything: rain, wind, cloudy days, sun, cold, etc. We just did not get snow.\nThe most common condition was cloudy weather. Only one day was sunny, and the other 8 were cloudy. There were two very windy days that made sightseeing hard, but the rest were manageable.\nRain was usually very light and did not bother much. The wind was the worst part.\nCar rental Car rental was not that expensive compared to everything else, including food. We got a mid-size SUV from Budget. They tried to give us a compact SUV even though we had booked a mid-size, but we pushed for the correct class (they said the other one was also mid-size, but a quick Google search said otherwise). We got a Hyundai Tucson, which is a great car for the road. It was a plug-in hybrid, but none of the chargers we found fit, so we ended up using only gas.\nPhotography from this trip All the photos in this post were taken with a Canon EOS R7. If you want to use any of these images, you can browse the full Iceland collection on Adobe Stock to license them and support future travels.\n","permalink":"https://luizvieira.me/iceland-ring-road-roadtrip/","summary":"A 9-day Iceland Ring Road itinerary in May, with daily stops, hotels, meals, costs, weather, and practical tips from our first full loop around the island.","title":"9 day Iceland Ring Road trip itinerary in May"},{"content":"Timeout misconfiguration worries me, and despite being aware of it, when we were developing a new service, we set up many timeouts but forgot an important one. This tale is about that mistake.\nMy experience until now has been mostly with PostgreSQL. While I\u0026rsquo;ve used MongoDB before, I hadn\u0026rsquo;t set up a service from scratch with comprehensive configurations.\nOur MongoDB Timeout Configuration When creating this new service, I tried to establish the best MongoDB configuration possible. We focused not just on timeouts but also on improving observability with Spring Data, adding several timeouts: connect timeout, read timeout, server selection timeout, and configuring the connection pool (size, wait time, idle time, etc.), along with write and read concerns. Here\u0026rsquo;s the code (with hardcoded values for simplicity):\n@Override @Bean @NonNull public MongoClientSettings mongoClientSettings(String connection) { MongoClientSettings.Builder builder = MongoClientSettings.builder() .uuidRepresentation(UuidRepresentation.STANDARD) .applyConnectionString(new ConnectionString(connection)) .applyToConnectionPoolSettings(b -\u0026gt; b.maxSize(50) .minSize(5) .maxWaitTime(Duration.ofMillis(2000).toMillis(), TimeUnit.MILLISECONDS) .maxConnectionIdleTime( Duration.ofMinutes(30).toMillis(), TimeUnit.MILLISECONDS) .maxConnectionLifeTime( Duration.ofMinutes(30).toMillis(), TimeUnit.MILLISECONDS) .addConnectionPoolListener(new MongoMetricsConnectionPoolListener(meterRegistry))) .applyToSocketSettings(b -\u0026gt; b.connectTimeout( Math.toIntExact(Duration.ofSeconds(5) .toMillis()), TimeUnit.MILLISECONDS) .readTimeout( Math.toIntExact(Duration.ofSeconds(10) .toMillis()), TimeUnit.MILLISECONDS)) .applyToClusterSettings(b -\u0026gt; b.serverSelectionTimeout( Duration.ofSeconds(5) .toMillis(), TimeUnit.MILLISECONDS)) .retryReads(true) .retryWrites(true) .addCommandListener(new MongoMetricsCommandListener(meterRegistry)) .addCommandListener(new MongoObservationCommandListener( observationRegistry, null, new SanitizingMongoObservationConvention())) .contextProvider(ContextProviderFactory.create(observationRegistry)); if (customProperties.getConsistency().getReadConcern() != null) { builder.readConcern(ReadConcern.LOCAL); } if (customProperties.getConsistency().getWriteConcern() != null) { builder.writeConcern(WriteConcern.MAJORITY.withWTimeout(Duration.ofSeconds(10).toMillis(), TimeUnit.MILLISECONDS)); } return builder.build(); } The Missing Server-Side Timeout I thought we were covered with all the timeouts, but I was surprised when investigating some incidents and checking the Query Profiler in MongoDB Atlas UI.\nQuery Profiler in MongoDB Atlas showing the query that ran for over 14 hours on the server side\nDespite having a read timeout of 10 seconds, the application received the exception and handled it correctly. However, the query continued running on the server side and took more than 14 hours as it scanned the entire collection.\nWhat we missed was a timeout to limit server-side processing.\nSetting a Server-Side Timeout This can be done in a few ways. The simplest is something like this:\nMongoClientSettings.Builder builder = MongoClientSettings.builder() ... .timeout(Duration.ofMinutes(10).toMillis(), TimeUnit.MILLISECONDS) ... return builder.build(); The downside is that this timeout applies to all queries, including migrations when using Mongock as a migration library helper.\nAnother approach is to define the timeout on individual queries, giving you more granular control.\nWhat we did was set a high value globally just to prevent server-side execution from running indefinitely on longer queries. Since most queries would fail due to the readTimeout anyway, this seemed like a reasonable safety net.\nWith this in place, we hope to avoid those excessively long-running queries in the future.\nIn another post, I wrote about why our JPA delete queries were not batching.\nCheers.\n","permalink":"https://luizvieira.me/mongodb-server-timeout/","summary":"Discovered why a query ran for 14 hours on MongoDB server despite client timeout: missing server-side timeout configuration. Solutions for MongoClientSettings.","title":"MongoDB Server Timeout: When Client Timeouts Aren't Enough"},{"content":"It has been four years since I started at FISPAN. As part of a FISPAN tradition, when you reach four years at the company, you receive a coffee table book signed with messages from your team and other people you know at the company.\nAccording to our CEO, the idea is that family members, and maybe even your children many years from now, can open the book and read the messages from coworkers. They will see how much of a difference their parent made at the company and in other people\u0026rsquo;s lives.\nIt is a really nice idea, because the team has to actually know the colleague well enough to choose a coffee table book that matches their interests. Everyone\u0026rsquo;s book is different. It is also a form of formal recognition, because people write what they think of you and why they enjoy working with you.\nReceiving this book and reading the messages left by my friends prompted me to reflect and write this post. We sometimes think that work is just work, and there is nothing wrong with that, but when we are at work we are interacting with other people for a long time. Making work a better place is up to all of us, and little gestures like this definitely make the work environment a lot better.\nMy team\u0026rsquo;s choice of book for me was kind of unexpected. My book is about simple recipes from a famous chef.\nI am not entirely sure why they chose it. Maybe they think I like cooking (I kind of do, but only on weekends). It is probably more because I usually bring the same food from home every single day for almost the whole year. I guess it is their way of telling me I need to learn how to cook new dishes. And that is the spirit that I like.\nI actually like the book more than I initially expected. As you can see in this blog, I love travelling and have written about adventures like my safari in Africa, so I would have guessed they would pick a travel coffee table book. But a recipe book is actually more interesting, because my travel choices are already very thoughtful, while I am always struggling to come up with healthy and varied meals to cook on weekends with my family. The Pillars of Health framework I follow emphasizes nutrition, and learning to cook new dishes from this book is a direct way to improve that pillar.\nBut the most important part of the book is not the recipes themselves. It is the messages from my colleagues. From what they wrote, it seems people enjoy working with me because I laugh a lot and help make the work environment a bit lighter and more fun.\nHighlights from the Messages Reading through the messages, it is clear the team sees me as a mix of a \u0026ldquo;Spring wizard\u0026rdquo; and the office\u0026rsquo;s \u0026ldquo;best troll.\u0026rdquo; They describe a high-impact engineer who acts as a \u0026ldquo;security savior\u0026rdquo; and prioritizes quality and reliability (while apparently deleting code faster than I write it). Beyond the technical skills, the messages highlight a warm and positive presence that keeps the atmosphere light, whether I am answering \u0026ldquo;dumb backend questions\u0026rdquo; or leading the charge during an incident call. It is humbling to see that my colleagues value me not just for the problems I solve, but for the laughter and energy I bring to the office every day.\nA Few Highlights:\nThe Technical Magician: One colleague praised my \u0026ldquo;wizardcraft\u0026rdquo; with Spring Boot, while another noted that seeing me typing in the incident channel gives the team an immediate sense of confidence during a crisis.\nThe Culture Catalyst: The frequent mentions of \u0026ldquo;scarecrow jokes,\u0026rdquo; \u0026ldquo;Pokey Okey\u0026rdquo; lunch runs, and being a \u0026ldquo;wonderful friend\u0026rdquo; show that my impact goes beyond the code, helping to make the work environment a bit friendlier and more vibrant.\nRecipes I\u0026rsquo;ve Cooked The book that I got was the Ottolenghi Simple, which is a collection of recipes from the famous chef Yotam Ottolenghi. The book is really nice. I was surprised to see how many ingredients I never knew about. For example, harissa, tahini, or even pine nuts that I had never used.\nOttolenghi Simple - the cookbook my team gave me\nSo the fun process started with the research and the shopping. I had to find the ingredients, which was a fun way to discover new products and new stores. I also had to learn how to cook the dishes, which was a fun way to improve my cooking skills and try new recipes.\nLamb siniyah This was the first recipe I cooked from the book. It is a lamb dish with a lot of spices and flavors. It had a very unique taste that I was not used to, so I really enjoyed it. I may have ended up adding too much lemon, so it was a bit strong, but from all the recipes I cooked, this was the one that I enjoyed the most. I will definitely cook it again. But one thing it was not: simple.\nLamb siniyah - my favorite recipe from the book\nHarissa beef sirloin \u0026amp; roasted asparagus Here I did two recipes together, both were easy to cook.\nThe harissa beef sirloin with pepper and lemon sauce had the new taste of harissa which I had never tried before. It was a bit spicy but I really enjoyed it.\nThe other was roasted asparagus with almonds, capers, and dill. I have never used capers before, and I really liked them. I even started putting capers on other dishes now. It is a really nice ingredient that adds a lot of flavor.\nHarissa beef sirloin with roasted asparagus\nCoconut-crusted fish fingers \u0026amp; Chickpea and swiss chard I never thought about combining coconut with fish, but it gave a good taste. The chickpea and swiss chard was also really good. It is a simple dish, but it has a lot of flavor.\nCoconut-crusted fish fingers and chickpea and swiss chard\nOrzo with shrimp, tomato, and marinated feta I never knew there was a pasta that looked like rice. It was not that great actually. I didn\u0026rsquo;t like the consistency of it. But it was a good experience. The best was the shrimp which I bought and peeled myself.\nOrzo with shrimp, tomato, and marinated feta\nWhy This Matters I guess this post is really about how companies can celebrate and thank people in a very personal way. Every message in the book is targeted specifically to the person being celebrated, which makes it meaningful.\nNowadays, staying at a company for years is not as common as it used to be. So in a way it is a kind of trophy for loyalty, resilience, or maybe just stubbornness.\nEither way, I enjoy my book and I will use it for cooking. I will also read the messages from time to time to remind myself of the impact I am having during my working hours.\nI also wrote about the positive points of working from the office or from home and leadership lessons from Ted Lasso.\nCheers to many more years at FISPAN!\n","permalink":"https://luizvieira.me/4-years-fispan/","summary":"Reflecting on four years at FISPAN. A company milestone marked by a personalized coffee table book and heartfelt messages from colleagues.","title":"Four Years at FISPAN: A Coffee Table Book of Messages"},{"content":"In a new service that I am working on, we are using MongoDB. Since I am much more familiar with PostgreSQL, I found myself missing some information in the observability spans we were getting from MongoDB.\nWe are using MongoDB with Spring Data, and by adding a command listener to the MongoDB configuration, we were able to capture spans for database operations. Good observability is equally critical regardless of which database you use. Whether you\u0026rsquo;re troubleshooting PostgreSQL performance issues or optimizing MongoDB queries, the same principles apply. We could tell whether an operation was an insert, update, or delete, and which entity it was related to.\nThe problem was that the spans did not include enough detail. For example, when a query operation was slow, it was hard to tell which method had triggered it. The span also did not show the query being executed. So while we had enough observability to measure duration, we still could not pinpoint which method was taking a long time or which field the query was filtering on. This is exactly the kind of problem that good observability solves: being able to see query structure in your spans lets you identify bottlenecks without relying on slow, reactive debugging.\nTo improve that, we created a custom observation convention and registered it in the MongoDB configuration. These were the two important pieces.\n1. Registering the custom observation listener The first step was wiring the custom convention into the MongoDB client configuration:\n.addCommandListener(new MongoObservationCommandListener( observationRegistry, null, new SanitizingMongoObservationConvention())) This is the key part. Once this listener is added, Spring Data MongoDB starts producing spans enriched by our custom convention.\n2. Adding sanitized query details to the span The convention adds a db.statement attribute with the query shape, while hiding the actual values:\nclass SanitizingMongoObservationConvention implements MongoHandlerObservationConvention { private static final String DB_STATEMENT_KEY = \u0026#34;db.statement\u0026#34;; @Override public @NotNull KeyValues getHighCardinalityKeyValues(@NotNull MongoHandlerContext context) { try { return KeyValues.of( DB_STATEMENT_KEY, buildStatement(context.getCommandStartedEvent().getCommand())); } catch (RuntimeException e) { return KeyValues.of(DB_STATEMENT_KEY, \u0026#34;?\u0026#34;); } } @Override public String getContextualName(MongoHandlerContext context) { var collectionName = context.getCollectionName(); var commandName = context.getCommandStartedEvent().getCommandName(); if (ObjectUtils.isEmpty(collectionName)) { return commandName; } return collectionName + \u0026#34;.\u0026#34; + commandName; } } Two details made the biggest difference for us:\ndb.statement now contains useful query information for tracing. getContextualName() makes spans easier to read by naming them as collection.operation. The sanitization happens when building the statement:\n/** * Builds a statement string from a MongoDB command by extracting only the keys * relevant for query debugging. Fields are fetched by name — never via entrySet() — * to avoid materializing the full ByteBufBsonDocument byte buffer. */ private static String buildStatement(BsonDocument cmd) { var result = new BsonDocument(); // find / count / distinct / findAndModify / delete filter appendSanitizedFilter(result, \u0026#34;filter\u0026#34;, cmd.get(\u0026#34;filter\u0026#34;)); // update filter (first element of updates array) var updates = cmd.getArray(\u0026#34;updates\u0026#34;, null); if (updates != null \u0026amp;\u0026amp; !updates.isEmpty() \u0026amp;\u0026amp; updates.getFirst() instanceof BsonDocument firstUpdate) { appendSanitizedFilter(result, \u0026#34;q\u0026#34;, firstUpdate.get(\u0026#34;q\u0026#34;)); } // aggregate pipeline var pipeline = cmd.getArray(\u0026#34;pipeline\u0026#34;, null); if (pipeline != null) { result.put(\u0026#34;pipeline\u0026#34;, sanitizePipeline(pipeline)); } // query behaviour — safe to expose verbatim appendIfPresent(result, \u0026#34;sort\u0026#34;, cmd.get(\u0026#34;sort\u0026#34;)); appendIfPresent(result, \u0026#34;limit\u0026#34;, cmd.get(\u0026#34;limit\u0026#34;)); appendIfPresent(result, \u0026#34;skip\u0026#34;, cmd.get(\u0026#34;skip\u0026#34;)); appendIfPresent(result, \u0026#34;$db\u0026#34;, cmd.get(\u0026#34;$db\u0026#34;)); return result.toJson(); } /** Appends a filter document with all leaf values replaced by {@code ?}. */ private static void appendSanitizedFilter(BsonDocument result, String key, BsonValue value) { if (value instanceof BsonDocument filter) { result.put(key, sanitizeFilterValues(filter)); } } private static void appendIfPresent(BsonDocument result, String key, BsonValue value) { if (value != null) { result.put(key, value); } } /** * Sanitizes an aggregation pipeline array. Safe stages ({@code $sort}, {@code $limit}, * {@code $skip}, {@code $count}) are kept verbatim. {@code $match} values are sanitized * like a filter. All other stages expose only the operator name with {@code ?} as the value. */ private static BsonArray sanitizePipeline(BsonArray pipeline) { var result = new BsonArray(); for (var element : pipeline) { if (!(element instanceof BsonDocument stage)) { continue; } var sanitized = new BsonDocument(); for (var entry : stage.entrySet()) { var op = entry.getKey(); var value = entry.getValue(); sanitized.put( op, switch (op) { case \u0026#34;$sort\u0026#34;, \u0026#34;$limit\u0026#34;, \u0026#34;$skip\u0026#34;, \u0026#34;$count\u0026#34; -\u0026gt; value; case \u0026#34;$match\u0026#34; -\u0026gt; value instanceof BsonDocument filter ? sanitizeFilterValues(filter) : new BsonString(\u0026#34;?\u0026#34;); default -\u0026gt; new BsonString(\u0026#34;?\u0026#34;); }); } result.add(sanitized); } return result; } /** Recursively replaces all leaf values in a filter document with {@code ?}. */ private static BsonDocument sanitizeFilterValues(BsonDocument doc) { var result = new BsonDocument(); for (var entry : doc.entrySet()) { var value = entry.getValue(); result.put( entry.getKey(), value instanceof BsonDocument nested ? sanitizeFilterValues(nested) : new BsonString(\u0026#34;?\u0026#34;)); } return result; } That gave us spans with enough information to understand the query structure without leaking sensitive data. A statement like this:\n{\u0026#34;filter\u0026#34;:{\u0026#34;stockId\u0026#34;:\u0026#34;123\u0026#34;,\u0026#34;syncType\u0026#34;:\u0026#34;FULL\u0026#34;}} becomes this:\n{\u0026#34;filter\u0026#34;:{\u0026#34;stockId\u0026#34;:\u0026#34;?\u0026#34;,\u0026#34;syncType\u0026#34;:\u0026#34;?\u0026#34;}} One thing I did not want to expose in the span was the field values themselves, since they could contain sensitive information. The approach in the example sanitizes the query and replaces the values with ?. That means we can still see which fields are being queried without exposing the actual values in our tracing system.\nWith this additional information, it becomes much easier to understand which queries are slow and investigate why.\nIf you\u0026rsquo;re running on Spring Boot 3, you\u0026rsquo;re already set up with Micrometer observability, which provides the foundation for this kind of span enrichment. The same principles apply whether you\u0026rsquo;re instrumenting MongoDB, PostgreSQL, or any other database. Good spans with enough context make performance troubleshooting straightforward. I learned this lesson while debugging Spring Boot migrations, where observability was the key to catching performance regressions early.\nBeyond observability, don\u0026rsquo;t forget to configure proper MongoDB timeouts: good observability helps you see what\u0026rsquo;s happening, but timeouts prevent queries from running indefinitely on the server side.\n","permalink":"https://luizvieira.me/mongodb-observability-spring-data/","summary":"How we improved MongoDB tracing spans in Spring Data by adding a custom command listener to surface query details while keeping sensitive values sanitized.","title":"Improving MongoDB Observability with Spring Data"},{"content":"I’m not an AI expert, but in my circle at work and in my personal life, I’m kind of a power user. I use AI a lot, and I think it is genuinely useful. But I keep hearing a framing that sounds more convincing than it really is: “Write your prompt, go for a coffee, and let the agent work.”\nTechnically, that is true. You really can prompt the agent, step away, and come back later. But what people usually mean by that is much bigger: they mean we can now treat software engineering like free multitasking, and that teams should expect a much higher delivery rate because the machine is working in parallel.\nI do not think that conclusion follows.\nI have done this myself. I have had more than one clone of the same repository so I could move more than one thing forward at the same time. The problem is that parallel machine execution does not mean parallel human understanding.\nThe Cost of Context Switching My main issue with the async productivity story is that it ignores human context switching. We developers already know that moving from one task to another has a cost. It takes time to reload the problem, remember the tradeoffs, and evaluate whether the output is actually good. We cannot switch between tasks as cleanly as the agent can switch between prompts.\nAnd this is not just a feeling. There is research on task switching showing that moving between tasks has a real cognitive cost source. We tend to lose time, make more mistakes, and leave part of our attention behind on the previous task. So even if the agent keeps working while I am away, my brain does not come back for free when it is time to review the result.\nThat is the part I think gets missed in workplace conversations. The agent can draft, search, refactor, or explore while I do something else. That is helpful. But the human still needs to review, correct, validate, and decide. If I leave the task and come back later, I still have to rebuild context. If I use that time to jump into another hard problem, I will pay another switching cost there too.\nSo yes, agentic AI can absolutely help us move faster. It can compress execution time and make a lot of low-level work cheaper. But I think expected delivery gains can become unrealistic when people assume that human attention scales the same way machine execution does. There is also a related trap here: visible activity can look like progress even when we are not moving the most important thing forward. I wrote about that dynamic in Why Task Snacking Feels Productive But Holds You Back.\nThe Human Bottleneck In software engineering, the hard part is often not only generating output. It is understanding the problem, judging whether the solution fits the system, and noticing what the agent misunderstood. Those are still human bottlenecks.\nThat is why I think the async promise can be misleading in a work setting. The machine may be working in the background, but the human part of the loop is still expensive. We still need to review, correct, and rebuild context every time we come back.\nSo the tool is useful. Very useful. But I would be careful with the expectation that async agentic AI should automatically translate into a huge increase in developer delivery. The machine can be async. Our attention usually is not.\nIf you want a related angle on how agentic AI can affect my motivation and energy levels, I wrote about that in Is Agentic AI Like a Drug?.\nI also wrote about why AI made me stop writing and why the IntelliJ AI chat window is better than the Copilot plugin.\n","permalink":"https://luizvieira.me/why-async-agentic-ai-does-not-mean-free-productivity/","summary":"Agentic AI can speed up execution, but expected delivery gains are often overstated because humans still pay the cost of review and context switching.","title":"Why Async Agentic AI Does Not Mean Free Productivity"},{"content":"I always imagined a trip to Hawaii would be like in the movies, with people in flower shirts and someone greeting us with leis and dancing. Unfortunately, I got none of those things. Maybe that is what happens when you fly economy.\nJokes aside, Hawaii was always an interesting destination for us because of the beaches, but even more because of the volcanoes. So the Big Island felt like the right place for both. The beaches may not be the most famous in Hawaii, but they are still very good.\nIf you are comparing nature-focused destinations, our 9-day Iceland Ring Road trip itinerary in May is a useful complement for geothermal areas and hot springs, while our 5 days in Alaska covers more marine wildlife and tidewater glacier experiences.\nThe first thing we liked was the weather. It was a warm and pleasant night.\nTrip at a Glance Duration: 2.5 days (Easter long weekend) Base: Waikoloa Village Main focus: Volcanoes + beaches Top highlights: Kīlauea viewpoints, Nāhuku Lava Tube, black sand beaches, and sunset at On the Rocks Day 1: Volcano Day The first day, we dedicated our time to visiting a volcano, specifically Kīlauea in Hawaii Volcanoes National Park.\nWe left our Airbnb in Waikoloa Village around 7 AM because we wanted to get there early and beat the tourist rush. It takes around two hours via Saddle Road, and the drive is smooth.\nThe drive itself was beautiful, with volcanic scenery we had never seen before. There are no meaningful stops unless you just want to pull over and enjoy the view.\nI bought the park admission while we were in the car, and we paid USD 30 for seven days of access.\nWe got to the park around 9 AM, and there were a few people but not too many, so it was a good time to arrive, especially because it was a US holiday.\nKīlauea Overlook We stopped at the welcome center, but there was nothing special there, so we moved on to the Kīlauea Overlook. Parking was really easy since there were a lot of spots available at that time in the morning.\nThe overlook is fantastic. We could see almost the whole crater, with smoke rising during the day.\nKīlauea Overlook was our first big view of the crater, and it immediately felt worth the early drive.\nIt was great to see the crater floor with gas vents.\nThe best part was the hill with the most smoke. It was striking to see the green patches around it.\nUekahuna We walked here from the Kīlauea Overlook. It was a short walk, and this view is a bit better for seeing the whole crater.\nUekahuna gave us another great angle of the crater, with a broader sense of the scale of the landscape.\nIt was also interesting to see the flow. It felt like walking on polystyrene, and it cracked below your feet.\nIt looked like hard rock but was very spongy and broke very easily. It was a really new and exciting experience.\nSteaming Vents We stopped by the steam vents. It was cool to see the power of nature this close. I expected them to be smellier than they were, but they did not have much smell. It was also nice to stay in the warmth because the day was a bit cold.\nThe steaming vents were a simple stop, but one of the best reminders of how active and alive the park feels.\nKīlauea Iki Overlook We then went to the Kīlauea Iki Overlook because we wanted to do a short hike. Actually, I wanted it more than May did, but she came along.\nKīlauea Iki Overlook was where we started the short hike down into the crater.\nWe parked here because it was easier and allowed more time than parking closer to the lava tube. We had to walk a bit more, but it is part of the experience.\nWe went down to the bottom of the crater to see what the floor looked like and say that we had been in a volcano crater (we had already been in one in Africa, during our safari trip in Kenya and Tanzania, including the Ngorongoro Crater), but we wanted one that felt more recent and rocky.\nThe whole hike was around 1 hour to the bottom and back. We did not want to do the full loop.\nOn the way back, we were able to see eruptions in Kīlauea from far away. It was small, but still really nice because we were really looking forward to it.\nSeeing live lava, even from far away, was one of the highlights of the whole trip.\nNāhuku Lava Tube The lava tube was simple but very cool. It is basically a cave you can walk through. It is easy and close to the parking lot (or the trail). It is definitely worth a stop.\nNāhuku Lava Tube was a quick stop, but walking through it was still a very cool experience.\nVolcano\u0026rsquo;s Lava Rock Cafe We decided to stop for lunch before heading to the next adventure. What better place than one that has Volcano and Lava in the name?\nIt was a good spot for a quick lunch. It was quite empty when we arrived, but got fuller later. The food came quickly and tasted good. The portion size was enough to sustain us for the rest of the day.\nMauna Ulu Lookout After lunch, we headed south to the Mauna Ulu Lookout. The road there is amazing. It is fascinating to see so many volcanic landscapes, some very rugged and some less so. It is also interesting to see where the lava stopped and how it contrasts with the greenery.\nMauna Ulu Lookout was one of the best places to appreciate just how varied the volcanic landscape can look.\nThe wind here is very strong, so hold your doors and your hats. But the view of the rugged volcanic floor with the sea in the background is breathtaking.\nHōlei Sea Arch We went even farther south for the Hōlei Sea Arch. In pictures, it looked closer, but it is actually not that close to the viewpoint. The arch itself is not really worth the stop, but the road there is really nice, so if you have time, go for it. The views are great, and the arch is a nice extra. It is also a good stop for a washroom break.\nHōlei Sea Arch itself was fine, but the drive there was part of the fun.\nKehena Black Sand Beach We wanted to go to a black sand beach, and before the trip we prepared a map and added Kehena Black Sand Beach because it appeared to be closer to the arch. But it turned out that the lower road was closed, so we had to take the long way back to the park entrance and then head south again.\nBut we wanted to see a black sand beach, and we did not know there was another one on the island, so we decided to go. It was a bit of a drive, more than an hour.\nThe beach is more remote than we expected, and we needed to go down some steep steps to access it.\nThe beach was really nice. It was amazing to see the contrast between the water and the black sand.\nKehena was more remote than we expected, but the contrast between the black sand and the water was beautiful.\nBut the biggest surprise was that it was a nude beach. We had no idea. There were a few nude people, and it made us laugh the whole way back to the Airbnb.\nWe are so random that we ended up at a nude beach without knowing. That is what we call an adventure day.\nDay 2: Beach Day The second day was reserved for beach relaxation and exploration. The goal was to swim in the sea and try to see marine animals, especially turtles, which in theory were supposed to be easy to spot.\nHapuna Beach One of the reasons for staying in Waikoloa Village was the proximity to the beaches, especially Hapuna Beach, which according to my research is supposed to be one of the most beautiful beaches on this island.\nAgain, we went very early. By 8 AM we were already at the beach. Day parking was USD 20.\nThe beach is really beautiful, but you need to bring everything, like chairs and beach umbrellas. As tourists, we were looking to rent them but could not find anything.\nThe water was great. It was not that warm, but it was not cold either. It was also very clear, and we could even see fish near the bottom. Some people were snorkeling on their own.\nHapuna Beach was exactly the kind of easy, beautiful beach stop we wanted for a relaxing morning.\nWe enjoyed the beach, the water, and rested. Once the sun got stronger and the UV got higher, we decided to change beaches.\nWaialea Beach Really close to Hapuna is Waialea Beach. If you paid for parking at Hapuna, you do not need to pay here.\nWaialea Beach is a lot more natural, and the sand area is a lot smaller than Hapuna. There are a lot more rocks and fallen trees.\nIt was here that we finally saw a turtle. It was in the water, and we saw its head and flippers as the waves carried it around. Unfortunately, it never came out of the water.\nWaialea Beach gave us our first turtle sighting of the trip.\nCostco Not a beach, but Costco was our lunch stop. We are weird and like stopping at Costco when we travel, especially to eat cheaply and buy groceries for cooking, since the quality is good for the price.\nPunaluʻu Beach As the sun was high and the UV was at its peak, we decided to drive to another black sand beach, one that was not supposed to be nude. It was an hour-and-a-half drive to Punaluʻu Beach, and it is supposed to be one of the easiest beaches to spot turtles. We had seen turtles in the morning, but we wanted to see them outside the water.\nIt was not a great drive. Some winding sections are tiring, and you need to do them for more than 30 minutes. Spending 3 hours going back and forth on that road was exhausting.\nThe beach was beautiful, and there were a lot more people. It felt more family-friendly and nice to be there.\nPunaluʻu Beach was beautiful, even if the long drive made it a harder sell for us.\nThere were also 2 or 3 turtles, but they were all in the water surfing the waves, so we only saw their flippers when a wave lifted them.\nFor us, it was not worth it. The road was not that great, we had already seen a black sand beach the day before, and we still did not see the turtles the way we wanted to.\nOn the Rocks After that tiring road, we wanted to sit somewhere and relax while watching the sunset. May did some research and found On the Rocks bar. It was perfect because it was by the beach, and we could enjoy a beer while watching the sunset.\nAnother great thing was that May wanted a Hawaiian drink and some live music.\nThey had live music with a Hawaiian-style dancer, and it was great. After the frustrating road from Punaluʻu Beach, On the Rocks saved the day.\nOn the Rocks ended up being the perfect way to close the day, with drinks, music, and a beachside sunset.\nThe service was great as well, with a very attentive waiter. We got a seafood chowder, since I usually enjoy it, but it was not as good as advertised. I much prefer the San Francisco or Seattle versions.\nDay 3: Short Beach Stops Day 3 was our return day, but we had the morning before catching the flight. We stopped again at Hapuna Beach to swim in the sea and enjoy the clear water and beautiful sand.\nWe also did a quick stop at Waialea Beach to see if we could spot another turtle, but no luck this time.\nAfter checkout, we still had a few minutes to kill and some food to finish, so we went to Kohanaiki Beach Park, since it was closer to the airport. There we just sat, ate our tacos, and watched the waves, as there were more waves than at the other beaches. There was even someone surfing.\nLogistics For those who are interested, here are the logistics and costs from our trip.\nFlights This trip happened because I found a good flight deal for the Easter long weekend. A direct Vancouver to Kona option made it feel very doable for a short escape from Vancouver\u0026rsquo;s cold weather.\nRoute: Vancouver (YVR) -\u0026gt; Kona (KOA) Flight time: ~6 hours each way Airlines: WestJet (outbound), Air Canada (return) Booking platform: booking.com Car Rental The main roads we used were in good condition, so you do not need anything fancy for the typical attractions. We still chose an SUV because it was more comfortable, and the price difference was small.\nBooking platform: Costco Travel Rental company: Budget Car type: SUV Duration: 3 days Stay We picked Waikoloa Village mainly because we wanted easy beach access in the mornings. For this trip style, it worked really well as a practical base.\nArea: Waikoloa Village Platform: Airbnb Duration: 3 nights Notes: We mostly used it to shower, sleep, and have breakfast. eSIM I usually use Nomad, but this time I tried Booking\u0026rsquo;s Breeze. It was simple and enough for maps, messages, and normal trip usage.\nProvider: Booking\u0026rsquo;s Breeze Plan: 3 GB per person Prices Overall, Hawaii felt expensive, including groceries. We noticed that right away during our first Safeway stop, where prices felt noticeably higher than what we usually pay in Canada.\nSummary It was only two and a half days, but they were packed with activities and enjoyment. The Big Island is awesome. We kept saying it felt like many days in one, because as you drive, you move through very different landscapes just minutes apart. You get desert-like areas, lush tropical green, bare volcanic fields, and everything in between.\nSeeing all the different volcanic landscapes and live lava for the first time was incredible. The volcanoes are not the stereotypical cone shapes, but they are amazing and have huge craters.\nWe definitely want to explore the other Hawaii islands now. It is a great place to escape the cold winter in Vancouver, but only if flight prices are good, since it is not a cheap place compared to Mexico trips like Cancun, which we can reach with a similar flight time.\nIf you are looking for adventure and relaxation, I would say the Big Island gives you both.\nCheers to more adventures in the future!\n","permalink":"https://luizvieira.me/hawaii-big-island/","summary":"A 3-day Big Island itinerary with Kīlauea views, lava tubes, black sand beaches, turtle spotting, and practical logistics from our Easter trip.","title":"Hawaii Big Island: Volcanoes, Beaches, and a 3-Day Escape"},{"content":"We Brazilians love our barbecues, especially people in the south. One of the most iconic versions is costela fogo de chão, which is best described as open-fire roasted beef ribs, or slow-roasted beef ribs. It is a famous and delicious Brazilian barbecue tradition. Even though it is well known, it is not something people make all the time. It needs space, patience, and about six hours of roasting. I have done many regular BBQs, but this was only my second time making this one.\nWhat makes it special is not just the final result, but the whole experience around it. While the meat cooks slowly, people sit around the fire, talk, drink some beers, and enjoy the day together.\nDespite being well known, it is not something people make all the time because it requires work, space, and patience. I have done many regular BBQs, but this was only my second time making this one.\nIt is not especially difficult, but it does take quite a bit of preparation. That said, it is a fun and rewarding thing to do because you get not only the final result, but also the whole experience of spending time with other people while the meat cooks.\nAfter three years without visiting Brazil, and in need of a very good barbecue, I was really looking forward to making one of these again. During that same trip, we also spent New Year\u0026rsquo;s Eve in Rio de Janeiro, but this was one of the quieter highlights of being back home. Another reason is that it is a great family activity. Since you need to take care of the ribs for many hours, it gives everyone time to sit around the fire, drink some beers, talk, and enjoy being together.\nThe full rack roasting slowly over the fire\nDuring my visit to Brazil, I suggested to my brothers that we should make it, and they were immediately in.\nHow to Make Costela Fogo de Chão The process itself is not very complicated, but it does take time. First, you need a full rack of beef ribs like this one. Ours weighed 13 kilograms. In Brazil, it is not exactly easy to find, but it is also not too hard. A good butcher can usually help you get one.\nThe other difficult part is finding the proper metal support for the ribs. You cannot use a simple skewer because the meat can slide down as it cooks. Thankfully, my father had a friend who owned one, so we were able to borrow it.\nA closer look at the ribs on the metal support\nSeasoning and Fire The seasoning is very simple because we usually want to taste the meat itself, not cover it with too many flavors. We used only coarse salt. First, we poured cachaça over the ribs so the salt would stick better. After that, we added the salt, placed the ribs beside the fire, and kept them there for about six hours.\nThe fire should not be so strong that it touches the meat directly. It needs to stay at a medium-low level, hot enough to cook the ribs slowly without burning them. This is a low and slow kind of barbecue.\nThe ribs cooking low and slow beside the fire\nAfter that, the job is mostly to keep feeding the fire with logs and watching the progress. Over time, the meat starts to open up and the bones begin to loosen. Another useful tip is to add more fire if there is wind coming from behind the ribs, because the heat helps warm the bones, and the bones also help cook the meat from the inside.\nThe Result This is one of the most famous barbecue traditions in Brazil, and it was great to do it again. It took six hours, and the result was delicious. More than that, it was a great excuse to spend time with family around the fire. We had deep conversations, and that is part of what makes it so special.\nThe final result, ready to eat after six hours by the fire\nCheers.\n","permalink":"https://luizvieira.me/costela-fogo-chao-brazil/","summary":"A day in Brazil making costela fogo de chão, with six hours by the fire, family time, and one of my favorite barbecue traditions.","title":"Six Hours by the Fire for Costela Fogo de Chão in Brazil"},{"content":"I do not use social media. I cut it out years ago because I did not want that kind of dopamine pollution in my life. But lately I have been asking myself: did I just trade one loop for another?\nWhen I started using AI in my software engineering work, especially after agent mode became available, I thought: \u0026ldquo;This is amazing. I can write code faster, solve problems faster, be more productive, and still have brain energy left at the end of the day for personal life.\u0026rdquo;\nI am definitely more productive at work. But the brain energy at the end of the day? Not so much.\nI do not think I have an addictive personality (I was never tested, though), and I do not get easily hooked on alcohol or other substances.\nBut I am a type A personality who loves problem-solving, maybe too much (I am trying to work on that), and agentic AI has become a hard-to-stop habit for me.\nThe Dopamine Loop You know that reward feeling when you do something well? Dopamine is part of that system, but not only as a \u0026ldquo;pleasure chemical.\u0026rdquo; It is also involved in motivation, learning, and reinforcement.\nIn the old days of coding, the ratio between challenge and reward felt much heavier on the challenge side. I spent more time trying to solve one challenge, and the reward came later, at the end of a longer process.\nNow, in the age of AI, especially with agent mode, things move much faster. We have a problem, and even if I am not writing every line of code myself, I am still finishing a business problem. That gives me a strong sense of accomplishment. The cycle is much shorter now, so I can jump to the next challenge right away. At least that is true for me.\nMy interpretation is that these faster feedback loops reinforce the behavior. Each quick win nudges me to chase the next win.\nThat is why I ask if agentic AI is \u0026ldquo;like a drug.\u0026rdquo; I do not mean it as a clinical diagnosis. I mean it as a reinforcement loop that keeps pulling me toward the next challenge.\nThe Behavior I Noticed I got to a point where I opened my computer on the train commute just to write prompts to the AI and see whether I could finish a new challenge before my workday ended.\nNow, every time I solve a business problem, I get that reward feeling and immediately start running toward the next one. I am always thinking about the next challenge I need to solve.\nThis makes me more productive, but by the end of the day I feel more tired and with less brain energy.\nI know a lot of this is on me. Slowing down, delivering, and still ending the day with energy is a choice. But my personality pushes me to deliver more, not less.\nSo I am a better worker in output terms, but with less fuel left in the tank each day. That is the tradeoff I did not see coming.\nWhat I Am Afraid Of If I am solving real problems, maybe that is not an issue. But I am afraid I might start creating problems just so I can solve them and tell myself I was productive. That is related to what I wrote about task snacking, solving easy or unnecessary things to feel busy instead of tackling what truly matters.\nIf you want to understand the habit side of this better, my notes on Atomic Habits cover how reward loops get reinforced over time.\nMaybe it is a me problem, not an AI problem. But I suspect I am not the only one feeling this: the pull of the next challenge, the next dopamine hit, and the risk of burnout if we do not manage it well.\nThere is another side to this that I wrote about later in Why Async Agentic AI Does Not Mean Free Productivity: even when the agent is working in the background, the human still pays the cost of review, judgment, and context switching.\nPS: Paradoxically, I used agentic AI to proofread and improve this post. I am using it again.\nSources Cleveland Clinic: Dopamine overview, including reward, motivation, and learning roles Harvard Health: Dopamine and reward system context Harvard Health: Dopamine fasting misconceptions and reinforcement framing NIDA (NIH): Dopamine is more about reinforcement than pleasure directly Photo by Steve Johnson on Unsplash.\n","permalink":"https://luizvieira.me/is-agentic-ai-like-a-drug/","summary":"Agentic AI made me more productive at work, but I end every day more mentally tired. A reflection on reinforcement loops, dopamine, and sustainability.","title":"Is Agentic AI Like a Drug?"},{"content":"Context We use the GitHub Copilot plugin for IntelliJ in Enterprise mode, and I have been using it in agent mode for the last few months.\nI am a heavy user and one of the people who uses it the most in my company. I used it so much that I started getting annoying rate-limit messages. Because of that, I started using the IntelliJ AI chat window, and I have to say I prefer it over the Copilot plugin.\nI also started using the ChatGPT 5.3-codex model, which improved the experience even more.\nWhy I Prefer IntelliJ AI Chat The main thing I like is that the flow is much better. Copilot asks you to approve changes one by one, and it feels like it updates the file line by line. The AI chat edits the file without that interruption and then shows the diff of what changed.\nThe difference is that we review the final result once it is done and working, instead of reviewing line by line while it is being added.\nBoth ask for confirmation before running commands, but the AI chat window is more intuitive and easier to use.\nI feel much more productive using the AI chat, and I struggle less to explain what I want the model to do.\nThe final result is usually better. I think the chat window experience is better because of how it works, but I am also using a better model.\nTrade-offs One downside is memory usage. IntelliJ is already known for using a lot of memory, and the AI chat window increases it a bit.\nI have seen it slow down the IDE sometimes, which was rare before with the Copilot plugin.\nTakeaway For my daily workflow, the IntelliJ AI chat window feels more productive than the Copilot plugin, even with the extra memory usage.\nCheers.\nPhoto by Daniil Komov on Unsplash\n","permalink":"https://luizvieira.me/intellij-ai-chat-window-better-than-copilot-plugin/","summary":"After using both tools in daily work, I found the IntelliJ AI chat window flow more productive than the Copilot plugin.","title":"IntelliJ AI Chat Window Is Better Than the Copilot Plugin"},{"content":" Another year has flown by, and podcasts have remained my go-to source for learning, growth, and inspiration. Despite my best intentions to cut back, I found myself diving deeper into my favorite shows, finding new insights and ideas along the way.\nSince I started listening back in 2017, podcasts have really enriched my life. This year, my focus shifted towards health. Learning actionable strategies and putting them into practice has led to real improvements in both my well-being and daily routines.\nFor me, the best time to listen is during outdoor walks or commutes. There\u0026rsquo;s something about the combination of moving my body in an easy, natural way while actively absorbing new knowledge that feels perfectly balanced. I\u0026rsquo;m working both body and mind simultaneously.\nIf you\u0026rsquo;re new to podcasts, I encourage you to give them a try, especially on a walk. You might even find yourself walking a little longer, just to finish an episode!\nThe top 5 podcasts I listened to in 2025 Before diving into the top five, let\u0026rsquo;s take a look at some interesting stats from my podcast journey this year.\nThis year, I clocked in at 10,866 minutes of podcast listening. That\u0026rsquo;s down from 2024 (14,481 minutes) and 2023 (16,789 minutes). That\u0026rsquo;s a 25% decrease over the past two years. Looks like my intention to cut back on podcasts is finally paying off!\nMinutes of Spotify Wrapped\nSince Spotify tracks total minutes listened and I usually listen at 2x speed, I\u0026rsquo;ve actually consumed close to 21,732 minutes of content. That\u0026rsquo;s an insane amount of podcasts.\nBut enough about stats, what really matters is the value I\u0026rsquo;ve gained from these hours of listening.\nThe lineup in 2025 remained largely consistent with 2024, though the rankings shifted a bit. Huberman Lab maintained its top spot, while Hidden Brain climbed to number two. The main change was replacing The Tim Ferriss Show with The Peter Attia Drive, which brought a fresh perspective on longevity and health optimization. Without further ado, here are my top five podcasts of 2025, ranked from least to most listened to:\n5. The Peter Attia Drive The Peter Attia Drive\nI started listening to The Peter Attia Drive in 2024 after reading the book Outlive and was immediately hooked. Peter Attia\u0026rsquo;s deep dives into health, longevity, and performance optimization are fascinating. Not all the insights are directly actionable or applicable to my life, but the breadth and depth of knowledge he shares are incredible. It\u0026rsquo;s simply interesting to listen, even if I don\u0026rsquo;t apply everything.\nFavorite episodes:\n#371 – Women\u0026rsquo;s sexual health: desire, arousal, and orgasms, navigating perimenopause, and enhancing satisfaction | Sally Greenwald, M.D., M.P.H. 4. The Knowledge Project The Knowledge Project\nShane Parrish\u0026rsquo;s interview series focuses on mastering the lessons that others have already figured out. Whether it\u0026rsquo;s business, decision-making, or life strategies, each episode feels like a masterclass with leaders in their fields.\nFavorite episodes:\nCodie Sanchez: Your Blueprint to Financial Freedom 3. Lex Fridman Podcast Lex Fridman Podcast\nLex Fridman\u0026rsquo;s journey from The Artificial Intelligence Podcast to a broader interview format has been fascinating to follow. His intelligent questions and diverse guests (ranging from scientists and technologists to philosophers and historians) make every episode a learning experience. Topics span everything from consciousness and intelligence to love and power.\n2. Hidden Brain Hidden Brain\nI adore this podcast. Hidden Brain helped me uncover patterns in my own decision-making and relationships, making it a deeply reflective and practical listen. Shankar Vedantam blends science and storytelling really well to explain the hidden behaviors and patterns that shape our lives. It\u0026rsquo;s an incredible resource for self-improvement and understanding how our choices affect our relationships.\nSome of my favorite episodes include:\nYou 2.0: What Is Your Life For? Doing it the Hard Way How Nature Heals Us Love 2.0: How to Fix Your Marriage, Part 1 1. Huberman Lab Huberman Lab\nHuberman Lab, a science-driven podcast where Dr. Andrew Huberman dives into neuroscience and its connection to human behavior. What I love most is how practical and actionable his advice is, whether it\u0026rsquo;s understanding brain signals or optimizing daily routines.\nUnsurprisingly, Huberman Lab topped my list this year once again with 2,010 minutes of listening. With a strong focus on improving my health, I turned to this podcast for a wealth of actionable insights. Many of the concepts and strategies I\u0026rsquo;ve adopted as part of my \u0026ldquo;Pillars of Health\u0026rdquo; were inspired by the knowledge I gained from listening.\nEpisodes that left a lasting impression:\nHow Your Thoughts Are Built \u0026amp; How You Can Shape Them | Dr. Jennifer Groh How to Achieve True Happiness Using Science-Based Protocols | Dr. Laurie Santos How to Lose Fat \u0026amp; Gain Muscle With Nutrition | Alan Aragon Here is the image from Spotify Wrapped\nTop 5 podcasts on Spotify Wrapped 2025\nThis year\u0026rsquo;s podcast journey has been packed with knowledge, inspiration, and plenty of \u0026ldquo;aha\u0026rdquo; moments. Each show has left its mark, helping me grow in both my personal and professional life.\nReflecting on 2025, I\u0026rsquo;m amazed at how these podcasts have helped my curiosity and improved my life. They remind me of the endless opportunities to learn and grow.\nHappy listening!\n","permalink":"https://luizvieira.me/top-5-podcasts-2025/","summary":"Discover the top 5 podcasts that fueled my learning, health, and inspiration in 2025, along with key episodes and insights from my listening journey","title":"Top Podcasts of 2025: Smarter, Healthier, and Happier"},{"content":"While investigating an incident, I stumbled upon something surprising in our distributed traces: a simple JPA deleteAll query wasn\u0026rsquo;t executing as a batch delete. Instead, it was fetching all records into memory and deleting them one by one.\nI always assumed that a repository method like this:\n@Modifying @Transactional void deleteAllByAccessTokenExpiresAtIsBefore(Instant time); would generate and execute a single SQL statement:\nDELETE FROM oauth2_authorizations WHERE access_token_expires_at \u0026lt; ? But that\u0026rsquo;s not what was happening. Instead, it was fetching all the records, bringing them to memory, and deleting them one by one:\nDatadog trace showing JPA fetching all records and deleting them one by one\nAfter consulting with AI and showing it the trace, it pointed me to the culprit: the @Version field in my entity.\nThe Root Cause: Optimistic Locking My entity has a @Version field. This field is used for optimistic locking, a concurrency control mechanism that prevents conflicting updates by multiple transactions. When JPA updates or deletes an entity with a @Version field, it includes the version in the WHERE clause to ensure the entity hasn\u0026rsquo;t been modified by another transaction.\nBecause of this, JPA needs to load each entity into memory to check its version before deleting it:\ndelete from oauth2_authorizations where id=? and version=? This prevents batch deletes from working as expected.\nThe Solution The fix is to add an explicit @Query annotation with a JPQL delete statement:\n@Modifying @Transactional @Query(\u0026#34;DELETE FROM Authorization a WHERE a.accessTokenExpiresAt \u0026lt; :time\u0026#34;) void deleteAllByAccessTokenExpiresAtIsBefore(@Param(\u0026#34;time\u0026#34;) Instant time); This bypasses JPA\u0026rsquo;s entity loading mechanism and executes the delete as a single SQL statement.\nImportant Trade-off By using an explicit query, you\u0026rsquo;re bypassing optimistic locking protections. The delete statement won\u0026rsquo;t check the version field, which means:\nPro: Significantly better performance for bulk deletes Con: No protection against concurrent modifications during deletion In this case, it was acceptable because we were deleting expired tokens that were unlikely to be modified concurrently. However, if you\u0026rsquo;re deleting entities that might be actively updated by other transactions, you need to carefully consider whether losing optimistic locking guarantees is acceptable for your use case.\nKey Takeaway Pay extra attention to batch queries on entities with @Version fields. JPA\u0026rsquo;s default behavior prioritizes data consistency over performance by loading entities to check versions. If you need performance and can accept the trade-off, an explicit @Query is the way to go. This is just one of many subtle behaviors to watch for when working with Spring Boot and JPA.\nHappy querying.\n","permalink":"https://luizvieira.me/jpa-delete-all-query-not-batching/","summary":"Discovered why JPA deleteAll wasn\u0026rsquo;t batching: @Version fields force entity loading for optimistic locking. The fix: explicit @Query annotation.","title":"JPA Delete and Optimistic Locking: Why Batching Fails"},{"content":"When Spring Boot 4 was announced, I did what I always do: dive into the release notes and assess what it means for our services. After the successful upgrade from Spring Boot 2.7 to 3.2 last year, I\u0026rsquo;m more aware of how disruptive major version upgrades can be. This time, I spent a few hours analyzing our main library repository to understand what changes are coming and, more importantly, which ones will require the most attention from our teams.\nThis is not the upgrade itself, just a preliminary analysis. My goal is to identify the biggest pain points early so we can plan better and avoid surprises once we start. I\u0026rsquo;ll focus on the changes that will have the most impact on our codebase and deployment process, not every detail in the release notes.\nThe one change that stands out, and frankly worries me, is Jackson 3. It\u0026rsquo;s a major version upgrade that will touch almost every service we have.\nJackson 3 Migration: The Big Challenge The biggest and riskiest change is the upgrade of Jackson from 2.x to 3.x. If you\u0026rsquo;ve read my post about what we encountered upgrading from Spring Boot 3.2.5 to 3.3.1, you already know how disruptive Jackson changes can be. This upgrade is on a much larger scale.\nJackson is everywhere in our codebase. It handles all JSON serialization and deserialization for our APIs. This major version upgrade brings breaking changes that will ripple through our services and dependencies. What concerns me most is that Jackson is deeply nested in external libraries we use. We need to ensure all our dependencies are compatible with Jackson 3.x, which might require upgrading them too, creating a domino effect.\nPackage Name Changes The package names have moved from com.fasterxml.jackson to tools.jackson. This is the biggest impact because we\u0026rsquo;ll need to update imports everywhere in our codebase. I\u0026rsquo;m also concerned with external dependencies that might still be using the old package names. That could cause classpath conflicts that are hard to debug.\nBuilt-in Java Modules Good news is that in Jackson 3.x, some modules are now built-in and we don\u0026rsquo;t need separate dependencies anymore. This actually helps offset some of the pain from the migration:\njackson-datatype-jsr310 (for Java time types like LocalDateTime, ZonedDateTime) - now automatic jackson-datatype-jdk8 (for Optional, OptionalInt, etc.) - now automatic jackson-module-parameter-names (auto-detection of constructor parameters) - now automatic We can remove these dependencies once we migrate, which will simplify our dependency trees a bit. It\u0026rsquo;s a small win in what will otherwise be a large undertaking.\nAPI Changes There are several API changes that will require code updates:\nValueDeserializer changed to JsonDeserializer. This impacts any custom deserializers we have. ObjectMapper to JsonMapper. Any custom ObjectMapper configurations need review. Date/time serialization formats might differ, which means we need to test our REST APIs carefully These changes aren\u0026rsquo;t just about updating method names. They can cause subtle bugs in serialization logic that might only surface under specific conditions. That\u0026rsquo;s why comprehensive testing will be essential.\nJava 17 Baseline We\u0026rsquo;re already running Java 21 across our platform, so this requirement doesn\u0026rsquo;t affect us directly. However, it\u0026rsquo;s worth noting that Spring 4 will drop support for Java versions below 17. If we have any legacy services still on Java 11, they\u0026rsquo;ll need to be upgraded first before attempting a Spring Boot 4 migration.\nI don\u0026rsquo;t expect we have any services that old, but it\u0026rsquo;s worth auditing.\nTomcat 11 Upgrade Tomcat is being upgraded from version 10 to version 11, which brings changes to the servlet API. Our REST endpoints and web filters could be affected if they interact with the servlet API directly.\nMost of the changes should be handled automatically by Spring, but web functionality is critical and hard to test comprehensively in integration tests. This is another area where we\u0026rsquo;ll need thorough testing to ensure nothing breaks silently in production.\nOther Dependency Updates Besides Jackson and Tomcat, we\u0026rsquo;re also updating several other dependencies:\nFlyway: 10.20.1 → 11.11.0. This is our database migration tool. We\u0026rsquo;ll need to ensure our migration scripts still work and check if there are any behavior changes. Mockito: 5.14.2 → 5.20.0. Used in testing, should be mostly compatible but we should verify our test fixtures. Commons Lang3: 3.18.0 → 3.19.0. Utility library, low risk. Jakarta Persistence API: 3.1.0 → 3.2.0. Used for JPA and ORM operations. We should test our entity mappings to ensure they still work. If you have Spring Batch jobs, the Backwards compatible migration for Spring Batch 5 post covers related Jakarta Persistence changes. Jakarta XML Bind: 4.0.2. Used for XML processing in some of our bank connectors. This change could be risky if we\u0026rsquo;re doing complex XML transformations. The danger with dependency updates is that they often interact with each other in unexpected ways. A minor version bump in one library can expose a bug in another that was previously masked.\nConfiguration Changes There are some property changes we\u0026rsquo;ll need to review in our configuration files. Fortunately, I haven\u0026rsquo;t found anything critically breaking so far.\nIf we encounter any of these old properties in our application files, they\u0026rsquo;ll need updating:\nspring.dao.exceptiontranslation.enabled → spring.persistence.exceptiontranslation.enabled management.tracing.enabled → management.tracing.export.enabled From what I\u0026rsquo;ve seen, our current configuration is already using the correct property names, so this might not be a major blocker. Still, we should audit all our property files across services to be sure. If your services use observability or tracing, you might also want to check out my post on getting observability working with Spring WebFlux as a reference for how these tracing configurations interact with reactive code.\nWhat\u0026rsquo;s Next This upgrade will be complex because of Jackson, but I\u0026rsquo;m confident we can handle it. We have good test coverage across unit, integration, and end-to-end tests, which will catch most issues before they reach production. As I learned from my previous Spring Boot upgrade, the key is keeping changes minimal and testing essential. We also have solid monitoring and SLOs in place, so if something does slip through, we\u0026rsquo;ll catch it quickly.\nThe key is to be methodical: update dependencies carefully, test thoroughly at each step, and be ready to troubleshoot when edge cases inevitably appear. Based on what I learned from the previous upgrade, I know that technical problems always have solutions. They just sometimes take longer to find than expected.\nI\u0026rsquo;ll post more detailed migration guides as we start the upgrade process and encounter specific challenges. For now, this analysis is our roadmap for what to prepare for.\nUpdate: we have since done the upgrade, and I wrote about how it went in Upgrading to Spring Boot 4: Lessons From an AI-First Migration. Jackson 3 was indeed the big one, as expected here.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-4-analysis/","summary":"A detailed analysis of the major changes in Spring Boot 4, including Jackson 3 migration, Java 17 baseline, and dependency updates.","title":"Spring Boot 4 Migration Analysis"},{"content":"When Mark Twain said that “History doesn’t repeat itself, but it often rhymes,” he didn’t know my weight pattern during the year. In this post, I’ll talk about it and other health achievements from 2025.\nI started writing posts like this in 2024 to solidify my achievements and keep myself accountable. A bit of public embarrassment is surprisingly motivating.\nEven though my weight was not exactly what I expected, almost everything else was better than in 2024. A new year is also a good moment to reflect on what I really want. Do this exercise with me:\nClose your eyes and picture yourself at 80. Are you climbing a hill, chasing after grandkids, or enjoying a life with mobility and energy?\nThis question stayed with me throughout 2025, building on the foundation I established in 2024. The year was about sticking to what worked and making small adjustments along the way.\nContinuing the Journey After making health a priority in 2024, this year focused on maintaining momentum and finding sustainable rhythms. My Pillars of Health framework continued to guide my decisions and helped me stay focused on what matters most.\nHere is a glimpse of what I focused on in 2025. Hopefully, it will inspire you to continue or start your own health journey.\nRunning Running remained part of my weekly routine in 2025. I kept my Monday morning runs, usually covering 10 km distances. As I outlined in my Pillars of Health, building cardiovascular fitness is essential for healthspan.\nI also ran my first 10 km race, the Vancouver Sun Run, in 2025. Because it was a race, I ran faster thanks to the motivation and adrenaline. I achieved my best 10 km time ever, finishing in 43:43.\nVancouver Sun Run 2025\nI track my runs with an Apple Watch and use Pace mode, which helps me maintain a steady rhythm and stay on target. This feature allows me to gradually increase my pace goal and simply follow it during each run.\nHere is a summary of my running throughout the year. I ran about 150 km more in 2025 than in 2024.\nMonthly running distance measured by Apple Watch\nStrength Training Starting strength training in 2024 was a big surprise for both my wife and me. She had been encouraging me to try it for years, but I always resisted, saying I didn’t like it and that it was boring.\nThanks to her persistence and a few podcasts, my mindset slowly shifted. Reading Outlive was the tipping point. Two ideas from the book resonated deeply with me:\nHealth compounds over time. Conditions like atherosclerosis develop silently over many years and only become evident when it is often too late. I realized I needed to act now to prevent future problems. Aging and strength. As we age, we naturally lose strength and mobility. To stay independent and enjoy life later on, we need to build and maintain strength today. I now do strength training at least four times a week for about an hour. I started with three days but quickly increased it. Doing it often makes it easier, since it removes the need to decide. It is just part of my routine. As I detailed in my Pillars of Health, strength training is critical for maintaining independence and quality of life as we age.\nTo support my workouts, I use the Fitbod app, and it has been great. I chose the goal “Improve conditioning,” which focuses on higher repetitions, lower weight resistance exercises, and minimal rest to build endurance.\nWorkout summary from the Fitbod app in 2025\nI like updating the effort, or Rate of Perceived Exertion (RPE), so the app can better calculate the weight, number of sets, and repetitions for my next workout. I also appreciate that it tracks muscle recovery and suggests exercises for the muscles that are most recovered. This helps me train my whole body in a balanced and effective way.\nI am lucky to have a well-equipped gym in my building, just an elevator ride away, which leaves very few excuses.\nWeight Control Weight management has always been a challenge for me, and it still is. My target weight has been 75 kg for years, but I have struggled to reach it, often hovering in the low 80s or climbing into the high 80s during holidays.\nThis year, I made some progress and briefly hit my goal before slipping back. The journey continues, but I remain determined to achieve lasting results.\nMonthly weight average in 2025\nIn 2025, I even reached 73 kg. Unfortunately, due to some family issues, I stayed in Brazil for two weeks, and after that, everything derailed.\nThe cornerstone of my approach is simple: calorie counting. I do not follow trendy diets or extreme regimens. Instead, I track everything I eat and aim for a calorie deficit most days. Weekends are less strict, since maintaining balance is important to us. We like to cook and enjoy our meals.\nI use the Cronometer app to track my calories. The free version works well for most people. Since we cook most meals at home, tracking is fairly easy. Eating out is harder because restaurants rarely provide detailed nutrition info.\nI weigh myself every morning to better understand and manage my weight. For consistency, I do it right after waking up and using the washroom. I use an affordable RENPHO body fat scale that integrates with Apple Health, which helps me keep a long-term record even if I change scales in the future. I\u0026rsquo;ve compared it with a DEXA scan and found the accuracy to be quite good for tracking progress over time.\nWalking Walking has been a core habit for me for years. It is how I unwind, think, and listen to podcasts. In a way, it is my form of meditation. It also contributed to my podcast listening stats. It is incredible how much you can absorb during a walk.\nDaily average of walking and running distance in 2025\nWhenever possible, I choose nature for my walks. I am lucky to live near a beautiful park and enjoy hiking whenever I can.\nExploring Emotions After listening to several insightful podcasts about emotions, including Dr. Lisa Feldman Barrett: How to Understand Emotions and Dr. Marc Brackett: How to Increase Your Emotional Intelligence, I discovered the How We Feel app. These insights mirror the emotional health component of my Pillars of Health framework, which emphasizes mental well-being alongside physical fitness. I learned that emotions are far more complex and varied than I had imagined.\nThe app allows you to log your mood by choosing from 144 emotions, organized into four quadrants: high energy unpleasant, high energy pleasant, low energy unpleasant, and low energy pleasant.\nIn 2025, I continued tracking my emotions consistently. The image below summarizes how my emotions were distributed across the quadrants.\nCheck in breakdown in the How We Feel app\nThis practice helps me notice and name my emotions, which makes it easier to respond instead of reacting. It has become one of the most valuable investments in my overall health.\nSupplementation I maintained the same supplement routine from 2024: vitamin D, which is essential during Vancouver’s cloudy winters, a daily multivitamin, and whey protein to support my strength training goals.\nWith the addition of regular strength training, I started using whey protein to hit my daily target of 2 g of protein per kilogram of body weight. While I eat plenty of meat, it is not enough on its own to reach this goal. I do not have a strong brand preference, so I usually buy the most affordable option at Costco. At the moment, I am using LeanFit.\nWhile not technically a supplement, protein bars have also become a convenient snack. I choose ones with around 20 g of protein and about 190 calories from Pure Protein, and I limit myself to one per day. Ideally, I prefer snacks like fruit, or no snacks at all.\nSleep Since reading the book Why We Sleep in 2023, sleep has been a key focus for me. As I mentioned in my Pillars of Health, I aim for nine hours of sleep opportunity each night, meaning nine hours in bed. While I do not always hit that target, maintaining a consistent sleep schedule remains a top priority.\nAverage time asleep in the last six months\nIn 2025, I continued building on the foundation I established in 2024. The focus was consistency across weight control, running, strength training, and emotional well-being. These habits felt more natural and required less willpower, with the emphasis on simply showing up.\nI kept focusing on sleep, supplementation, and finding a balance between structure and enjoyment. There is always room to improve, but 2025 reinforced an important lesson for me: health is a continuous journey, not a destination.\nAnd just like my goals became purposes, 2025 deepened my understanding that lasting health comes from sustainable habits, not perfect execution.\nCheers.\n","permalink":"https://luizvieira.me/health-and-fitness-journey-2025/","summary":"2025 continued my health journey with refined habits, deeper insights, and a focus on sustainable progress in fitness and well-being.","title":"My Health and Fitness Journey in 2025"},{"content":"Being Brazilian, our image of an ideal New Year’s Eve is a warm place. For us, New Year’s Eve is not just a date on the calendar, but a mix of expectations, tradition, and emotion. We usually like to wait for the countdown and, if possible, be on a beach enjoying the warmth of the sea. While visiting family in the interior of Brazil, we decided that for New Year’s we would go to the coast, and Rio de Janeiro was the most desired destination. One of the quieter highlights of that trip was making costela fogo de chão over an open fire with my family.\nThere are a few reasons for that. It is a beautiful place, with mountains, sea, and amazing beaches. Another reason is the weather, as it is really warm. But the biggest reason is the famous fireworks show at Copacabana Beach.\nI had been to Rio once about 12 years ago, but my wife had never been. So, beyond visiting family, it felt like a great opportunity to do some sightseeing and experience the New Year’s Eve celebrations.\nOne of my main concerns before the trip was safety. Rio is famous for being one of the most dangerous cities in Brazil, and during my last visit I was almost robbed.\nIn this post, I want to share how our trip to Rio went, and mainly how New Year’s Eve at Copacabana Beach was. I will focus on what worked well, what was challenging, and what I would consider if I did it again.\nHotel After deciding on Rio, the next big question was where to stay.\nAccommodation during New Year’s Eve in Rio is very expensive, especially in Copacabana. Hotels usually charge several times their normal daily rate. We did a lot of research and booked about nine months in advance, in March, which helped us secure a decent place for a reasonable price.\nWe stayed at the Copacabana Mar Hotel, about two blocks from the beach. The location was great for us, as we went to the beach multiple times.\nOverall, it was a simple hotel. The bed was good, but the place felt a bit old. There was a small rooftop pool, which was nice but basic, with only two sun umbrellas.\nCopacabana Beach Since we were staying so close, Copacabana Beach naturally became where we spent most of our time.\nCopacabana Beach is impressive. It has a huge, wide stretch of sand. It is not as blue as Cancun, but it is bigger and wider. It is one of the best beaches we have visited.\nCopacabana Beach with its wide stretch of sand\nThere are many people selling things along the beach. This can be annoying, but it also means you do not need to bring much with you. You can rent beach chairs and umbrellas and buy food and drinks easily. We rented two beach chairs and a large umbrella for R$100 and also bought caipirinhas there.\nYou can find almost everything on the beach, from food and drinks to clothes. Copacabana really has it all.\nPrices vary a lot. Vendors often set prices based on how you look, so haggling is important. This is especially true if they notice you do not speak Portuguese. Even though we speak Portuguese, we sometimes got higher prices because our accent is not from Rio. We also saw English speakers being quoted even higher prices. You can usually negotiate, but you can also just pay if the difference does not bother you.\nSometimes we knowingly paid a bit more, simply because we saw how hard they were working under the sun. It is not an easy job.\nWhen we were there, the sea was very rough and dangerous, so most people did not go into the water.\nThe temperature was around 35 degrees Celsius, which was good, though a bit too hot for me.\nBathrooms were a challenge on the beach, especially on the 31st. There were some portable toilets, but many were still being installed during the day, so finding a place to use the bathroom was not easy.\nIpanema Beach To compare with Copacabana, we also spent some time at Ipanema Beach.\nWe made a brief stop at Ipanema Beach. The sea there was much calmer, and many more people were swimming. If you plan to go into the water, Ipanema might be the better choice.\nIpanema Beach with calmer waters\nThere were fewer vendors compared to Copacabana, but you could still find drinks and food, just with less variety.\nThis was the only beach where we were able to comfortably enter the water, so we ended up liking it more. It gave us the beach vibe we were looking for: relax under the umbrella, go for a swim, come back, and repeat.\nSugarloaf Mountain Besides the beaches and New Year’s Eve celebrations, we also wanted to see some of Rio’s main landmarks.\nLate December is probably one of the worst times for sightseeing in Rio because of the number of tourists. Still, since we were there, we decided to visit some of the main attractions.\nSugarloaf Mountain is one of Rio’s most famous sights. You take a cable car from the ground to the top.\nWe recommend getting the fast pass, as it was much quicker than the regular line. We went around 4 p.m. hoping to catch the sunset, but it was cloudy, so the sunset was not very visible. Even so, the view was beautiful.\nView from Sugarloaf Mountain at sunset\nAs with most tourist attractions, it was crowded, making it hard to take the perfect photo. With patience, though, you can still enjoy the view and take some good pictures.\nView from the top of Sugarloaf Mountain\nChrist the Redeemer After visiting Sugarloaf, we went to another iconic spot.\nChrist the Redeemer is probably the most famous attraction in Rio. We went around 8:30 a.m. on January 2, and it was already very crowded.\nWe took the train up, which takes about 20 minutes. At the top, there is not much to do beyond enjoying the view and taking photos with the statue. There is also a small chapel at the base of Christ.\nChrist the Redeemer statue in Rio de Janeiro\nTaking a good photo here is even harder than at Sugarloaf.\nEven though it is not cheap, we strongly recommend going. It is one of those attractions you might regret skipping, so it is better to face the crowds than to leave without seeing it.\nNew Year’s Eve Fireworks and Concerts The main reason for choosing Rio for New Year’s Eve was the celebration itself.\nNew Year’s Eve in Copacabana is intense. There are huge crowds. According to the news, about 2.6 million people were on the beach that night.\nOn the 31st, it is almost impossible to use a car or Uber in the area. We went on a helicopter tour early that day and returned around 9:30 a.m., and even then it was difficult to get back to the hotel because streets were already being closed. My recommendation is to stay nearby and avoid transportation as much as possible.\nPeople start going to the beach very early. The concerts on the beach began around 8 p.m.\nView of the stage setup for New Year\u0026rsquo;s Eve concerts at Copacabana\nWe decided to have dinner in our hotel room and head to the beach around 10:30 p.m. Our main goal was the fireworks, and we did not want to stay too long in the middle of the crowd. Being close to the beach helped a lot.\nIt took a few minutes to reach the beach because of the crowd, and there were police checkpoints before entering. This made us feel safer.\nWalking through the crowd on the beach was difficult at times. People often bumped into each other, so patience is essential. We were pleasantly surprised by how polite people were. Many apologized when they bumped into us and asked permission to pass. It felt less chaotic than we expected.\nThere were two singers before midnight, both performing Brazilian music. One was MPB and the other was pagode, as far as I could tell. I am not a big listener of Brazilian music, so I might be mistaken.\nThe fireworks were beautiful and lasted around 12 minutes. What makes them special is that they span the entire beach, which is enormous. There were, I believe, 19 barges launching fireworks.\nFireworks display at Copacabana Beach on New Year\u0026rsquo;s Eve\nIt was one of the most beautiful fireworks displays we have ever seen. We are a bit spoiled, since the Honda Celebration of Light in Vancouver is also excellent, and we also experienced the New Year\u0026rsquo;s fireworks in Las Vegas.\nWe also really enjoyed DJ Alok’s concert. I like his music, and the performance was great. The laser lights and especially the drone show were impressive.\nThere were around 1,200 drones, forming shapes in the sky, including Sugarloaf Mountain and Christ the Redeemer. It was easily the best drone show we have ever seen. Drone show forming the shape of Christ the Redeemer\nWith such a large crowd, you inevitably see some unpleasant things, like drunk people or people peeing in public. Still, we saw far fewer of these situations than we expected.\nHelicopter Tour To end the trip with something different, we decided to add one more experience.\nMy wife had never been on a helicopter ride. When choosing activities, we were torn between paragliding and a helicopter tour. We chose the helicopter, as it felt safer since it does not rely only on wind. This was similar to our mindset when we bought our Canon EOS R7 camera for the safari. We believe in investing in equipment for once-in-a-lifetime experiences.\nWe wanted a bit of adventure, so we chose the doors-off option, where there are no doors on the passenger side.\nIt was an interesting experience. The flight passed over about 11 attractions, and the pilot pointed them out through the headset. During most of the flight, it was very windy, and you have to hold on tightly. The pilot stopped twice so we could put our legs outside the helicopter for extra adrenaline.\nAerial view of Christ the Redeemer from the helicopter\nEven though you are secured with a seatbelt and safety harness, putting your legs outside feels strange. I tried it briefly but pulled my feet back in quickly. It was not very pleasant for me.\nIt was the most expensive activity we did, costing around C$700 for two people for a 30-minute flight.\nIt was a unique experience, but I am not sure it was worth the price for us.\nSafety Given our concerns before the trip, safety deserves its own section.\nAs mentioned earlier, safety was a big concern for us. Rio has a reputation for being dangerous, and my past experience made us extra cautious.\nWhen visiting tourist attractions, we usually took an Uber directly from the hotel and avoided walking long distances.\nWe left almost all our belongings at the hotel, including jewelry and even my smartwatch. We carried our phones but were very careful when using them and tried to attract as little attention as possible.\nWe saw a lot of police presence, especially around Copacabana Beach. We felt safe walking along the beach and Avenida Atlântica, but we avoided exploring other areas on foot.\nDuring New Year’s Eve, there were checkpoints with bag inspections and police spread throughout the beach area, which added to the feeling of safety.\nThe general advice for Rio is similar to any major city, but it feels even more important here because of the crowds and the scale of the events. Take only what you need, avoid drawing attention, and stay alert for pickpockets.\nEnglish Speaking Because Rio attracts visitors from all over the world, language is something many people worry about.\nWe were surprised by how many English-speaking tourists were there. We also noticed many Spanish-speaking visitors.\nIf you only speak English, you will manage. In airports, hotels, and major tourist attractions, you will find people who speak English.\nThat said, do not expect Uber drivers, smaller restaurants, or street vendors to speak English. Some do, but they are the minority. This is based on what we observed around us, since we speak Portuguese and did not face this issue ourselves.\nSummary We stayed only three nights in Rio de Janeiro and spent New Year’s Eve at Copacabana Beach. It is a great experience for people who enjoy large crowds, high energy, and big celebrations. It was a very packed trip. We relaxed on the beach, visited Christ the Redeemer and Sugarloaf Mountain, and did a helicopter flight.\nRio de Janeiro is a very beautiful city, and I do recommend visiting it. While it has a reputation for being unsafe, if you are careful, stick to main areas like Copacabana Beach and Avenida Atlântica, and avoid carrying valuables, it can be an enjoyable trip.\nSpending New Year’s Eve at Copacabana was a good experience. It was warm and sunny, and the night itself was pleasant, warm but not too hot. It was far more crowded than I personally like, so my wife enjoyed the atmosphere more than I did.\nThe fireworks were absolutely worth it and among the most beautiful we have ever seen.\nThe concerts were mostly Brazilian popular music, like MPB, pagode, and forró, along with a DJ set. My wife enjoyed the Brazilian music more, and we both enjoyed DJ Alok’s performance.\nThe drone show during Alok’s concert was outstanding, easily the best we have ever seen.\nIn the end, Rio is definitely worth visiting, but it is important to think carefully about whether spending New Year’s Eve in Copacabana fits your travel style. I am glad we experienced it once, but next time I would probably choose a quieter way to welcome the new year.\nTL;DR Copacabana on New Year’s Eve is massive, crowded, and high energy. Fireworks and the drone show are truly impressive and worth seeing once. Staying close to the beach is essential due to road closures and crowds. Safety requires extra attention, but heavy police presence helps. Great experience overall, but not ideal if you dislike large crowds. ","permalink":"https://luizvieira.me/rio-new-years-eve-copacabana/","summary":"Celebrating New Year\u0026rsquo;s Eve at Copacabana Beach in Rio, with fireworks, drone show, and sightseeing tips.","title":"New Year's Eve in Rio de Janeiro: Our Copacabana Experience"},{"content":"This wraps up my 2025 reading. I\u0026rsquo;m publishing a little earlier than usual because I’ll be on vacation in early December.\nI read fewer books this year than in prior years: 8 non‑fiction in total (vs. 9 last year). The mix ranged from memoir and adventure to software and culture. Here’s the full list:\nAll the books read in 2025\nStoryworthy - Matthew Dicks Unit Testing: Principles, Practices, and Patterns - Vladimir Khorikov In Patagonia - Bruce Chatwin The Culture Map - Erin Meyer Into Thin Air - Jon Krakauer Man’s Search for Meaning - Viktor E. Frankl When Breath Becomes Air - Paul Kalanithi The Art of Spending Money - Morgan Housel I also stopped forcing myself to finish books that weren’t working, something I struggled with before. I abandoned two this year early on; that freed more time for the ones below to actually sink in.\nMy top 2 favorite books of 2025 With a smaller list, choosing two keeps the recommendations focused.\n2. The Culture Map The Culture Map: Breaking Through the Invisible Boundaries of Global Business\nI work in a multicultural team in Canada. This book helped me name patterns I’d sensed but couldn’t articulate: why some feedback feels blunt to one person and vague to another; why meetings derail over indirect phrasing.\nA big shift was being more explicit by default. In mixed teams, low‑context communication isn’t oversimplifying; it\u0026rsquo;s leveling the field.\n\u0026ldquo;In multicultural teams, reducing contextual dependence and increasing clarity is not dumbing things down; it\u0026rsquo;s an act of generosity that ensures everyone is truly on the same page.\u0026rdquo;\nOne small change I made: rewriting a fuzzy status update into three clear bullets with owners and dates. It cut follow‑up questions almost entirely. Earlier this year I’d had a thread spiral into misinterpretations because I assumed shared context. This book gave me a vocabulary for avoiding that.\nLonger notes: Learnings from The Culture Map.\n1. Storyworthy Storyworthy: Engage, Teach, Persuade, and Change Your Life through the Power of Storytelling\nI’ve never felt naturally good at telling stories. This book gave me a workable system rather than vague advice: capture one small moment per day and revisit it later.\n\u0026ldquo;Homework for Life will change your life. It teaches you to see the stories you are living every day and capture them before they disappear.\u0026rdquo;\nI started my Homework for Life list in May. Sitting at the end of the day and forcing one line (sometimes boring, sometimes sharp) made ordinary weeks feel less like a blur. A quick note about a teammate jumping in to unblock a deployment later became a short anecdote at a retro, and people leaned in more than when I share metrics.\nIncluding a location when I tell a story (“standing beside the whiteboard, marker uncapped”) helps people picture it. Negative description (“It wasn’t the urgent outage kind of tension, just the quiet, nobody-moving kind”) also seems to land better. I’ve noticed adding one sensory detail (sound of the marker cap, glare on a screen) anchors it without overdoing it.\nLonger notes: Learnings from Storyworthy.\nConclusion Fewer books, but plenty of carryover. The Culture Map gave me language to adjust how I communicate across cultures. Storyworthy nudged me to notice and keep small moments before they vanish. If cross‑cultural collaboration or clearer storytelling matter to you, both are worth your time.\nA quieter change: I’m more comfortable quitting a book early and more deliberate about recording small, easily forgotten moments. That combination made the year feel lighter and still meaningful.\n","permalink":"https://luizvieira.me/best-books-2025/","summary":"Discover the top 2 books that shaped my 2025, with practical lessons on communicating across cultures and telling clearer, more memorable stories.","title":"My Top 2 Books of 2025: The Ones With the Biggest Impact"},{"content":"I have a stable income from my work, but like many people, I sometimes look for ways to earn a bit more on the side. Most of my attempts go nowhere, but I still try. Posting photos on stock websites is my new attempt to do that.\nView of my Adobe Stock profile\nWhy I Decided to Try Stock Photography Even though I suspect it’s probably doomed to fail from the start, I decided to give it a try. I bought a camera for my safari trip and took some really nice photos. After deleting the bad ones, I narrowed 15,000 pictures down to around 3,000 good ones. You can see many of them in my Kenya and Tanzania wildlife gallery.\nOne of my favorite photos from the safari, available in Adobe Stock\nI thought, why not post them on stock websites and see if they make some money? After all, the photos were already taken, so it wouldn’t be much extra work. I really believed it could be an easy way to earn a bit more.\nStill, I know the odds aren’t great. AI models can already generate very realistic images, and I think that will reduce the demand for stock photos in the coming years. Instead of searching for the perfect picture, people will probably just generate what they need. But I’m giving it a try anyway, and in this post, I want to share how I’m approaching it.\nResearching the Best Stock Websites Most of the photos I planned to upload were from my safari trip, focused on wildlife, nature, and landscapes. I wanted to see if these kinds of authentic, outdoor images could perform well on stock sites.\nMy travels and adventures are usually centered around nature, which is something I really enjoy. As I continue traveling, I plan to collect more photos along the way.\nWhen I first thought about the idea, I knew nothing about stock photography. I had owned a camera before but had never posted anything. So, like most people today, I used ChatGPT to research the best stock photo websites. It suggested three main ones: Adobe Stock, Shutterstock, and Alamy. Adobe Stock stood out because it offers one of the best commission rates, around 33%. Later, I also added iStock to the list.\nHere are links to my profiles so you can see the photos:\nAdobe Stock Shutterstock Alamy iStock After deciding where to post, the next step was preparing the photos.\nEditing and Preparing Photos The first step is to select the good ones. I mentioned that from the safari trip I had more than 3,000 decent photos, but not all of them were unique. Some were just slight variations taken in burst mode.\nAnother favorite Adobe Stock\nI start by selecting the best shots that catch my eye and group them in batches of 30 to 40 photos, which makes the process easier.\nFor editing the photos, I use Adobe Lightroom Classic. I’m not a professional editor, so I keep the adjustments simple: slightly increasing contrast, enhancing colors to make sunsets stand out, or cropping to improve composition. Just enough to make the photos look better without overdoing it.\nSome photos take longer to edit than others, but overall, I spend about one to two minutes per photo.\nUsing AI to Help with Metadata Next, I need to add titles, descriptions, and tags. Most stock sites allow up to 150 characters for the title or description and up to 50 tags. The best way to handle this is to add them directly in Lightroom, since the websites automatically read that metadata when uploading. This saves a lot of time. I only need to adjust a few specifics for each platform.\nTo generate titles and descriptions, I use AI. I created a Gemini Gem where I upload the photo and provide a short note like “taken during a safari in [park name].” The Gem analyzes the image and suggests a title, description, and tags. Around 90% of the time, the output is good enough. If it’s not, I tweak the input or make small edits. This makes the process much faster.\nI usually use the same text for both title and description, as different platforms read one or the other. On average, it takes me about a minute per photo to generate the titles and tags.\nUploading to Different Platforms Once the metadata is ready, I export the photo and start uploading. Each platform has its own quirks.\nAdobe Stock Adobe Stock is the easiest to use. It reads everything automatically, and since my photos are mostly of animals and landscapes, I don’t need to worry about model or property releases. It even categorizes the images automatically.\nThe downside is that Adobe Stock limits how many photos I can upload per day, so I usually submit around 10 to 20 daily. The review process takes one to three business days, and once approved, the photos go live for sale.\nThey accept most of my photos but tend to be the pickiest, as it’s the website where I have the highest rejection rate. The most common rejection reasons are “Similar content in our collection” and “Quality issues.”\nYou can check my profile and see the photos I’ve uploaded so far here\nShutterstock Shutterstock works similarly to Adobe Stock. It reads the description and metadata but requires manual category selection. Once the category is chosen, I can submit the photo.\nAfter submitting, the review process takes one to three business days. Almost all the photos are accepted, and the rejection rate is very low.\nYou can check my profile and see the photos I’ve uploaded so far here.\nAlamy Alamy is a bit different. After uploading, the images go through quality control first. Once approved, I can adjust titles, tags, and add missing details like the photo’s location and the number of people (in my case, always zero). Categories must be selected manually, but the interface is straightforward.\nSo far, all my photos have passed quality control.\nThey also have the concept of “supertags,” where you can highlight the 10 most important tags. I used to fill these out for every photo, but it took extra time, so lately I’ve been focusing more on location, categories, and SEO-friendly tags.\nYou can check my profile and see the photos I’ve uploaded so far here.\niStock (Getty Images) iStock is my most recent addition as I wanted to try another site to see if I could increase my reach.\nOn iStock, you create batches and add photos to them. It reads most metadata from the files, but you still need to add details like country and number of people in the photo.\nThe annoying part is that iStock uses predefined tags and doesn’t accept custom ones. You can still add your own, but they might not be effective. This makes tagging take a bit longer.\nAfter submitting, photos go through review like on the other platforms, and once approved, they become available on the website. The approval rate has been good, with very few rejections.\nYou can check my profile and see the photos I’ve uploaded so far here.\nLooking Ahead So far, I’ve uploaded more than 600 photos, with different acceptance rates across the platforms. It’s been less than two months since I started, so I don’t have much insight into performance yet.\nA year from now, I should have more information to share about how the photos perform and whether this was worth the effort. For now, it’s been an interesting experiment. I’m not sure if it will turn out to be profitable, but it’s been fun and educational nonetheless.\n","permalink":"https://luizvieira.me/my-stock-photography-journey/","summary":"I tried stock photography to see if it could earn extra income. Here’s my experiment, the process, and what I’ve learned so far.","title":"My Stock Photography Experiment: Earning Extra Income"},{"content":"In this post, I’ll show how I set up observability for a reactive Spring AI app using WebFlux. Transitioning from imperative to reactive programming can be tricky, especially when it comes to observability. I’m not very familiar with reactive programming since almost all our backend services use the imperative Spring Web MVC. But as we started a new stack for Spring AI from scratch, we decided to use reactive programming with WebFlux because we wanted the UI to receive the chunks one by one as the model generates them.\nI’m used to setting up observability for Web MVC, but doing it in a reactive environment was a bit challenging due to how the reactive context is propagated. That’s why I’m writing this. Also, Copilot wasn’t able to handle the reactive context propagation properly or recognize where tracing should be attached to fix everything for me, so I hope this post can help others facing the same issues.\nI’m using the milestone version 1.1.0-M3 of Spring AI ( implementation(\u0026quot;org.springframework.ai:spring-ai-bom:1.1.0-M3\u0026quot;)) because I need the Streamable-HTTP transport to call the MCP servers. And Streamable-HTTP transport for now it is only available in the milestone version. It is risky, but I am not fully in production yet and when I am, hopefully the final version will be released.\nDependencies Here are the main dependencies I used and what they do (Micrometer handles tracing integration, Reactor adds reactive context propagation, and OpenTelemetry exports the data):\nimplementation \u0026#39;io.micrometer:micrometer-tracing-bridge-otel\u0026#39; implementation \u0026#39;io.micrometer:micrometer-tracing\u0026#39; implementation \u0026#39;io.projectreactor:reactor-core-micrometer\u0026#39; implementation \u0026#39;io.opentelemetry:opentelemetry-exporter-otlp\u0026#39; Propagating the Trace Context The first thing was to make sure the upstream application was sending the traceparent ([W3C Trace Context](https://www.w3.org/TR/trace-context/)) header (standard W3C Trace Context header). After adding the dependencies, that was working well.\nNext, I added a hook during application initialization to tell Reactor to propagate the context so we can have that beautiful trace across the whole request. This I kinda knew from my previous Fixing Tracing Propagation in Spring WebFlux: A One-Line Solution experience.\nHooks.enableAutomaticContextPropagation(); // Enables automatic propagation of Reactor\u0026#39;s Context across threads so observability tools can link spans properly. See Reactor docs: https://projectreactor.io/docs/core/release/reference/#context One important thing to do is change the sampling value. I still don’t understand why 100% isn’t the default. After I had the 90% of distributed traces observability gone after Spring Boot upgrade problem, this value remained the same.\nmanagement: tracing: sampling: probability: 1 Missing ChatModel Spans The HTTP calls and database traces were working, but there were no ChatModel spans. In fact, some database spans that happened afterward were being started as new traces.\nThen I found that I needed to provide the ObservationRegistry to the chat model. At this point, I would have expected it to get the default bean automatically, but apparently, it needed to be provided manually.\n@Bean public AzureOpenAiChatModel azureOpenAiChatModel(ObservationRegistry observationRegistry) { AzureOpenAiChatOptions options = AzureOpenAiChatOptions.builder() .deploymentName(deploymentName) .maxTokens(maxTokens) .build(); return AzureOpenAiChatModel.builder() .defaultOptions(options) .openAIClientBuilder(new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiApiKey))) .observationRegistry(observationRegistry) // provide the observationRegistry .build(); } Detached Spans and the ChatClient After adding it, the spans started to show up, but they were detached and forming new traces; very messy. This one was hard to figure out. I initially thought it was a reactive propagation issue and that the Mono/Flux context wasn’t flowing properly.\nSpans starting a new trace instead of joining the parent\nEven Copilot couldn’t help me with this after several tries.\nI had to go old-school and started looking into Spring AI’s code to get some ideas. That’s when I found something interesting.\nEven though I had added the ObservationRegistry to the ChatModel, the ChatClient that used that model wasn’t using an ObservationRegistry.\nAnother odd thing is that it’s not part of the builder as a field: you need to pass it in the build() method. I would assume Spring could inject this automatically, but even if it needs to be provided, the build() method is the last place I’d look. If we’re following the Builder pattern, why not include it as a field?\nAnyway, after changing the code to this:\n@Bean public ChatClient chatClient(AzureOpenAiChatModel model, ObservationRegistry observationRegistry) { return ChatClient.builder(model, observationRegistry, null).build(); } it started to work perfectly, as you can see in the image below.\nContext being propagated correctly\nFinal Thoughts That’s basically it. Now my Spring AI with WebFlux application has a perfect trace for the chat endpoint.\nIn my case, I learned that getting observability right with Spring AI and WebFlux requires attention to how the reactive context and ObservationRegistry are wired through your application. Once both the model and client share the same context, you’ll finally see a clean, connected trace across all spans.\nCheers.\n","permalink":"https://luizvieira.me/spring-ai-webflux-observability/","summary":"How I got observability working in my reactive Spring AI app using WebFlux, after hours debugging tracing and context propagation issues.","title":"Getting Observability Right with Spring AI and WebFlux"},{"content":"My wife and I did a 10-day private safari in Kenya and Tanzania. We started in Nairobi and went to Lake Nakuru National Park (1 night), Masai Mara National Reserve (2 nights), Northern Serengeti National Park (1 night), Central Serengeti National Park (1 night), Ngorongoro Crater (1 night), Tarangire National Park (1 night), Amboseli National Park (2 nights), and finished in Nairobi.\nWe saw everything we hoped for and more: the Big Five, the wildebeest crossing the Mara River, and animals close enough to leave us speechless. One of the highlights was watching a lioness hunt a small wildebeest in Tarangire.\nMy wife and I in our safari car\nIn this post, I’ll share the most important lessons from our trip to help you decide if this type of adventure is right for you. If you’d like to see some of the photos along the way, some are available on Adobe Stock.\nAfter giving you a quick overview of our route and highlights, let’s go back to the beginning and explain how we chose this safari in the first place.\nWhy We Chose This Safari Choosing a safari was not just about picking a destination. It involved thinking about why we wanted to go, where exactly to go, and when would be the right time.\nWhy safari We’ve always loved to travel, but like most people, time and money are limited. To make our trips more intentional, back in December 2023 we each made a list of the top five places we wanted to see in our lifetime. We even made slide presentations for each other and then combined our lists. The idea was to focus on the most important trips, rather than spending money on places that were interesting but not a priority.\nAfrica was number one on my list and fourth on my wife’s. After visiting Dubai last year (her number one choice), this year it was time for Africa and a safari.\nThe real “why” behind it is our love for wildlife and nature. Africa offers a concentration of animals and landscapes that we couldn’t experience in Canada, Brazil, or anywhere else we had traveled before. A safari was a chance to see truly unique wildlife up close.\nWhy Kenya and Tanzania The biggest reason was the diversity and abundance of animals. We also wanted the chance to witness the Great Migration, when wildebeest cross the Mara River in huge numbers. Kenya drew us in with the Masai Mara, and we added Tanzania mainly for the Serengeti.\nWhy late August This is when the wildebeest make their way back from Kenya into Tanzania, so the chances of seeing a river crossing are much higher. It’s also the dry season, when animals gather around limited water sources, making sightings easier.\nOnce we had decided on Kenya and Tanzania, the next step was figuring out the practical side: which company to trust, how to organize the parks, and what paperwork we needed.\nPlanning the Trip Planning a safari can feel overwhelming, especially for a first trip to Africa. Here is how we approached it, from picking a company to handling visas and vaccines.\nHow we chose the safari company Choosing a safari company felt overwhelming at first. We didn’t know anyone who had gone on a safari before, so we had no personal recommendations.\nWe discovered SafariBookings and found it much more useful than TripAdvisor or other sites. It had detailed information, organized listings, and plenty of tour options. We filtered by countries and parks, then compared companies by reviews, years in business, and size.\nWe asked for quotes from four companies. Prices were very similar, but Morningstar Tours \u0026amp; Travel stood out for two reasons: their reviews and their digital itinerary. The itinerary included detailed information, recommended stays, alternative options, and costs. It made planning much easier since we wanted to pick the lodges ourselves. We ended up changing some of the suggested parks and also lodges.\nThe first safari vehicle we travelled in\nOur travel consultant, Dennis, was fantastic. He responded quickly and patiently answered all our questions.\nPayment and cancelation policy We paid 40% upfront to secure bookings. Even booking in February for an August trip, two of our preferred lodges were already unavailable, so we had to choose alternatives. The final 60% was paid two weeks before departure.\nThe payment was made via Pesapal, and we chose a credit card. I was comfortable as Pesapal is a common payment method in Kenya.\nAs we booked more than five months in advance and we had traumas in previous travels, one thing that was important for us was to know the cancellation policy. We never plan to cancel, but unexpected things can happen.\nUpon asking, Dennis sent it to us. This was the cancellation policy at the time (February 2025).\n10% Deposit is non-refundable Between 60 and 35 days prior to the date of stay, 30% of the total cost will be charged. Between 34 and 22 days prior to the date of stay, 50% of the total cost will be charged. Between 21 days and a no-show, 100% of the total cost will be charged. I would recommend asking for an updated version before booking it.\nHow we picked the parks Some parks, like the Masai Mara, were obvious choices. Others, like Lake Nakuru and Tarangire, we selected based on specific animals we wanted to see. SafariBookings has wildlife pages for each park that list which animals are common, occasional, or rare, and we used those guides to shape our itinerary.\nExample of the wildlife page of Nakuru Lake National Park in SafariBookings\nVaccines Yellow fever vaccination was the only strict requirement, and we were asked to show proof at border crossings. We also updated boosters for tetanus, polio, and COVID.\nWe took antimalarial pills, though to our surprise, we didn’t encounter mosquitoes. We also took medication for cholera and traveler’s diarrhoea. Thankfully, we stayed healthy the entire trip by sticking to hotel food and bottled or provided water.\nVisas With Brazilian passports, we needed an eTA for Kenya and a single-entry visa for Tanzania. Even though we crossed borders multiple times, these were sufficient.\nThe Kenyan eTA process was smooth and fast, with approval in one day. Tanzania’s process was slower and less user-friendly, but it was approved in a few days.\nWith all the planning behind us, it was finally time to experience the safari itself. Here is what it was like once we were on the ground.\nOn the Ground Once the trip began, we quickly learned what daily life on safari was really like. From the lodges to the food, the roads, and the guides, here is what stood out.\nLodges (general impressions) Most of the places we stayed were mid-range, and overall, they were really good. Clean, comfortable, organized, and with plenty of good food. We even gained a few kilos during the trip. The tented camps became our favorites. They were simple but well run, and even the tents had hot showers.\nSome of the tents in Gnu Mara Camp\nLuxury wasn’t necessary for us. Since we usually arrived between 5 and 6 p.m. and left again between 6 and 7 a.m., the lodge was really just a place to rest, eat, and recharge. Mid-range stays felt like the right balance.\nSome details stuck with us. At nearly every check-in, we were given warm towels. The first time, we had no idea what to do with them, so we just ignored them. Later, we watched others wiping their faces and hands, and from then on it became part of the ritual.\nAnother common experience was the scripted welcome speech. Staff often recited it in a robotic, emotionless way, pausing if you weren’t looking directly at them. The first time it felt polite, but after hearing it two or three times in different lodges, especially after a long day on rough roads, it became tiresome.\nThey also tended to over-explain. When showing us the room, staff would go through things like how to switch on lights or use the shower. It’s harmless but unnecessary, and when you’re changing hotels almost every day, the repetition can be frustrating.\nThe last thing that stood out was the amount of attention. Staff wanted to hear about our day and checked in often, which some travelers might appreciate. For us, there were times when we just wanted to eat quietly after hours in the car. Their friendliness was genuine, but it sometimes felt like too much.\nWe’ll talk about the specific lodges when covering each park.\nFood in general Friends often asked us how the food was. The answer is that it was very international. Since we only ate at lodges, there was nothing shocking or unusual. Some offered one or two local dishes, but overall, the menus were similar to what you’d find in Canada or the US. Lamb was served much more often than we were used to, and it was common across lodges.\nRoads and travel between parks Roads were generally rough. Many main routes between parks were unpaved and very bumpy, especially the stretch leading to the Masai Mara and across to Ngorongoro. These transfers could be exhausting. My wife became motion sick almost every day after the third day, so bring medication if you are prone to it.\nMay feeling motion sick and trying to get better\nStill, the drives provided memorable moments. Kids often waved as our vehicle passed, and crossing villages gave us a glimpse into local life. We saw people carrying water, women washing clothes in rivers, and families living in very basic houses. It was a humbling reminder of how privileged we are.\nOur drivers/guides Since our route took us through Kenya, Tanzania, and back to Kenya, we had three different drivers. Each one shaped the trip in their own way, and the difference in personalities was very noticeable.\nRono Rono was our first driver in Kenya, covering Nairobi, Lake Nakuru, and the Masai Mara. He was excellent and immediately made us feel that we were in good hands. From the start he asked about our goals and did everything possible to deliver on them. He had a sharp eye for spotting animals and positioned the car perfectly for photos. When I mentioned I was interested in birds, he made a point of pointing out many species that we would never have noticed ourselves. Rono was patient, knowledgeable, and engaging, which made our introduction to the safari experience smooth and exciting.\nJackson Jackson guided us through Tanzania, including the Serengeti, Ngorongoro, and Tarangire. His calm and patient style was a perfect match for the long days in the car. One of the best examples of his dedication was waiting with us for five hours at the Mara River until the wildebeest finally crossed. Many other drivers gave up, but Jackson encouraged us to stay and it paid off with one of the highlights of the entire trip. His car was spotless every morning and he drove carefully even on rough, tiring roads. He also shared stories from his years of guiding, which gave us a deeper appreciation of the parks and the challenges guides face.\nMasila Masila was our last driver, covering Amboseli and the return to Nairobi. Unfortunately, the experience with him was not as good. The car had an unpleasant smell each morning, similar to marijuana, although it usually went away after the car moved for a few minutes. He didn’t put much effort into finding animals or following radio calls. While he was punctual and always respected departure times, his driving back to Nairobi was reckless and made us feel unsafe. After having such excellent guiding with Rono and Jackson, the contrast was clear. He got us where we needed to be, but without the same level of care or attention that we had become used to.\nSafari vehicles All three vehicles had the essentials: pop-up roofs for viewing and photography, comfortable space for two people, and outlets to charge devices. Each one also carried plenty of water. Still, the small details in each vehicle made a big difference when spending up to twelve hours a day inside.\nRono\u0026rsquo;s vehicle Rono’s car was by far the best of the three. The main highlight was the first-row window, which slid down completely so you could lean out comfortably for photos or simply enjoy the breeze. The seats reclined, which made long transfers much easier. Another thoughtful detail was the storage pockets in front of the seats, which were perfect for lenses, glasses, water bottles, and other small items. There was also a mini fridge stocked with water, although it wasn’t always running. Overall, the combination of comfort and practicality made this our favorite vehicle.\nJackson\u0026rsquo;s vehicle Jackson’s car was slightly less convenient. The first-row windows only opened halfway sideways, which made it harder to lean out for photography. The seats also did not recline, which became uncomfortable on longer drives between parks. The front panel was wooden and had some space for storage, but not as much as Rono’s. On the positive side, the mini fridge was always on, so the water stayed perfectly chilled, which was refreshing on hot days. Jackson also kept the car spotless and organized, which made a big difference when climbing in and out every day.\nMasila\u0026rsquo;s vehicle Masila’s car had the same sideways-opening windows as Jackson’s in the front, but the second-row windows opened wider, which actually gave better viewing angles from there. The seats reclined, which helped during long stretches, but the front seat pockets were filled with tools and even broken glass, making them not very useful. There was no mini fridge in this vehicle, so water was just kept in the pockets. Combined with the unpleasant smell each morning, the car felt less well maintained than the others.\nPark by Park Experiences Each park had its own character, animals, and surprises. Here is our Kenya and Tanzania safari itinerary, park by park.\nThe summary of the parks and days of our Safari trip\nLake Nakuru National Park Lake Nakuru is known for its dramatic scenery, surrounded by acacia forests and escarpments, and its rich wildlife. It is one of the best places in Kenya to see rhinos, both white and black, and is also famous for large flocks of flamingos. The park gave us a very dense first safari experience, with animals seemingly everywhere.\nGetting there It took about 3 to 4 hours from Nairobi. The drive gave us a glimpse of rural Kenya, with shepherds herding goats and cows, people working fields by hand, and many small villages. It reminded me of rural Brazil in the late 90s and early 2000s, especially the manual field work.\nAnimals Before even reaching the lodge, we saw zebras, giraffes, impalas, and a rhino resting under a tree. During the game drive, we saw more than 200 zebras, giraffes, buffaloes, about 15 white rhinos, warthogs, impalas, flamingos, pelicans, hyenas, and many bird species. Unfortunately, we did not see any black rhinos.\nA playful zebra foal jumping in Lake Nakuru. Download it in Adobe Stock\nNakuru is so full of wildlife that it can feel like you have seen it all in just one day. My advice is to take time not only to spot animals but also to enjoy the unique mix of lake, birds, and acacia forest.\nLake Nakuru Sopa Lodge We stayed here for one night, and it was the perfect introduction to the safari experience. The setting is beautiful, with views of Lake Nakuru from the main building and even from some of the rooms. The buffet lunch and dinner were surprisingly good; we even went back for seconds, including dessert.\nThe sunrise view of the Lake Nakuru Sopa Lodge restaurant\nThe room itself was spacious and comfortable, but it was located down a steep path from the main area, which meant a lot of walking back and forth. After a long day of game drives, the uphill walk felt tiring. Still, the warm welcome and the peaceful views over the lake made up for it. This is the kind of lodge where you can really soak in the scenery after an exciting day in the park.\nUnique experience Seeing so many rhinos in one day, along with the density of wildlife overall, made it feel like we had already seen everything on our very first day. Nakuru was the only place where we saw rhinos during the entire trip.\nWhite Rhino grazing in the forest of Nakuru Lake National Park. Download it in Adobe Stock\nMasai Mara National Reserve The Mara is iconic, with vast open plains dotted with acacia trees. It is famous for the Great Migration and its large populations of predators. Compared to Nakuru, the Mara felt wilder, with animals more spread out but encounters more dramatic. Where Nakuru is densely forested, the Mara opens wide into endless savannah.\nGetting there The drive took about six hours from Nakuru. Roads were bumpy and dusty, and we passed through poor towns with very basic facilities. The contrast with the lodges and parks was striking.\nAnimals We saw cheetahs, including one with an impala kill, lionesses with cubs, a male lion limping majestically around its pride, leopards (including the well-known Luluca), which we got very close to, elephants with babies, crocodiles, hippos fighting, topis, elands, ostriches, gazelles, hyenas, and a massive herd of wildebeest by the Mara River grazing.\nView this post on Instagram Zebra River Camp (upgrade from Zebra Plains Camp) Originally, we were booked at Zebra Plains Camp, but upon arrival, we were upgraded to Zebra River Camp, which turned out to be a wonderful surprise. The camp felt luxurious yet still close to nature, with hippos living right in front of our tent.\nThe room at Zebra River Camp\nSitting outside with a beer and watching them move around at dusk was a highlight in itself. The food was excellent: à la carte for lunch and buffet for dinner, with plenty of variety. In the evenings, the fire pit created the perfect spot to unwind and swap stories with other guests.\nDrinking a beer and watching the hippos Zebra River Camp\nThe staff were friendly, though one waitress was overly attentive and kept asking questions at every meal, which got a little annoying as we just wanted to have our meals and rest. This waitress was our waitress for all meals on both days. We even tried to sit in the other part of the restaurant to run away, but it didn\u0026rsquo;t work.\nUnique experience Watching the wildebeest herds at the river and a pride of lions with cubs was unforgettable. Some areas, especially when we found the leopard Luluca, were very crowded with aggressive drivers pushing too close. The Mara was the only park where off-road driving was allowed, which created amazing encounters but also large clusters of vehicles.\nLeopard Luluca walking between safari vehicles in the plains of Masai Mara. Download it in Adobe Stock\nBalloon ride We planned to take a balloon ride to see the migration from the air, but we decided against it the day before. It was expensive at 450 USD each, and the seller did not give us much confidence. In the end, we were glad we skipped it because we saw a large lion pride during the morning drive at the same time we would have been in the air. Being closer to the animals felt far more rewarding.\nNorthern Serengeti National Park The northern Serengeti is hillier and greener than the Mara and is centered around the Mara River. It was the place where we most hoped to witness the wildebeest river crossing.\nGetting there It took about 5 to 6 hours, including the Namanga border crossing, which took about an hour. The road after the border was bumpy and tiring, with “African massage” all the way.\nAnimals We saw wildebeest waiting by the river but not crossing on the first day, as well as zebras, giraffes, dik-diks, waterbucks, and some elephants.\nOn the second day, after waiting for five hours, and just two minutes after we had decided to give up, we finally witnessed the wildebeest river crossing. In the image below, you can see the first wildebeest starting to cross the river.\nFirst wildebeest to cross the river. Download it in Adobe Stock\nIt was one of the highlights of the trip.\nA lot more wildebeest crossing the Mara River. Download it in Adobe Stock\nGnu Mara River Camp This camp had one of the best locations of our entire safari, just minutes from the Mara River where the wildebeest gather.\nWe stayed one night and loved the combination of simple comfort and genuine hospitality. The staff were very welcoming, and dinner was one of the first times we had local-style food, which felt like a treat after several buffets.\nThe main tent and restaurant at Gnu Mara River Camp\nOur tent was comfortable and well set up, though the journey to get here was long and tiring, with rough, muddy roads that even got us stuck once. Being so close to the action, however, made it all worthwhile.\nOur room at Gnu Mara River Camp\nSharing stories with the staff, who even knew about Brazil and showed us videos, added a personal touch that made the stay even more special.\nUnique experience The wildebeest crossing itself. Waiting for hours and finally seeing them leap into the river was magical. The tension built each time one approached the water. Many vehicles were waiting for the same thing, but the excitement was shared by all.\nCentral Serengeti National Park The classic Serengeti landscape of endless plains with acacia trees. Central Serengeti is packed with wildlife and feels like The Lion King brought to life.\nGetting there It was part of a game-drive transfer from the Northern Serengeti, so the entire day felt like a safari. The roads were extremely dusty, the dustiest of the trip.\nAnimals We saw cheetahs with cubs, a male leopard eating a wildebeest in a sausage tree, lionesses with six cubs, golden jackals, hyenas, hartebeests, servals, and large herds of wildebeest and zebras.\nCheetah standing in the spare tires of a safari vehicle in Central Serengeti. Download it in Adobe Stock\nThe leopard carrying a wildebeest into a sausage tree and feeding there was especially fascinating. It was unusual and impressive to see him so comfortable in that spot.\nLeopard eating a wildebeest in a sausage tree in Central Serengeti. Download it in Adobe Stock\nMawe Tented Camp Mawe Camp struck a great balance between comfort and immersion in the wild. Even though it’s a permanent camp, it has the feel of a tented setup, with canvas walls and an open connection to the sounds of the bush. Very similar to Gnu as they are from the same owner.\nOur tent at Mawe Tented Camp\nThe sunrise and sunset views were incredible, and we loved sitting around the fire pit in the evening with a drink in hand. Food was tasty and plentiful, and the staff attentive without being overbearing.\nCompared to some of the other places, this camp had fewer frills, but we didn’t feel like anything was missing. It offered exactly what you’d hope for in the Serengeti: comfort, atmosphere, and the sense of being right in the middle of nature.\nUnique experience Watching a leopard feeding in a tree and seeing the iconic kopjes that looked like Pride Rock from The Lion King.\nNgorongoro Crater A unique ecosystem inside a massive volcanic caldera. The concentration of animals was incredible, all living within the crater walls. The high density of zebras and wildebeest, however, felt a bit repetitive after what we had already seen in earlier parks.\nGetting there It was about 3 to 4 hours from the Central Serengeti. The descent into the crater was breathtaking. The roads leading there were extremely dusty, but after leaving the crater, they became paved.\nAnimals We saw zebras, wildebeest, flamingos, crowned cranes, hippos, including a baby, elephants, and a high concentration of other grazers.\nFlamingos fighting in the lake in Ngorongoro Crater. Download it in Adobe Stock\nKaratu Simba Lodge Karatu Simba Lodge was a welcome stop after the dust and bumpiness of the Serengeti roads.\nSet outside the Ngorongoro Crater, it had a peaceful, laid-back feel with a mix of tented and fixed structures. The pool was a nice touch, and we enjoyed a quiet afternoon around it before dinner.\nKaratu Simba Lodge tents\nThe food stood out, especially the beef stew with beer and some flavorful okra dishes that felt more local and less generic than many buffets we had before.\nOur tent-room was spacious and comfortable. The fire pit close to the pool after dinner, and the overall tranquility made this lodge a cozy and restorative stop.\nOur tent in Karatu Simba Lodge\nUnique experience The scenery of the crater itself, being inside a volcano surrounded by wildlife, was the highlight. On the wildlife side, nothing was very new, since we had already seen most species elsewhere.\nA picnic by a lake with hippos and a baby was a special moment.\nView this post on Instagram Tarangire National Park Known for its giant baobab trees and elephants, Tarangire felt different from the previous parks and gave us a more intimate atmosphere. Arriving late in the morning meant most of the day was spent in the park.\nGetting there It was about 2 hours from Ngorongoro. The roads were decent compared to those in the Serengeti.\nAnimals We saw many elephants, giraffes, zebras, lions, wildebeest, hippos, baboons, vervet monkeys, and birds like the red-billed hornbill, which is Zazu from The Lion King.\nAt the picnic site, monkeys were quick to steal food. One grabbed Jackson’s banana, and another tried to take May’s juice.\nWe stayed by the river watching elephants for a while. Seeing their natural behavior was wonderful. We even watched elephants trying to mate and a baby drinking milk.\nWe also witnessed one of the most amazing scenes of the entire trip: a lioness hunting. We saw her getting into position and then running after her prey. We missed the exact moment she caught it because it happened behind another car, but we later saw her eating a small wildebeest.\nElephant herd drinking water in Tarangire National Park. Download it in Adobe Stock\nBaobab Tented Camp Inside Tarangire National Park, this camp had a more rustic and authentic atmosphere compared to some of the Serengeti camps, but it felt perfectly in tune with the setting. Our tent was comfortable and close enough to the action that we saw animals nearby, including an elephant close to camp in the evening.\nInside the tent of the Baobab Tented Camp\nThe food was simple but good, and dinner by the campfire under the stars was unforgettable. While it didn’t have the same level of amenities as some of the other lodges, what it offered instead was intimacy and the thrill of being right in the park.\nBreakfast at Baobab Tented Camp\nWatching the sunset from our tent and then sitting by the fire with a glass of wine made for a perfect ending to the day.\nUnique experience The riverside picnic and afternoon game drive gave us some of the most memorable elephant encounters. Watching elephants, giraffes, and zebras drinking together at the river, while monkeys stole food during our picnic, was unforgettable.\nAnimals drinking water in Tarangire National Park. Download it in Adobe Stock\nAmboseli National Park Amboseli is famous for its elephants and views of Mount Kilimanjaro. While we did not see the mountain due to clouds, even staying for two nights, the park still delivered unique sights with swamps and mirages.\nGetting there It was about 5 hours from Tarangire, crossing the Kenya–Tanzania border. The roads after the border were rough, with sand and “massage roads.”\nAnimals We saw elephants, including babies learning to use their trunks, as well as buffaloes, wildebeest, hippos outside the water, hyenas, lions, cheetahs that were mostly hidden, zebras, giraffes, and many birds such as the secretary bird and saddle-billed stork.\nHippos playing in the lake in Amboseli National Park. Download it in Adobe Stock\nKibo Safari Camp Kibo Safari Camp was the busiest lodge of our trip, with a much larger number of guests than anywhere else we stayed. The tents were big and very comfortable, though more like semi-permanent structures than true tents, which made it feel less intimate and a little more like a farm hotel.\nOutside of the tent of Kibo Safari Camp\nThe food variety was very good, with plenty of options at every meal, and one evening we got to watch a cultural dance performance that added some extra charm.\nSunsets weren’t as impressive here due to the location and cloudy skies, but we had one of our most memorable breakfasts on a hill overlooking the park, with a panoramic view that more than made up for it.\nDespite feeling less personal than the smaller camps, Kibo provided comfort and convenience for exploring Amboseli and was a solid end to the safari.\nInside the tent of Kibo Safari Camp\nUnique experience Heat mirages that looked like water, sand tornadoes, and watching elephants graze and play in the swamps.\nSunrises were often cloudy, so mornings were not always rewarding. Breakfast on a hill with a panoramic view was one of the most beautiful meals of the trip.\nPicnic view in Amboseli National Park\nLooking back after ten days, we gathered several lessons and tips that could help anyone planning a similar trip.\nReflections \u0026amp; Recommendations 10 days vs 7 days If we were to do a safari again, we would choose fewer days and fewer parks. Ten days were a lot, and the long drives between parks became tiring. A seven-day safari would have been more than enough, especially if we had stayed longer in fewer places. For us, Lake Nakuru, the Masai Mara, and maybe Amboseli for the elephants would have covered almost everything we wanted to see. The only exception was the wildebeest river crossing, which can only be seen in the Northern Serengeti and was one of the highlights of our trip.\nStay inside the park If possible, book lodges inside the parks. These stays were always our favorites because we didn’t lose time driving to the gates every morning. Being surrounded by nature also made the experience feel richer. In some camps we saw elephants right outside, and in others they said you could even hear lions roar at night, although we weren’t lucky enough to catch that. Waking up and already being in the park made the days flow more smoothly.\nFlying between parks When planning, we didn’t even think about flying between parks. After experiencing the endless drives, though, we realized that taking small planes is worth considering if your budget allows. Some transfers took six hours or more on rough, bumpy roads, which locals call “African massage.” Flying would save a lot of energy and give you more time to actually enjoy the parks.\nExpect long hours in the car A safari means spending a lot of time inside a vehicle. Some days, we were in the car for 10 to 12 hours. At first, the excitement makes the hours fly by, but after a week, the fatigue sets in. It helps to be mentally prepared, bring something to read or listen to, and take breaks when possible. If you are prone to motion sickness, don’t underestimate it. As an example, my wife felt unwell almost every day after the third day.\nNature calls in the bush Since you spend so much time in the parks, be ready to answer nature’s call in the bush. Most drivers will find a safe spot if you need it, but it is not always comfortable. Bringing biodegradable wipes or toilet paper can make things easier. And if you get motion sickness, don’t be surprised if you need to stop for that too.\nSunsets are worth stopping for The sunsets, especially in the Serengeti, were breathtaking. Some of our favorite moments were simply sitting in the vehicle as the sky turned gold and red over the plains. Don’t rush back to camp and ask your driver to stop so you can enjoy it, or take in the view from the lodge if you arrive early. Those quiet minutes watching the sun sink below the horizon were worth as much as any animal sighting.\nDrivers joining meals One thing that surprised us was that in some lodges, the guides sat with us at dinner. While it was nice to get to know them better, after 12 hours together in the car we were hoping for a quiet, romantic dinner just the two of us. It is something to be aware of as some may appreciate the company, others may prefer more privacy.\nBorder crossings Crossing from Kenya to Tanzania and back again was smoother than we expected, but it still took time and patience. There were lines, forms to fill out, and some waiting around in the sun. Having all documents ready made the process easier. It was not stressful, but it is good to know that it adds at least an hour to the journey.\nEarly mornings and long days Most days started around six in the morning and finished by late afternoon or early evening. This rhythm means you are often up before sunrise and back at camp just in time for dinner. It was exciting in the beginning, but after several days, it became physically demanding. A safari is not a relaxing holiday; it is an active one, and it helps to be prepared for that pace. In the last days, we were asking to be back at the hotel earlier and leave later so we could rest more.\nCrowding at sightings Not every animal sighting is serene. In places like the Masai Mara, when a leopard was spotted, dozens of vehicles would rush in. The drivers pushed for the best angle, and it sometimes felt chaotic. In contrast, parks like Tarangire or Lake Nakuru felt calmer and more intimate. Both experiences are part of a safari, but it is useful to know that the most famous parks can also be the most crowded.\nHealth and food safety We were very careful with what we ate and drank, and that paid off. Sticking to hotel meals, avoiding street food, and drinking only bottled or provided water meant we stayed healthy for the entire trip. It might sound restrictive, but being sick in the middle of a safari would have ruined the experience. A little caution is worth it.\nPhotography considerations If photography is important to you, bringing the right equipment makes a huge difference. We used a Canon EOS R7 with an 18–150mm kit lens for general use and a 100–400mm telephoto for distant wildlife. The telephoto lens was essential for capturing animals that stayed far away, while the 18–150mm allowed us to photograph landscapes and closer animals without constantly changing lenses.\nTaking photos with the new camera\nThe parks are dusty, so keeping your camera gear covered and cleaning it regularly is essential. Fast memory cards are also important for continuous shooting, and having multiple smaller cards makes backups easier and reduces the risk of losing all your photos. There are endless opportunities for photos, from close-up animal portraits to dramatic landscapes. A safari is a photographer’s dream, but it requires preparation, patience, and some lens switching along the way.\nIf you’re interested in high-resolution versions of some photos, they are available on Adobe Stock.\nChoosing the right level of lodging We were happy with the mid-range lodges we chose. They were comfortable, well-run, and always clean. In the end, we did not spend much time at the lodges, since game drives filled most of the day. For us, paying for luxury would not have been worth it, but mid-range gave us comfort without feeling extravagant. The experience outside the lodge was always the real highlight.\nBeyond the practical advice, there are also the feelings and memories that shaped this trip. Here is what stood out most for us when we look back.\nFinal Thoughts Looking back, this safari gave us some of the most unforgettable moments of our travels. Seeing a lioness hunt a wildebeest in Tarangire, watching cheetah cubs play, or waiting for hours by the Mara River before the wildebeest finally leapt into the water are memories that will stay with us forever. The landscapes were just as impressive as the animals, from the calm waters of Lake Nakuru to the wide-open plains of the Mara, the volcanic walls of Ngorongoro, the baobab forests of Tarangire, and the swamps of Amboseli. Evenings by a fire pit, with the sounds of nature in the background, gave us the quiet moments to take it all in.\nIf we were to do it again, we would plan a shorter trip. Ten days felt too long, and the endless hours on rough roads left us tired. Seven days would have been enough to see everything we wanted while still leaving time to rest. We also learned the value of staying inside the parks. The camps within the reserves gave us the richest experiences, with elephants walking near the tents or the chance to hear lions in the distance at night. Flights between parks are also worth considering, since they would save energy and give more time for what really matters.\nThis kind of trip is best suited for those who love wildlife and nature and for travelers who do not mind long days in a car. Couples and small groups who value comfort without luxury will also find it a perfect fit. For us, it was a journey full of wonder, patience, and discovery. Every day offered something unique, and it reminded us why we had chosen Africa at the top of our list.\nIf you’d like to see more from this trip, I put together a gallery with all the animals we saw, and some photos are available on Adobe Stock.\nCheers, and if a safari is on your list too, I hope this helps you plan the adventure of a lifetime.\n","permalink":"https://luizvieira.me/kenya-tanzania-safari/","summary":"Join us on a 10-day safari through Kenya and Tanzania’s top parks, with wildlife encounters, lessons, and tips for future travelers.","title":"Kenya and Tanzania Safari: 10 Days in Africa’s Best Parks"},{"content":"Being an “amateur photographer” is a broad label, but it is the one I am using to justify buying a new mirrorless camera. When my wife first suggested it, my immediate reaction was a firm no. I had owned one about ten years ago, and while I used it enthusiastically at first, it eventually ended up tucked away in storage.\nThis time, though, the idea stayed with me. After some deliberation, I began to feel excited again, especially with two trips on the horizon: an African safari and a visit to Brazil.\nOn safari, you are rarely right next to the animals. Zoom is essential. The latest iPhone offers a 5x optical zoom, which is impressive for a phone, but it still felt too limited to capture the kind of close-up wildlife shots we imagined. Since a safari is not something we expect to repeat, it felt worth investing in gear that could do justice to the experience. At worst, if the camera ended up unused afterward, we could sell it and take the financial hit.\nThe Camera Once I committed to buying a camera, the harder question was which one to get. I wanted something better than a phone, but not so expensive that it would feel extravagant.\nI looked at Canon, Nikon, and Sony, but settled on Canon. I had used one before and liked their lens lineup. Deciding on the model took months.\nI first considered the Canon EOS R50, then the R100, but eventually landed on the Canon EOS R7. Two features convinced me: in-body stabilization, which is very helpful when shooting with a long telephoto lens, and dual card slots, which provide instant backups. I skipped full-frame models since they were far more expensive and not something I really needed.\nCanon EOS R7 with 18-150mm and 100-400mm lenses\nThe Lenses Choosing lenses was just as challenging as choosing the body.\nCanon RF-S 18–150mm F3.5–6.3 This choice was straightforward. It is the kit lens, versatile enough for everyday use, and works well in a variety of situations.\nCanon RF 100–400mm F5.6–8 IS USM The telephoto choice took more thought. I wanted reach, but not at the cost of portability or price. A massive lens would have been impractical for travel and hiking. The RF 100–400mm struck the right balance: light enough to carry, with plenty of zoom to capture wildlife.\nCanon RF 50mm F1.8 STM I also picked up a 50mm prime for portraits and low-light shots. It was affordable and adds flexibility for situations where depth of field or light-gathering power matters.\nMemory Cards Fast memory cards were also important, since I planned to use continuous shooting. I chose Lexar 128GB Professional Silver PRO SD cards, which support UHS-II with a minimum V60 write speed.\nI bought several smaller cards instead of one large one. Having multiple 128GB cards reduces the risk of losing all photos if a card fails, and it also makes backups easier.\nOn Safari With the Camera Now that the safari is behind us, I can say with certainty that buying the camera was the right choice. Some animals came very close, but many did not, and the telephoto lens made it possible to capture detailed, memorable shots. I still remember the first time I zoomed in on a lion resting under a tree. The level of detail was incredible, and that moment alone made the purchase feel worthwhile. I almost used it as binoculars.\nTaking photos with the new camera\nThe parks were dusty, so keeping the camera covered was essential. Changing lenses inside the vehicle worked well, but it required some care to avoid dust getting inside or dropping it on the floor. For most of the trip, the 100–400mm stayed on the camera, while the 18–150mm was useful for landscapes and closer animals. I hardly used the 50mm.\nHaving multiple memory cards also proved to be the right decision. Shooting in bursts for action moments, like wildebeest crossing a river or lion cubs playing, quickly filled up space. Splitting photos across cards reduced the risk of losing everything in case of failure.\nLessons Learned Looking back, here are the key takeaways that might help if you are planning to bring a camera on safari:\nA telephoto lens is essential. Most animals will be too far away for a phone or a short zoom. Something in the 100–400mm range is a great balance of reach and portability. Stabilization matters. Long drives are bumpy, and even when parked the ground is not perfectly stable. In-body stabilization made a noticeable difference. Protect against dust. Dust is everywhere. Keep your gear covered, bring a cleaning kit, and avoid changing lenses when the car is moving. Multiple cards are safer. Several smaller memory cards are better than one big one. They reduce the risk of losing all photos and make backups easier. Portability counts. Large professional lenses may offer better quality, but they are heavy, expensive, and difficult to manage in a safari vehicle. A mid-range telephoto is more practical. Know your gear before you go. Practicing with the camera at home saved time in the field. Learning the menus and settings ahead of time meant I could focus on the animals, not the controls. Final Thoughts The Canon R7 and the lenses I chose proved to be the right setup. The telephoto gave us the wildlife photos we had dreamed of, and the mid-range zoom handled everything else. I still do not know if the camera will stay in use or eventually gather dust again, but for now it has already paid for itself in memories.\nIf you want to see some of the results, I put together a gallery of the animals we saw on safari, and some high-resolution versions are available on Adobe Stock. I also used this setup again in our 9-day Iceland Ring Road trip itinerary in May, where it helped with puffins and landscapes, and later in our 5 days in Alaska for eagles, whales, and glaciers. I also took it to the Abbotsford Airshow.\n","permalink":"https://luizvieira.me/canon-eos-r7-setup/","summary":"How buying a Canon EOS R7 and lenses for our safari trip led me to embrace the role of amateur photographer.","title":"Why I Bought a Camera for Our Safari"},{"content":"Since the first year I moved to Vancouver, I wanted to see the Abbotsford Airshow, but I kind of forgot about it and only remembered to sign up when I saw the airplanes flying around. This year, I put it in my calendar very early, and I was able to buy the tickets, and for the first time, we went to the Abbotsford Airshow.\nAs it was my first time, everything was new. I didn’t know how this should work much, just that there were airplanes and some demos.\nThe sun was relentless, and the temperature soared to a sweltering 30°C. I was glad that we had a beach umbrella and some chairs in the trunk so we could stay out of the sun a bit.\nThe schedule contained planes like C-17 Globemaster/KC-46 Pegasus, F-35 Lightning II, CF-18 Hornet, MiG-17 Fresco, EA-18 Growler Demo, and the Canadian Snowbirds.\nFighter Jets It was really better than expected. I was able to see really nice fighter planes like F-35 flying, and the best thing is to hear the roar of the engines. They are such powerful machines, that’s incredible. It is really nice how humans can build something like that.\nF-35 Flying in low speed\nOne thing that caught my attention a lot was the condensation trails (a new term for me), which are those stunning, temporary clouds of vapor that formed as the jets performed high-G maneuvers. It was really amazing to see it.\nF-35 condensation trails\nThere was a nice and colourful plane which was not on schedule, but it was beautiful to see.\nPlane with smoke and Mount Baker\nThe CF-18 Hornet was really nice as well. There were 2, so it was good to see them flying together\nCF-18 Hornet\nAnother fighter jet that made the event special was the EA-18 Growler, which was also powerful and with very good maneuvers. There were two in the demo, which made it even better.\nEA-18 Growler\nWing Walking Another surprise was the wing walking. I never saw this before, and it was crazy. I was so impressed by the craziness (or courage) of the person to stand in an airplane like that. I know they are tied to it, but I wouldn’t do it anyway.\nPerson Wing walking with Mount Baker at the background\nCanadian Snowbirds And the last attraction was the most beautiful one. It was the Canadian Snowbirds in a choreographic flight.\nCanadian Snowbirds in formation\nIt is amazing how they can be so precise during maneuvers like that. This kind of expertise required for doing this is something that impresses me.\nCanadian Snowbirds in formation\nPhotographing the Airshow The airshow was also the perfect opportunity to test out my new camera and lens. I was trying to capture some shots of the airplanes against the sky, and I think I managed to get a few good ones. I\u0026rsquo;ll let you be the judge!\nI\u0026rsquo;m already looking forward to going back next week and seeing what they will have.\nCheers.\n","permalink":"https://luizvieira.me/abbotsford-airshow-2025/","summary":"My first time at the Abbotsford Airshow was an unforgettable experience. From roaring jets to the Canadian Snowbirds, here’s my personal review.","title":"Abbotsford Airshow 2025: From F-35s to Snowbirds"},{"content":"It has been two years since I archived my Instagram account. I haven’t used Facebook or Twitter for a long time, and Instagram was the last platform I was actively on. I still have LinkedIn, but I don’t have the app and rarely check it. I also use WhatsApp, but only for messaging.\nAt first, I missed Instagram a little. It was one of my go-to ways to escape boredom. I wasn’t a heavy user, but I would often catch myself mindlessly opening the app out of habit.\nTo others, it felt strange. People would ask why I left, almost like I was doing something wrong. Over time, I got used to it, and overall, the experience has been positive for me.\nOf course, social media isn’t all bad. It has its benefits too. In this post, I’ll share what I’ve noticed in these two years away from it. These are personal observations based on my own habits and behavior, and they may not apply to everyone.\nBenefits of not having social media Not having social media has proven to have some benefits for me.\nMore connection with real people I used to spend a lot of my social energy on shallow interactions online. That left me with less motivation to build deeper, real-world relationships. Social media gave the illusion of connection, but it often lacked substance.\nBrené Brown expresses the same in the episode Esther Perel on New AI – Artificial Intimacy\nReal connections need friction Online relationships are low-friction. You follow who you like, and interactions are mostly likes, comments, and emojis. But real relationships are messy. They take effort, vulnerability, and patience, things we don’t practice much online.\nWhen we avoid small moments of conflict or awkwardness, we don’t build resilience. It’s like skipping small fires in a forest until, eventually, a big one hits, and we’re not ready.\nWe value the experience more On social media, it’s common to tie the value of an experience to how it performs in a post. Instead of enjoying the moment, we think about how it will look in a story or how many likes it will get. This becomes especially clear when people are together but are focused on taking photos or videos instead of simply enjoying the moment.\nNot having an easy escape from boredom Social media is a very easy and low-effort way to avoid boredom. You open the app and scroll through endless content.\nSometimes, that can be relaxing. But often, it replaces other activities that require more effort to start, like reading, journaling, or learning something new. For example, it might take a few minutes to focus and get into the flow of reading a book. That initial hurdle becomes harder to get through when a distraction is only one tap away.\nLess of the \u0026ldquo;grass is greener\u0026rdquo; feeling Historically, people compared themselves with their local community. Now, we compare ourselves with the entire world.\nEven when we’re not consciously doing it, it still affects us. We see people on dream vacations, with perfect homes or perfect partners. And we compare that to our own reality, which we know includes struggles, setbacks, and boring moments.\nSocial media also encourages performance. People don’t just show their lives, they show the version of their lives they want others to see. It becomes easy to compare our actual lives to other people’s highlight reels, and that can quietly make us feel inadequate.\nDrawbacks of not having social media Even though there are many benefits, I also miss a few things about social media.\nMissing the memes This might sound silly, but I do miss the memes. They brought quick laughs, clever takes on daily life, and a shared sense of humor. They were one of my favorite parts of being online.\nEffortlessly discovering new things One thing I miss is how easy it was to discover interesting places. If someone you follow went on a nice hike or visited a cool restaurant, you would see it without even trying. This still happens a bit, thanks to my wife, who still uses Instagram. A few times, we’ve found great spots nearby just because someone she follows posted about it.\nMissing the chance to share achievements We all like to share personal wins, whether they’re about fitness, work, or something else. Instagram was a place where I could post a tough hike, a gym milestone, or another small victory, and feel a little bit of pride and encouragement.\nNow, I still do those things for myself, but I sometimes miss having a space to share them more publicly.\nGetting recent information about places Another thing I miss is checking recent updates about places. On Instagram, you could look up a restaurant or hiking trail and see the latest photos and comments from real people. I still use Google Maps and reviews, but they’re often not as current or visual. Instagram gave a more immediate sense of what to expect.\nFinal Thoughts Quitting social media wasn’t a huge decision at the time, but looking back, it had a real impact on how I spend my time and connect with others. It helped me be more present, more intentional, and less reactive.\nThere are things I miss, and I’m not against social media in general. It can be fun, helpful, and meaningful depending on how you use it. But for me, stepping away created space for things that matter more.\nOne thing I did not expect was trading one loop for another. I later found myself wondering whether agentic AI was filling the same gap. I wrote about that in Is Agentic AI Like a Drug?\nCheers.\n","permalink":"https://luizvieira.me/two-years-without-social-media/","summary":"Two years without social media brought more presence, deeper connections, and fewer distractions, but I still miss a few things like memes and discovery","title":"Two Years Without Social Media: What I Gained and Miss"},{"content":"I first heard about the book The Culture Map on the Worklife with Adam Grant podcast, and I immediately got interested in it as I work in a multi-cultural team.\nIn the company that I work for, we have people from all around the world. I work directly with people from Canada, but also those who came from India, China, Ukraine, etc. And sometimes I wondered if some of the communication barriers were due to personal differences or cultural ones. I got this book in the hope it would help me better understand this.\nLet\u0026rsquo;s explore The Culture Map: Breaking Through the Invisible Boundaries of Global Business.\nLearnings from the book The Culture Map This book is really interesting, and it confirmed some things I felt about myself and my country of origin, and also gave me a lot of insights about how to work with people from other cultures. Being an immigrant here, everyone is not part of the culture I grew up in and the things that worked there do not always work here.\nThe book presents eight scales and ranks some of the countries in each scale, making it easy to compare the position of one country relative to the other in the scale.\nI learned a lot from the book and would like to share the top 5 learnings from the book, The Culture Map.\nmulticultural team needs low-context communication The book explains the concept of high and low context communication. In a high-context culture, communication is more implicit; you don\u0026rsquo;t spell out everything, and usually there is some meaning that is caught by context. Whereas in low-context cultures, the communication is simple, clear, and explicit, sometimes stating the obvious.\nBut when you are in a team with people from high-context cultures and low-context cultures, the best approach, according to the author, is to use the low-context communication.\nEven though you run the risk of stating the obvious for people of high-context, you will have fewer problems of miscommunication when you leave things more explicit.\nThis is very useful for me, as Canada is very low-context relative to Brazil.\na long marriage is a high-context communication Not related to the culture, but just a fun fact, is that a long marriage has a bunch of high-context communications. When you are with your partner for a while, they don\u0026rsquo;t need to say much (sometimes don\u0026rsquo;t need to say anything), just for the other person to get the message.\nIn my case, when my wife does a different \u0026ldquo;hmm” I understand if she agrees, disagrees, likes it, does not like it, etc.\ndirect communication does not mean direct feedback I was surprised to learn that direct communication does not mean direct feedback. Like the US and Canada, they are famous for being a place where people are direct with each other in life, but when it comes to giving negative feedback, they are very indirect, usually trying to place the negative feedback between positives so the person does not feel bad.\nBut in other places, like Spain, where the communication is more indirect, they give negative feedback more directly.\nJust because the communication is direct in a culture, does not mean they are direct in negative feedback. The book has two scales for it, one for communication and the other for evaluation.\ninvest in relationships I knew before that Brazilians value the relationship a lot. In all the places that I worked, I saw that visibly. It was nice to see that the book also noted that. Brazil is at the far end of the scale between task-based trust and relationship trust.\nIf you work in a multi-cultural team, according to the author, it is a safer bet to err on the side of the relationship, even though you come from places like the US, which is task-based. As the author mentions, “As a general rule of thumb, investing extra time developing a relationship-based approach will pay dividends when working with people from around the world.”\nbeing punctual sometimes is being early One thing I didn\u0026rsquo;t like in the workplace in Brazil was that being late was common. I was an exception there (and probably that\u0026rsquo;s why I like working in Canada), and I was (almost) always punctual.\nIf that\u0026rsquo;s true for work, for social events, it is even worse. People get to places 30 to 60 minutes late. And if you are on time, sometimes you are too early, and even the host is not ready.\nWhile that was nothing new for me, the reason why some countries, like Brazil, are like that is a good learning experience for me. Countries with a more linear-time (more punctual) tend to be places more developed, where they were heavily industrialized for many years. Things are more reliable (like trains, government), so you can schedule things, and the environment is going to be less likely to interfere with it.\nNow, in countries with a more flexible-time, there are many aspects that can interfere with daily life, like nature, unstable governments, etc. So they need flexibility.\nWhile it is not an excuse for it nowadays, it is a good explanation for why it is the way it is.\nFavorite quotes These are my 5 favorite quotes from the book:\n“Knowing the level of indirection of the assumptions of certain cultures help us better adapt to the situation“ “Culture has impacted your communication, yet in the absence of the visual and contextual cues that physical presence provides, you didn\u0026rsquo;t even recognize that something cultural was going on.” “High-context cultures tend to have a long shared history.” “After all, in countries like the United States or Switzerland, \u0026ldquo;business is business.\u0026rdquo; In countries like China or Brazil, \u0026ldquo;business is personal.\u0026quot;” “Trust is like insurance – it\u0026rsquo;s an investment you need to make up front, before the need arises.” Other resources This section adds extra insights, incorporating content from other sources that align with the themes of the book. Worklife with Adam Grant podcast episode Decoding cross-cultural communication with Erin Meyer\nThese are my learnings from the book The Culture Map: Breaking Through the Invisible Boundaries of Global Business, written by Erin Meyer. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\n","permalink":"https://luizvieira.me/learnings-book-the-culture-map/","summary":"These are my learnings from the book The Culture Map: Breaking Through the Invisible Boundaries of Global Business","title":"Learnings from the book The Culture Map"},{"content":"I recently had to define testing guidelines for my company and even though I already knew a fair bit about testing, I decided to start from the basics to see if I had missed anything or misunderstood certain concepts. It was also a good way to compare what I do in practice with the ideal approach.\nA coworker recommended Unit Testing: Principles, Practices, and Patterns, a book that was already on his reading list. I found it valuable as it starts with the fundamentals and answers many common questions developers have about testing.\nLearnings from the Book Unit Testing Unit Testing book cover\nEven with prior knowledge, I learned a few important things. Here are my top five takeaways from the book.\nClassic vs. London Style I wasn’t aware that there are two main approaches to unit testing, especially regarding mocking. These are known as the classic and London styles.\nThe London school focuses on isolating the system under test from all its collaborators. If a class has dependencies, they are replaced with mocks to ensure the test only evaluates the class itself.\nThe classic school takes a different approach, mocking much less. Instead of replacing dependencies with mocks, it uses production-ready instances, keeping tests closer to real-world scenarios.\nAll Code, Including Tests, Is a Liability This wasn’t entirely new to me, but it served as a great reminder: we write code to solve business problems, and code itself has no inherent value and it’s a liability.\nTests are no exception. They are part of the codebase and exist to ensure the application works correctly. Like any code, they can have bugs and require maintenance.\nWhy Do We Test? There are two main reasons for testing: to assess quality and to prevent known issues from reoccurring. For developers, testing also provides peace of mind.\nWhen we modify code, we want to confirm that the new functionality works as expected. But just as importantly, we need to ensure that nothing else breaks in the process.\n\u0026ldquo;You cannot trust yourself to do the right thing all the time—so, eliminate the very possibility of doing the wrong thing.\u0026rdquo; – Vladimir Khorikov\nWhat Makes a Good Test? A good test has four key attributes:\nProtection against regressions: Ensures existing features still work after new changes. Resistance to refactoring: Should remain valid even if the underlying code is refactored. Fast feedback: Faster tests make it easier to catch and fix issues quickly. Maintainability: Tests should be easy to understand and run. Black-Box vs. White-Box Testing Another key concept in test automation is the distinction between black-box and white-box testing.\nBlack-box testing examines a system’s functionality without considering its internal structure. It’s based on specifications and requirements, focusing on what the system does rather than how it does it. White-box testing does the opposite. It verifies the internal workings of the system, deriving tests from the source code rather than from requirements. According to the author, a test is either resistant to refactoring or it isn’t and there’s no middle ground. That’s why black-box testing should be the default choice. Regardless of the test type (unit, integration, or end-to-end) the focus should be on verifying behavior that matters to the problem domain. If a test doesn’t trace back to a business requirement, it’s a red flag. Either restructure or delete it, but don’t let it into the suite as-is.\nThis book reinforced some key principles while introducing me to new perspectives on unit testing. It’s a great read for anyone looking to improve their testing approach.\nThese are my learnings from the book Unit Testing: Principles, Practices, and Patterns by Vladimir Khorikov.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-unit-testing/","summary":"These are my learnings from the book Unit Testing: Principles, Practices, and Patterns","title":"Learnings from the book Unit Testing"},{"content":"I am a very bad storyteller. I don\u0026rsquo;t usually have stories that I find interesting to share with others, and when I do, I never tell them in an interesting way. I admire people who can tell a good story at a dinner table and engage everyone, making them laugh, think, and feel with the story.\nIn an effort to be less boring, I picked up the book Storyworthy to try to learn a bit more about storytelling and become a little more interesting. I first heard about the book on an episode of The Knowledge Project with Shane Parrish, which I listen to a lot.\nNow, let\u0026rsquo;s explore Storyworthy: Engage, Teach, Persuade, and Change Your Life through the Power of Storytelling.\nLearnings from the book Storyworthy Storyworthy book\nThe book is a great resource for people wanting to be better storytellers. It provides very useful and practical tips on how to identify, craft, and tell a good story. I learned a lot from it and would like to share my top five takeaways.\nKeep a list of daily possible stories I already keep a journal where I reflect on the day and list things I did or paid attention to, but the author suggests a slightly different approach called Homework for Life. The idea is to write down one sentence every day about something from your day that could potentially be a story. The goal is to track the most emotional parts of your day, which you can later revisit to find meaningful stories.\nThe author keeps a spreadsheet with a one-liner for each day. I do it a bit differently by using an Obsidian document for each year. No matter the method, the point is to keep a list of moments that could become stories so you can easily revisit them.\nA story is not just an account of events I learned that telling a story is not just describing what happened step by step. A story must connect. It should make people feel what you felt, whether that\u0026rsquo;s laughter, sadness, anger, or joy.\nThink about your story like a movie The author gives a great analogy: when you create a story, imagine you\u0026rsquo;re creating a movie in people\u0026rsquo;s heads. The goal is for your audience to forget where they are and what they\u0026rsquo;re doing, fully immersing themselves in the mental movie you\u0026rsquo;re creating with your words.\nOne tip from the book is to always include a location to make it easier for people to picture the scene. You don\u0026rsquo;t need to describe the place in detail; simply naming it helps the audience visualize the story more easily.\nNegative is almost always better Another interesting takeaway is that negative descriptions are often better than positive ones in storytelling. Saying what something or someone is not tends to be more engaging than saying what they are.\nFor example, instead of saying \u0026ldquo;I am dumb, ugly, and unpopular\u0026rdquo; you could say \u0026ldquo;I\u0026rsquo;m not smart, I\u0026rsquo;m not at all good-looking, and no one likes me.\u0026rdquo; The second version is more effective because it suggests possibilities (I could be smart or good-looking) while the first version only labels things.\nBe entertaining The final learning I want to share is one I fully agree with: when people are listening to your story, they are giving you their time and attention. Nothing is more important than that. If they are willing to listen, you owe it to them to be entertaining.\nAs the book points out, ”When you are entertaining, people learn better. You convey information more effectively. You will become a better teacher, presenter, coach, salesperson, trainer, CEO, professor, parent, and dinner companion.”\nFavorite quotes These are my 5 favorite quotes from the book.\n”Telling stories about your life lets people know they\u0026rsquo;re not alone; and it lets some of the people closest to you — like family and loved ones — see your life apart from the context of family and without the kind of revisionist hindsight we can sometimes fall into concerning the ones we love most.” ”We all have stories. You may not believe this yet, but you will.” ”We tell stories to express our hardest, best, most authentic truths. This is what brings thousands of people to hear stories at theaters and bars every night in cities all over the world.” ”Tell a story about a real moment of meaning from your life — a five-second moment — and people will want to hear more.” ”When it comes to storytelling, I believe that surprise is the only way to elicit an emotional reaction from your audience.” Other resources This section adds extra insights, incorporating content from other sources that align with the themes of the book.\nThe Knowledge Project with Shane Parrish podcast episode #202 Matthew Dicks: The Storytelling Expert These are my learnings from the book Storyworthy: Engage, Teach, Persuade, and Change Your Life through the Power of Storytelling by Matthew Dicks. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-storyworthy/","summary":"These are my learnings from the book Storyworthy: Engage, Teach, Persuade, and Change Your Life through the Power of Storytelling","title":"Learnings from the book Storyworthy"},{"content":"Ever since I read Outlive: The Science and Art of Longevity, I was curious to take a DEXA scan since it’s supposed to be the most precise way to measure body fat percentage. But the cost was a big downside \u0026mdash; most options I found were over $200.\nFor body composition, I have been using a cheap bioimpedance scale, the Renpho Body Fat Scale (ES-30M). Since it’s a simple scale, its accuracy isn’t great, and what I don’t like is how much the measurements fluctuate. The fat percentage changes every time I step on it, which makes me feel like it’s just estimating based on weight rather than actually measuring it.\nI even considered getting a better body fat scale, but none seemed to offer a real improvement. Even the high-end ones that claim to be precise had plenty of reviews saying otherwise. So I gave up on that idea.\nFinding an Affordable DEXA Scan As for the DEXA scan, the high price kept me away. It was around $250 for a single scan, which felt too expensive just to satisfy my curiosity about my body fat percentage.\nThen I came across a new place called BodyStats that was about to open in Vancouver. They were in the process of getting licensed, and their website mentioned offering better prices. I decided to wait until they opened.\nThey finally opened recently, and I did my scan last week. I was able to get their opening price of $30 (the regular price is supposed to be around $100), which was a great deal for something I had been wanting to try for a long time.\nThe place is small, but it has everything needed for the scan. The process was really straightforward, and the staff was friendly and professional. The results came immediately \u0026mdash; both by email and as a printed copy.\nDEXA vs Renpho Results Here’s what surprised me the most about the result:\nMy main goal was to get a more accurate body fat measurement compared to my Renpho scale. But in the end, it was disappointing. Somehow, both the DEXA and the Renpho showed the exact same body fat percentage. Maybe it was a coincidence, but I was expecting different values.\nIn the morning, I weighed myself at home, and this was my Renpho reading.\nRenpho measurement\nAt 4 PM, I did the DEXA scan, and the fat percentage was identical.\nDexa measurement\nOf course, the DEXA scan provides a lot more detail, like fat distribution per body part and bone mineral content. But I was mostly interested in just the fat percentage.\nOne fun fact I learned is that while my right arm is heavier than my left, my left leg is heavier than my right. Another interesting thing was to know the visceral fat weight.\nI might do another DEXA scan at the end of the year to compare the progress so I can check if the measurement changed during the year. But I am a lot less interested now as most of the health improvement can be seen visually.\nCheers.\n","permalink":"https://luizvieira.me/first-dexa-scan/","summary":"I tried a DEXA scan to compare it with my Renpho scale. The results surprised me \u0026mdash; was it worth it? Here’s my experience.","title":"My First DEXA Scan: Was It Worth It?"},{"content":"The first time I heard the term \u0026ldquo;task snacking\u0026rdquo; was in the book The Staff Engineer\u0026rsquo;s Path. It instantly resonated with me because I realized I had been doing it for years without knowing what to call it. I often found myself tackling small, easy tasks instead of facing the bigger, more challenging work that truly mattered.\nWhat Is Task Snacking? Like snacking on food, task snacking is when you focus on small, low-effort tasks instead of tackling bigger, more important work. Sometimes, this happens because you\u0026rsquo;re procrastinating on a difficult task that requires more thought and effort but would have a bigger impact.\nFor example, when you have a big task that requires deep thinking \u0026mdash; maybe writing a rollout strategy or a detailed document \u0026mdash; it can feel overwhelming. Instead of facing it, you might pick up a smaller task that takes less energy. You still feel productive because you\u0026rsquo;re getting things done, but at the end of the day, the big task is left unfinished.\nMy Experience with Task Snacking I struggled (and sometimes still do) with task snacking. I like to stay active, and I don’t enjoy waiting or feeling like I’m not making progress. So, I often find myself upgrading dependencies in my services or making small improvements that aren’t urgent. My previous manager once told me that I should focus only on tasks that are both important and urgent. The tasks I was snacking on were important in some way, but they weren’t urgent. I felt good about keeping things up to date, but at the same time, I was delaying the work that really mattered.\nWhen Task Snacking Helps I’m not against task snacking (I do it sometimes). It can have benefits. When you’re stuck on a tough problem, stepping away to do a smaller task can help clear your mind. When you come back, you might have a fresh perspective and find a solution more easily. The danger is when you never return to the big task and just keep snacking instead.\nSometimes, though, what you really need isn’t more work \u0026mdash; it’s rest. As the book says, “When you’re tired, snacking can feel easier than resting. Notice when you’re doing busywork because you’re tired, and find a way to rest instead.”\nWorking on a Platform Team, I often get pulled into interesting problems from other teams. Since I enjoy solving challenges, I sometimes snack on helping others instead of focusing on my own priorities. While this can lead to great insights and collaboration, it also means my main tasks get pushed aside.\nJust like snacking on junk food can ruin your appetite for a real meal, task snacking can take away time and energy from your most important work. Have you noticed yourself snacking on tasks instead of tackling bigger challenges? What steps can you take to stay focused on what truly matters? The key is being aware of it and making sure it doesn’t take over.\nI also see a version of this in the age of AI. The tools can make us feel like more parallel activity automatically means more progress, but that is not always true. I wrote more about that in Why Async Agentic AI Does Not Mean Free Productivity.\nCheers.\n","permalink":"https://luizvieira.me/task-snacking/","summary":"Task snacking feels productive but can keep you from meaningful work. Stay aware, balance small tasks with big ones, and make sure progress truly matters","title":"Why Task Snacking Feels Productive But Holds You Back"},{"content":"Growing up in the Southern Hemisphere, Christmas and New Year\u0026rsquo;s always meant summer, beach parties, and waiting for the midnight countdown in the warm air. The beaches were packed, people were cheering, and the energy was high as we welcomed the new year.\nHere in the Northern Hemisphere, it\u0026rsquo;s a completely different story. It’s cold, and no one is outside counting down to midnight. At least not in Vancouver, where we don’t even have fireworks for New Year’s.\nSo, we started looking for a place with a bigger celebration \u0026mdash; somewhere with crowds, energy, and a real New Year\u0026rsquo;s vibe. That’s how we ended up choosing Las Vegas. It’s just a short three-hour flight from Vancouver, and while it wasn’t as warm as we had hoped, it was definitely more alive, with streets full of people celebrating.\nWe spent about seven nights in Vegas, including New Year\u0026rsquo;s Eve. In this post, we’ll share a bit about our experience, what we did, and what you can expect if you’re planning a trip.\nOh, and we also took a trip to the Grand Canyon during our stay. If you’re interested in that, check out our post One Day at the Grand Canyon.\nFirst Impressions of Vegas The first thing that stood out in Vegas was the lights. The city is stunning at night. Everywhere you look, there are bright neon signs, flashing billboards, and dazzling displays. The Strip is packed with people \u0026mdash; shopping, taking photos in front of famous hotels, or just soaking in the atmosphere.\nAnother unique thing about Vegas is that you can drink on the street. We took full advantage of this since we come from a country where that’s also allowed, but here in Canada, it’s not. It felt like a small freedom we had been missing.\nFor this trip, we weren’t in an exploring mood. Instead, we mostly stayed around the Strip, spending some days just relaxing by the pool and wandering around.\nNew Year Celebration in Vegas This was the main event of the trip (aside from the Grand Canyon), so we were really excited. We heard that most hotels had fireworks, and Bellagio was supposed to have one of the best displays. So, we headed there around 10 PM to find a good spot. It was incredibly crowded. The Strip was closed off, starting near Excalibur, and people filled the entire street.\nWe secured a decent spot in front of Bellagio, but to our surprise, the fireworks didn’t come from there. Most of what we saw was launched from Caesars Palace and Planet Hollywood. Still, the display was beautiful, and the energy of the crowd made it a fun and memorable experience.\nFireworks on New Year\u0026rsquo;s celebration\nThe real challenge was getting back. The streets were packed, and the crowd was pushing and shoving. It even felt a little unsafe at times, with people getting stressed and frustrated. Navigating through the chaos was tough, but eventually, we made it.\nCasinos: Beautiful but Not for Us Casinos in Vegas are both beautiful and overwhelming. If you love gambling, it’s a dream come true \u0026mdash; slot machines, poker tables, blackjack, roulette, you name it. But for us, it wasn’t much of an attraction.\nThat said, we did visit a few casinos just to admire their decorations. The one that stood out the most was Caesars Palace. The details and overall aesthetic were impressive.\nThe downside of casinos? Smoking. The smell of cigarettes is everywhere inside. Another thing we noticed was that most people at the slot machines didn’t look particularly happy. Maybe it was just our perception, but it felt like they were there out of habit rather than excitement.\nCasino in Vegas\nStaying at a Hotel-Casino We stayed at the Luxor, and the room was spacious, with comfortable beds and a great shower. However, there were two big things missing \u0026mdash; a mini-fridge and a coffee maker. For us, these are standard in most hotels, so it was disappointing not to have them. Of course, we understood why. They want you to spend money at their restaurants and cafés instead.\nTo solve this, we bought a small coffee maker for $9.99 at Walmart. It saved us money and made mornings easier.\nAnother thing we didn’t love was the resort fee \u0026mdash; $45 per night on top of the room price. It covered access to the gym and pools, but in our case, the Luxor’s pools were closed, so we had to use a small one at Mandalay Bay instead. It didn’t include extras like a sauna or spa \u0026mdash; those were separate charges.\nBellagio Fountain: A Must-See The Bellagio Fountain is one of the best free attractions in Vegas. Shows run frequently \u0026mdash; every 30 minutes during the day and every 15 minutes at night. Each show features a different song and choreography, and we watched it at least ten times during our stay. It’s smaller than the Dubai Fountain but still an amazing spectacle of water, lights, and music.\nBellagio Fountain in Las Vegas\nGiordano\u0026rsquo;s Deep Dish Pizza: Worth Every Bite Twelve years ago, I tried Giordano’s deep-dish pizza in Chicago, and when I saw they had a location in Vegas, I had to go. I convinced my wife to try it too, and we ordered the “Meat and More Meat” pizza.\nJV getting a slice of Giordano\u0026rsquo;s Pizza\nIt was huge. We got the large one and ended up making three more meals out of it. Definitely worth trying if you’re a pizza lover.\nFantasy: A Classic Vegas Show Staying at the Luxor, we saw endless ads for Fantasy, a classic topless show. Since we weren’t planning on coming back to Vegas anytime soon, we decided to check it out.\nEnd of the Fantasy show which photos were allowed\nIt was worth it. The dancers were amazing, and the performances were really well done. I was especially impressed by Yulia, who did some incredible pole dance and aerial silk moves. She was so strong and skilled that I had to ask for a photo with her after the show.\nStrip Club: A Vegas Curiosity Vegas is known as Sin City, so we figured we should at least check out a strip club to see what it was like. We went to Larry Flynt’s Hustler Club on December 30. Unfortunately, it was a Monday, and the place wasn’t very busy \u0026mdash; maybe one-third full.\nThe performances were good, and the dancers were beautiful. We got a website promotion that included entry and a beer for $20. A good tip: bring cash, especially singles, if you want to tip the dancers. I wouldn’t trust using a card there.\nFlamingos at the Flamingo Hotel The Flamingo Hotel has a small flamingo habitat. If you’ve never seen flamingos up close, it might be worth a stop, but honestly, it was a bit overrated.\nDrinking on the Street One of the biggest differences between Vegas and other US or Canadian cities is that drinking on the street is legal. We saw tons of people walking around with drinks, and of course, we joined in. It was vacation, after all.\nThe “Welcome to Fabulous Las Vegas” Sign A must-see! If you want a photo without waiting in line forever, go early. We waited almost an hour to take our picture. You can take side-angle photos without waiting, but most people want the straight-on shot.\nI wanted this photo because I had been to Vegas 12 years ago and wanted to compare how much I’ve changed. It was fun to see the difference.\n12 years of difference in the The Welcome to Fabolous Las Vegas Sign\nOmnia Nightclub: A Long Night Out We’re not really nightclub people, but we decided to check out Omnia because it’s known for its decoration and space. We didn’t know the DJ, but we took a chance.\nWe arrived around 11 PM, but the real DJ, Luis Torres, didn’t start until 1 AM. Before that, the music wasn’t great, and I was starting to regret not choosing another club where Sam Feldt was playing. But once Torres started, the energy completely changed. The music was better, the effects were amazing, and we ended up staying until 3 AM, way later than we expected.\nOmnia Nightclub lights\nVegas was a fun experience. It wasn’t our usual type of trip, but it was worth it for the atmosphere, the lights, and the overall energy of the city. Would we go again? Maybe, but not anytime soon. If you’ve never been, though, it’s definitely something to experience at least once!\nEarlier that December, we also visited Leavenworth for Christmas.\nCheers.\n","permalink":"https://luizvieira.me/las-vegas-new-year-celebration/","summary":"From fireworks on the Strip to packed casinos and wild crowds, our New Year\u0026rsquo;s trip to Vegas was an unforgettable experience. Here’s what we loved (and didn’t)!","title":"Celebrating New Year’s Eve in Vegas: Highlights \u0026 Surprises"},{"content":"TL;DR When upgrading Spring Boot from 2.7 to 3.2 and replacing Sleuth with Micrometer, I missed enabling automatic context propagation for a reactive WebFlux service. This caused tracing issues where child spans weren’t linked to their parent. Adding a single line of code (Hooks.enableAutomaticContextPropagation()) fixed the problem, enabling proper trace propagation and improving debugging for the team.\nFull tale When we upgraded Spring Boot from version 2.7 to 3.2, we swapped Sleuth for Micrometer. I even wrote a post about that process, where I thoroughly tested MVC services for HTTP, message, and database tracing. However, there was one service \u0026mdash; out of more than 30 \u0026mdash; that I missed. This service is reactive and uses Spring WebFlux.\nWhile I understand the basics of reactive applications, I’m far from an expert. When I did the upgrade for that service, I only checked whether the tracing export was working correctly, and it was.\nBut recently, while helping a team member with that service, I realized something was off. We didn’t have the expected waterfall of spans based on the code execution. We only had the parent trace with no child spans.\nTo investigate, I added some extra spans in the local environment to see if my assumption was right \u0026mdash; that the trace wasn’t propagating properly. Sure enough, I found that the child spans didn’t have the parent ID reference, which is what links the spans together.\nHere’s the code I added:\n@GetMapping(path = [\u0026#34;/my-entity\u0026#34;]) suspend fun get(filter: MyEntityFilter): Page\u0026lt;MyEntity\u0026gt; { tracer.createSubSpan(\u0026#34;JV-test-1\u0026#34;) { } tracer.createSubSpan(\u0026#34;JV-test-2\u0026#34;) { tracer.createSubSpan(\u0026#34;JV-test-3\u0026#34;) { } } //other operations return myEntity.findByFilter(filter) } This code generated the following trace.\nMissing child spans in the distributed trace\nAccording to the code, there should have been three additional spans: (JV-test-1,JV-test-2, and JV-test-3)\nIf we searched for the other spans by name, we could find them, but they didn’t have the right parent reference. They were treated as root spans because their IDs matched the parent span\u0026rsquo;s ID.\nChild spans without link to the parent\nAfter several rounds of debugging, I discovered that adding a single line of code fixed the issue. We simply needed to add this hook:\nHooks.enableAutomaticContextPropagation() And place it in the main function of the StarterApp, like this:\nfun main(args: Array\u0026lt;String\u0026gt;) { SpringApplicationBuilder(StarterApp::class.java) .web(WebApplicationType.REACTIVE) .build() .run(*args) // new line added Hooks.enableAutomaticContextPropagation() } I was reminded of the old saying that the value of a hammer isn’t in the hammer itself, but in knowing where to use it. In this case, expertise \u0026mdash; and knowing where to focus your effort \u0026mdash; was much more valuable than just putting in more work (or, in my case, doing endless Googling).\nOnce I added the line, everything worked as expected.\nComplete distributed trace with all the child spans\nFrom what I understand, the Reactor engine (which WebFlux uses) doesn’t automatically carry thread-local context like an MVC application does. This configuration ensures that trace information propagates properly to child spans, linking them to the parent span.\nI’m happy the fix was simple and worked as expected. Now, the team can better debug and understand their service’s behavior in production. Plus, I learned something new and interesting along the way.\nCheers.\n","permalink":"https://luizvieira.me/micrometer-tracing-spring-webflux-propagation/","summary":"Upgrading to Spring Boot 3.2 revealed tracing issues in a WebFlux service. A single line of code fixed broken span propagation and improved debugging.","title":"Fixing Tracing Propagation in Spring WebFlux in One Line"},{"content":"Going to the Grand Canyon has always been a dream of mine. Even though I had visited 12 years ago, this recent trip felt as special as the first time. Perhaps it’s because I’ve changed a lot over the years. The way I think and appreciate places now is very different from what I valued back then.\nOne of the things I value most now is the opportunity to reflect on how small we are compared to the vastness of the Grand Canyon. The sheer scale of it is humbling. Its oldest layers, located deep in the canyon, date back approximately 1.7 to 2 billion years. Yes, billion, with a B. It’s a powerful reminder of how brief and tiny our lives are in the grand timeline of Earth.\nFor my wife, this was her first visit to the Grand Canyon. Watching her reactions and seeing her marvel at the immense beauty of the place made the experience even more memorable.\nReflection and admiration were the main highlights of our visit, but we also learned a lot and have practical tips to share about the viewpoints. We visited the South Rim, which is considered the best and most accessible of the canyon’s rims. Unfortunately, we only had about eight hours to explore, but we made the most of it. Here’s how we spent our day.\nWhat We Did in One Day at the Grand Canyon We arrived early \u0026mdash; before 8 AM on a Saturday \u0026mdash; so parking wasn’t an issue. If you’re planning to arrive later, keep in mind that parking could be more challenging. Just a few minutes after passing the toll, we spotted a deer herd grazing peacefully in the park. It was a lovely start to our day.\nDeer herd in Grand Canyon\nInitially, we thought about doing a hike, but we decided against it. With only one day, we felt it was better to focus on the viewpoints and enjoy the scenery from different perspectives. Plus, it was colder than we expected. A brisk wind made it feel even chillier than the forecast suggested, so be prepared for the wind if you visit.\n1. Mather Point Mather Point is the easiest and most accessible viewpoint. It’s close to the village and offers a stunning view. This is a must-see, especially if you’re short on time. In my opinion, it’s the best viewpoint of them all.\nMather Point View\nIf you’re feeling adventurous, just beyond Mather Point, there are rocks you can climb down to for a picture on the edge of the canyon. It’s dangerous, so be cautious, but it’s a unique spot.\nMe on a rock just after Mather Point\nWe spent most of our time here, exploring both left and right from the main viewpoint. We also took moments to sit and simply take in the scenery. If you only have a few hours, this is the best place to visit.\n2. Yavapai Point and Geology Museum Yavapai Point offers a broader perspective of the canyon’s immense size. The Geology Museum here is fascinating, with detailed explanations about the rocks, the passage of time, and the canyon’s history. My favorite part was the large model of the Grand Canyon. It really puts into perspective how vast it is.\nTo give you an idea of its size, we drove three and a half hours from the West Rim to the South Rim \u0026mdash; and that distance is just a small fraction of the entire canyon. The scale is truly mind-blowing.\nlarge model of the Grand Canyon\nA quote I really liked from there was by Enos Mills which said \u0026ldquo;Given enough time, nothing is more changeable than rock\u0026rdquo;.\n3. Desert View Desert View is about a 30-minute drive from Mather Point. The drive itself is scenic, with several viewpoints along the way. If you have time, stop at places like Grandview Point to enjoy even more views.\nComplete view of the Desert View viewpoint\nAt Desert View, there’s a historic watchtower, but it was too crowded for us to go up. What we loved most about this spot was the view of the Colorado River, which isn’t as visible from the other viewpoints. The sight of the river winding through the canyon adds another layer of beauty to the experience.\nView of the Desert View viewpoint with the Colorado River\nFinal Thoughts Returning to the Grand Canyon after 12 years was an incredible experience. Seeing it with fresh eyes and sharing it with my wife made it even more special. Her reactions to the sheer beauty and scale of the place were priceless.\nIf you ever have the chance to visit the Grand Canyon, I highly recommend it. It’s a place that leaves a lasting impression and reminds us of the wonders of nature and the vastness of time.\nCheers.\n","permalink":"https://luizvieira.me/grand-canyon-south-rim-day-trip/","summary":"Rediscovering the Grand Canyon: A one-day South Rim adventure filled with breathtaking views, practical tips, and reflections on nature\u0026rsquo;s timeless beauty.","title":"One Day at the Grand Canyon: Exploring the South Rim Views"},{"content":"Close your eyes and picture yourself at 80. Are you climbing a hill, chasing after grandkids, or savoring a life with mobility and energy? This question was a key motivator that made 2024 a turning point in my health journey. Although I’m nowhere near 80 and still far from my ideal fitness goals, 2024 has been my healthiest year so far. I made health a priority by focusing on weight control, cardio, and strength training. I also adopted new habits, like running weekly and embracing strength training, which I had never enjoyed before.\nA Mindset Shift In 2023, I read books that made me reflect deeply on life, death, and what truly matters. These reflections led me to explore more about health and exercise in 2024, sparking action to take better care of myself. To stay organized and focused, I even created my own Pillars of Health.\nLet’s be honest: we don’t need endless books or podcasts to know what’s healthy. Most of us already know the basics; we just don’t act on them. As Morpheus said in The Matrix (1999): \u0026ldquo;There\u0026rsquo;s a difference between knowing the path and walking the path.\u0026rdquo; For me, the key was taking action.\nHere’s a glimpse into what I focused on this year. Perhaps it will inspire you to take a step toward your own health goals.\nRunning This year I also started running. I am not crazy about it and have not participated in any races (yet) but I started with 5K and then increased to 10K. I’m gradually improving my pace, currently completing 10K in about 54 minutes.\nMonthly running distance measured by Apple Watch\nI run once a week, usually on Mondays. While it’s a small step, it has helped me build both endurance and a routine I genuinely enjoy. I track my runs with an Apple Watch and use the Pace mode, which helps me maintain a steady pace and stay on target. I appreciate this feature because it allows me to gradually increase my pace goal and simply follow it during the run.\nStrength Training Starting strength training was a big surprise for both my wife and me. She’d been encouraging me to try it for years, but I always resisted, claiming I didn\u0026rsquo;t like it and it was boring.\nThis year, she persisted, and a few podcasts helped change my mind. Reading Outlive was the tipping point. Two ideas from the book resonated deeply:\nHealth compounds over time. Conditions like atherosclerosis develop silently over the years, only becoming evident when it’s too late. I realized I needed to act now to prevent future problems. Aging and strength. As we age, we naturally lose strength and mobility. To stay independent and enjoy life in later years, we need to build and maintain strength today. I now do strength training at least four times a week for an hour. Initially, I started with three days but quickly upped the goal. Committing to daily workouts makes it easier: there’s no decision to make; it’s simply part of my routine.\nTo help me in the workout, I use the app Fitbod and it is great! I chose the goal \u0026ldquo;Improve conditioning\u0026rdquo; in the app and it gives more high-reps, low-weight resistance exercises with minimal rest to enhance endurance.\nWorkout Summary from Fitbod App in 2024\nI like updating the effort (or the Rate of Perceived Exertion, RPE) so the app can more accurately calculate the weight, number of sets, and repetitions for my next workout. I also appreciate that it tracks the estimated recovery of my muscles and suggests exercises for the muscles that are the most recovered. This helps me train my entire body in an effective and balanced way.\nI’m fortunate to have a well-equipped gym in my building, just an elevator ride away so not many excuses as well.\nWeight Control Weight management has always been a challenge for me (and still is). My target weight has been 75 kg for years, but I’ve struggled to reach it, often hovering in the lower 80s or higher 80s during holidays.\nThis year, I made some progress, briefly hitting my goal before slipping back. The journey continues, but I’m determined to achieve lasting results.\nMonthly weight average in 2024\nThe cornerstone of my approach is simple and effective: calorie counting. I don’t follow trendy diets or extreme regimens. Instead, I track everything I eat and aim for a calorie deficit most days. Weekends are less strict; maintaining balance is my goal as we like to cook and have fun.\nI use the Cronometer app to track my calorie intake. The paid version is ad-free and offers extra features, but the free version works well for most. Since we cook most meals at home, tracking is easier as we can weigh ingredients to ensure accuracy. Tracking calories at home is straightforward since we weigh ingredients, but dining out is trickier without nutritional info from restaurants.\nI weigh myself every morning to better understand and manage my weight. For consistency, I do it right after waking up and using the washroom. I use an affordable RENPHO Body Fat Scale that integrates with Apple Health, which helps me maintain a history of my progress even if I switch scales.\nWalking Walking has been my go-to activity for years. It’s my favorite way to wind down, reflect, and listen to podcasts. This habit has contributed to my impressive podcast listening stats. It’s incredible how much you can absorb during a walk.\nDaily average of walking + running distance in 2024\nWhenever possible, I choose nature for my walks. I’m lucky to live near a beautiful park and enjoy hiking whenever I can.\nExploring Emotions In 2024, I didn’t just focus on physical health; I prioritized emotional health as well.\nAfter listening to several insightful podcasts about emotions, including Dr. Lisa Feldman Barrett: How to Understand Emotions and Dr. Marc Brackett: How to Increase Your Emotional Intelligence, I discovered the How We Feel app. It was recommended in one of the episodes, and I decided to give it a try. My initial goal was to explore my emotions and expand my emotional vocabulary. Emotions, I learned, are far more complex and varied than I had imagined.\nThe app allows you to log your mood by selecting from a set of 144 emotions, categorized into four quadrants: High Energy Unpleasant, High Energy Pleasant, Low Energy Unpleasant, and Low Energy Pleasant.\nBetween September and January, I recorded 297 emotional check-ins. The image below summarizes how my emotions were distributed across the quadrants.\nCheck-in breakdown in the How We Feel App\nAs shown in the image, 45% of my emotions were High Energy Pleasant, 38% were Low Energy Pleasant, 10% were Low Energy Unpleasant, and 7% were High Energy Unpleasant.\nThis process taught me not only new emotion labels but also how to better understand and manage my feelings. For example, while searching for a parking spot at a busy mall, I initially thought I was angry about not finding one. However, when I paused to check in with the app, I realized I was actually feeling frustrated. Recognizing the specific emotion helped me respond more calmly.\nSome of my most frequent emotions were Focused, At Ease, Energized, Fatigued, and Thoughtful. This exploration has given me a deeper understanding of my emotional landscape and the tools to navigate it more effectively.\nSupplementation Before 2024, the only supplement I took was Vitamin D, essential during Vancouver’s cloudy winters. This year, I added a multivitamin to cover any potential deficiencies I was having.\nWith the addition of strength training, I began using whey protein to hit my daily goal of 2g of protein per kg of body weight. While I eat plenty of meat, it is not enough on its own to achieve my protein goal. I don\u0026rsquo;t have a specific brand preference, so I usually buy the most affordable option I find at Costco. Right now, I\u0026rsquo;m using LeanFit.\nWhile not considered a supplement, protein bars have also become a convenient snack. I opt for ones with 20g of protein and around 190 calories from Pure Protein, but I limit myself to one a day. Ideally, I prefer snacks like fruit or none at all.\nSleep Since reading the book Why We Sleep in 2023, sleep has been a key focus for me. As I mentioned in my Pillars of Health, I aim for nine hours of sleep opportunity each night. While I don’t always hit that target, maintaining a consistent sleep schedule remains a top priority.\nAverage asleep time in the last 6 months\nIn 2024, I focused on improving my health by prioritizing weight control, running, strength training, and emotional well-being. Inspired by reflections on long-term health, I built simple, sustainable habits like weekly runs, structured strength workouts, and mindful calorie tracking. Emotional health also became a priority, with tools like the How We Feel app helping me better understand and manage my emotions.\nI worked on maintaining a consistent sleep routine, added some practical supplements, and aimed for a balance between structure and enjoyment. While there’s still room to grow, this year marked meaningful progress toward a healthier, more balanced lifestyle.\nAnd like my goals became purposes, 2024 taught me that health is a journey, not a destination.\nThe story continues in my health and fitness journey in 2025.\nCheers.\n","permalink":"https://luizvieira.me/health-and-fitness-journey-2024/","summary":"2024 has been my healthiest year yet. From running to strength training, I’ve embraced new habits, focusing on consistency over perfection for lasting health.","title":"My Healthiest Year Yet: My 2024 Health and Fitness Journey"},{"content":" With winter upon us, the gardening season has come to an end. This year, I decided to start my very first garden, and in this post, I’ll share the journey and lessons from this new adventure.\nI am no stranger to growing plants. I grew up in the countryside and only moved to the city when I was 17, but I had never created a garden of my own. Earlier this year, I discovered that my building has a shared garden with plots available for rent. I put my name on the list and was lucky enough to be allotted one.\nBeyond growing plants, I was excited about spending more time outdoors and away from screens. As a software engineer, I spend most of my day inside, staring at a screen. Gardening felt like the perfect way to disconnect and enjoy some fresh air. It was also an opportunity to do something fun and collaborative with my wife.\nGarden: From Planting to Harvesting Garden on harvest time\nThe first step was to clean and prepare the plot. I’ll admit, I got a bit obsessive. I measured the 1.60m x 6.10m space and subdivided it into sections to figure out how many different plants I could grow and where to place each one. The plot is not big, but I wanted to make the most of it by trying different things.\nBelow, you’ll find a time-lapse animation showing the garden’s transformation throughout the season. It was incredible to see how much it changed over the months.\nI did something similar with a one-year timelapse of Vancouver.\nGarden timelapse from first planting to last harvesting\nIn total, I planted 19 different types of plants. This might seem ambitious for such a small space, but my goal was to experiment with a variety of options to see what grew well and what I enjoyed. This would help me refine the plan for next year.\nMost of the plants were grown from seeds, but for a few, I bought seedlings to transplant. Here’s a quick rundown of what worked and what didn’t.\nWhat Thrived The herbs were the highlight of my garden. Parsley, grown from seed, and basil, transplanted, grew beautifully, giving me fresh seasoning for my meals every week. There is something magical about stepping outside and picking fresh herbs right before cooking.\nKale, also grown from seed, was another success, although I planted more than my wife and I could eat. Arugula was also a favorite because it grows quickly and requires minimal effort.\nMint turned out to be a pleasant surprise. It thrived and became a staple in our drinks. My wife especially loved adding it to her gin and tonics.\nThe flowers added vibrant color and life to the garden. I planted two varieties of sunflowers, Giant and Sunspot, from seed, and they were stunning when they bloomed. We also transplanted some dahlias, red and white, which were a beautiful addition.\nGarden\u0026rsquo;s sunflower\nTomatoes were a late-season experiment. When Swiss chard and spinach did not work out, I decided to buy tomato seedlings. They provided a few weeks of fresh produce, though they did not last long once the fall chill set in. Next year, I will start the season with tomatoes\nWhat Didn’t Work Green onions were my biggest challenge. Despite multiple attempts, they germinated but never thrived, often wilting after just a few days. I suspect the issue may have been the soil quality, pests like ants, or perhaps mistakes I made in their care. Despite multiple attempts, they refused to grow beyond a few days after germination. I suspect the soil or perhaps ants were to blame (or myself).\nSwiss chard, Buttercrunch lettuce, and Romaine lettuce did not fare well either. They are not common where I come from, so I thought it would be fun to try them. Unfortunately, they will not make the cut for next year.\nBrussels sprouts were planted earlier in the season, though probably not as early as they should have been. While the plants look great, they have only just started sprouting now, in December. I will need to plant them earlier next year.\nA Season to Remember More than the food I harvested, it was the experience and learning that made this season special. I discovered the importance of proper timing for planting, the patience required to nurture plants, and how rewarding it feels to see your efforts bloom. Each success and failure taught me something new, making the entire journey worthwhile. Gardening gave me a chance to spend time outdoors, enjoy sunny mornings, and engage in hands-on work. Sharing these moments with my wife made it even more rewarding.\nMe in the beggining of the season\nAs for the harvest, having fresh herbs and vegetables just an elevator ride away was fantastic. It is hard to beat the taste of homegrown produce.\nThis year was just the beginning, and I am already looking forward to planning next year’s garden. If you have been considering starting a garden, I highly recommend it. It is a deeply fulfilling hobby that brings a little bit of nature into your life.\nCheers.\n","permalink":"https://luizvieira.me/my-first-garden-lessons-and-surprises/","summary":"Discover the lessons and surprises of starting my first garden, from planting herbs to harvesting veggies, in this new gardener\u0026rsquo;s journey","title":"My First Garden: Lessons and Surprises for a New Gardener"},{"content":"Last year, I set a personal record by reading 23 books. But in 2024, I deliberately scaled back, choosing to be more selective about what I read and make time for other pursuits. This year’s total? Just 9 books. In this post, I will share the ones that had the biggest impact on me, so you can decide if they are worth reading too.\nIn 2023, I shared my top 5 books of the year. But with only 9 books on my list this year, picking five would feel like including almost all of them! So, I’ve narrowed it down to my top 3 reads of 2024.\nInterestingly, while death and living was a recurring theme in my 2023 reading, 2024 took a different turn. Most of the books I read this year focused on business and self-development, especially health. I also read only one book for professional development (let\u0026rsquo;s keep that a secret from my boss).\nMy top 3 favorite books of 2024 Here is an image showing all the books I read this year. It’s a mix of fascinating subjects that kept me curious and engaged.\nAll the books read in 2024\nI have also written posts about what I learned from each one, so feel free to check those out if you are interested.\nClear Thinking: Turning Ordinary Moments into Extraordinary Results An Immense World: How Animal Senses Reveal the Hidden Realms Around Us Outlive: The Science \u0026amp; Art of Longevity Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems The Good Enough Job: Reclaiming Life from Work A Guide to the Good Life: The Ancient Art of Stoic Joy The Comfort Crisis: Embrace Discomfort to Reclaim Your Wild, Happy, Healthy Self Hidden Potential: The Science of Achieving Greater Things I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression Unlike last year, when I avoided ranking the books and listed them in the order I read them, this year I am taking a bolder approach. I am ranking my favorites, starting with the third-place pick and building up to my absolute favorite of the year.\n3. I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression\nThird place was a tough choice. I went back and forth between The Comfort Crisis and I Don’t Want To Talk About It. What ultimately tipped the scale was the impact this book had on my life.\nWhile The Comfort Crisis was an interesting read, many of its ideas felt familiar to me. I enjoyed it, but that might have been because it reinforced beliefs I already held.\nIn contrast, I Don’t Want To Talk About It fundamentally shifted how I see myself. It gave me a new perspective on my upbringing and explained patterns I observed while growing up. The book helped me understand my father’s actions and brought more clarity to my own relationship with myself.\nOne quote that stayed with me captures the generational nature of unspoken struggles:\n“As other fathers have done to their sons, my father \u0026mdash; through the look in his eyes, the tone of his voice, the quality of his touch \u0026mdash; passed the depression he did not know he had on to me just as surely as his father had passed it on to him \u0026mdash; a chain of pain, linking parent to child across generations, a toxic legacy.”\nThis book left a lasting impression and gave me tools to approach self-awareness in a deeper way.\n2. Clear Thinking: Turning Ordinary Moments into Extraordinary Results Clear Thinking: Turning Ordinary Moments into Extraordinary Results\nI absolutely loved Clear Thinking. Shane Parrish has been a role model for me as a thinker, problem solver, and curious person. I regularly listen to his podcast, The Knowledge Project, which was my second most-listened-to podcast in 2023 and ranked third in 2024.\nWhat stood out most in the book was the concept of our mental defaults, especially the ego default. Parrish explains how understanding our default state of mind is essential for making better decisions. It is not just about analyzing the factors influencing our choices but also about examining our mindset at the moment of decision-making.\nOne of my favorite quotes from the book perfectly captures this idea:\n\u0026ldquo;The ego default urges us to feel right at the expense of being right. Few things feel better than being right \u0026ndash; so much so that we will unconsciously rearrange the world into arbitrary hierarchies to maintain our beliefs and feel better about ourselves.\u0026rdquo;\nThis book challenged me to reflect on how I approach decisions and inspired me to adopt practices that promote clearer and more objective thinking.\n1. Outlive: The Science \u0026amp; Art of Longevity Outlive: The Science \u0026amp; Art of Longevity\nOutlive was by far the best book I read this year, not just because of its excellent content but also because of the impact it had on my life.\nAfter reading this book, I made a significant change by incorporating strength training into my routine. Before this, I focused only on cardio and avoided strength training because I simply didn’t enjoy it. Inspired by the book, I decided to give it a try, and now, after almost seven months, I’ve started to really enjoy it. I can already see the transformation in my body, which has been incredibly rewarding.\nThis book stands out as the best for me because it pushed me to prioritize strength training and take better care of my overall health. It wasn’t just about learning; it was about action and real results.\nOne quote from the book that resonated deeply with me was:\n“Exercise is by far the most potent longevity \u0026ldquo;drug.\u0026rdquo; No other intervention does nearly as much to prolong our lifespan and preserve our cognitive and physical function. But most people don\u0026rsquo;t do nearly enough – and exercising the wrong way can do as much harm as good.”\nThis message stuck with me and motivated me to build habits that will support my health for years to come.\nConclusion 2024’s reading journey was a bit shorter but no less impactful. Each book I selected brought something valuable to my life, whether it was a shift in perspective, a new habit, or a deeper understanding of myself and the world around me.\nFrom I Don’t Want To Talk About It, which helped me understand my own history and relationship with my father, to Clear Thinking, which gave me practical tools for better decision-making, and finally to Outlive, which inspired me to make lasting changes to my health \u0026ndash; each book left a mark.\nIf you’re looking for books that not only entertain but also challenge and inspire you, I highly recommend these three. They helped me grow and hopefully will help you do the same.\nI’m already looking forward to next year’s list and the new books that will shape my life in 2025. Until then, happy reading!\n","permalink":"https://luizvieira.me/best-books-2024/","summary":"Discover the top 3 books that shaped my 2024, offering valuable lessons on self-awareness, decision-making, and health transformation.","title":"My Top 3 Books of 2024: The Ones With the Biggest Impact"},{"content":"I never really enjoyed Christmas growing up. But thanks to my wife, over the many years we\u0026rsquo;ve been together, I\u0026rsquo;ve come to appreciate it a little more each year. This year, to celebrate our 11th anniversary, we decided to visit Leavenworth, Washington. It\u0026rsquo;s known for having one of the best Christmas atmospheres around here, so we thought it would be the perfect place to get into the holiday spirit.\nAnother reason we chose Leavenworth was because of the famous reindeer farm. It was a bit tricky getting tickets for the days we were there \u0026ndash; everything was selling out fast! But after some persistence, we scored two tickets for a Saturday afternoon.\nLeavenworth itself can be pricey when it comes to accommodations, so we found a more affordable solution. We stayed in Wenatchee, just a 30-minute drive away. There are plenty of hotel options there, all at much cheaper rates than in Leavenworth.\nLeavenworth main street at Night\nLeavenworth Christmas Decorations Leavenworth is a tiny, Bavarian-style village that\u0026rsquo;s incredibly touristy. Its charming little downtown is full of restaurants, shops, and a festive atmosphere that makes it a must-see during the holidays.\nWhile there isn\u0026rsquo;t a whole lot to do other than soaking in the Christmas decorations, eating at the local restaurants, or shopping, we didn\u0026rsquo;t mind. Since we\u0026rsquo;re not big on shopping and are trying to stick to a balanced diet, we spent most of our time simply walking around and enjoying the town\u0026rsquo;s cozy vibe.\nOne of the highlights for us was the stunning mountain views surrounding the city. The mountains are so close, and when we visited, there was just enough snow to make them look like something out of a winter postcard.\nThe city also brings Santa Claus, Mrs. Claus, and other holiday characters to life! They roam the streets around noon, stopping to take photos and greet visitors. We couldn’t resist snapping a picture with Santa and Mrs. Claus \u0026ndash; it was like a little moment from a holiday movie.\nTaking photos with Mr and Mrs Claus\nLeavenworth Reindeer Farm Growing up in a tropical country in the southern hemisphere, Christmas was always hot \u0026ndash; sometimes reaching close to 40°C! So, reindeer were never a part of our Christmas experience. Sure, we saw them in Christmas movies, but I didn\u0026rsquo;t even know they had names until I moved to Canada!\nThat\u0026rsquo;s why we were so excited to visit the Leavenworth Reindeer Farm, even though the tickets were a little pricey. Getting tickets was a challenge since they were sold out for most of our dates, but being a software engineer, I couldn’t resist the urge to put my skills to work. I modified a bot to monitor ticket availability, and it paid off \u0026ndash; we got two tickets!\nThe experience itself was fantastic. The whole tour lasted about 45 minutes, starting with a short video introducing us to the reindeer before heading to their enclosure.\nWhen you approach the ticket booth, the first thing you\u0026rsquo;ll see are the camels. They\u0026rsquo;re free to visit \u0026ndash; no tickets required. After that, you head to the reindeer, where you\u0026rsquo;ll find around 40 of them. It’s a truly magical experience, and seeing the reindeer up close really brings the Christmas movies to life!\nFeeding a reindeer in Leavenworth Reindeer Farm\nIf you’re visiting during the busy season, keep an eye on their website for ticket releases, or be persistent like us \u0026ndash; it’s worth it.\nFood While we’re not usually big on eating out, we couldn’t resist trying some of Leavenworth’s food spots. We ended up visiting three main places that stood out during our trip.\nThe Gingerbread Factory Our first stop was The Gingerbread Factory, a cozy bakery known for its amazing baked goods. This place is super popular, so be prepared to wait \u0026ndash; seriously, the line can get really long. We waited almost an hour, but it was worth it. Their cinnamon roll was the star of the show for us: huge, soft, and absolutely delicious. The bakery has a charming interior, with lots of holiday-themed decorations that add to the festive vibe. Pair your treats with a warm drink like hot cocoa or coffee for the full experience.\nAndreas Keller Restaurant Next, we tried the Andreas Keller Restaurant, a classic Bavarian-style eatery located right in the heart of town. It’s a must-visit if you want to immerse yourself in the German-inspired culture of Leavenworth. The menu is full of traditional dishes like schnitzel, pretzels, and pork hock, which I really wanted to try. Unfortunately, I wasn’t hungry enough for such a big meal, so I opted for the sausage platter instead \u0026ndash; still a great choice, especially when paired with one of their German beers.\nWhat really made this place special, though, was Gary, the accordion player. He’s incredibly talented and creates such a warm, lively atmosphere. He even came over to chat with us briefly, making the experience feel even more personal.\nThe Food Tent at the Main Plaza Lastly, we grabbed a quick bite at the food tents in the main plaza. These pop-up stalls offer a variety of quick snacks and holiday favorites. I couldn’t resist the giant turkey legs I saw others devouring \u0026ndash; they looked like something straight out of a medieval feast! It was smoky, juicy, and perfect for munching on while wandering through the plaza and admiring the Christmas lights.\nFinal Thoughts Leavenworth was everything we hoped it would be \u0026ndash; charming, festive, and full of holiday magic. Whether it’s taking in the beautiful mountain views, meeting Santa and Mrs. Claus, or feeding reindeer at the farm, there’s something for everyone to enjoy. While the trip can get a bit pricey, there are plenty of ways to make it more affordable, like staying in nearby Wenatchee. If you’re looking for a place to get into the Christmas spirit, Leavenworth is definitely worth a visit!\nHappy travels!\n","permalink":"https://luizvieira.me/leavenworth-christmas/","summary":"Discover the festive charm of Leavenworth, Washington, with its Bavarian-style village, dazzling Christmas lights, reindeer farm, and delicious holiday treats!","title":"Leavenworth at Christmas: Reindeer, Lights, and Festive Fun"},{"content":"I first heard about I Don’t Want To Talk About It while reading Outlive, which has a chapter on mental health and the author’s personal struggles. This chapter made me reflect deeply on my own emotional health, leading me to explore Terrence Real’s book for a broader understanding of male depression and its unique challenges. While I feel fortunate to have never been diagnosed with depression, I’ve had my share of tough times and sometimes wonder if those struggles were simply because I went undiagnosed for so long. This book seemed like a great starting point to explore depression, mental health, and gain a deeper understanding of myself and my emotional well-being.\nIn my Pillars of Health, I’ve already included some practices to support my emotional well-being, but I want to take it further \u0026mdash; especially when it comes to understanding myself better.\nNow, let\u0026rsquo;s dive into I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression and explore what it has to offer.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book I Don\u0026rsquo;t Want To Talk About It Book I Don\u0026rsquo;t Want To Talk About It\nThe book was written in 1997, and fortunately, a lot has changed in the mental health space for men since then. Still, many of the book’s concepts remain true today or at least feel deeply relevant.\nI approached this book with curiosity. I’d never read much about emotional health before, and the subtitle, particularly the phrase “The Secret Legacy of Male Depression” caught my attention. While I’ve had my ups and downs, I was never diagnosed with overt depression. But it made me wonder \u0026mdash; could I have been experiencing depression in secret?\nThis quote from the book captures its essence perfectly:\n“As other fathers have done to their sons, my father \u0026mdash; through the look in his eyes, the tone of his voice, the quality of his touch \u0026mdash; passed the depression he did not know he had on to me just as surely as his father had passed it on to him \u0026mdash; a chain of pain, linking parent to child across generations, a toxic legacy.”\nSome of the stories in the book are incredibly heavy, emotionally speaking, and they make you pause and reflect. I found myself and my family in some of these narratives \u0026mdash; especially in the idea of generational trauma being passed down. This hit close to home, as I could see echoes of my family’s past in my own experiences.\nI think this book is incredibly valuable for men who want to better understand their mental health. It offers insights that could help improve relationships with a father, with family, or even with oneself. Personally, it gave me a new perspective on my father’s actions. I realized that much of what he did likely came from how he was raised, shaped by what he knew at the time.\nI won’t dive too deeply into personal details, but I do want to share what I learned. In this post, I’ll go over my top five takeaways from I Don’t Want To Talk About It.\nmen tend to manifest depression differently than women One of the key things I learned is that men often experience and express depression differently than women. While some types of depression affect both sexes in similar ways, men tend to externalize their pain in ways that can make them appear psychologically dangerous, in addition to struggling with communication, just as women might.\nThis difference might stem from how men and women are culturally conditioned to handle emotions. Historically, men have been encouraged to suppress their feelings with phrases like \u0026ldquo;man up\u0026rdquo; or \u0026ldquo;tough it out,\u0026rdquo; making it harder for them to process their emotions in healthy ways.\ncovert depression is very dangerous Another concept I learned is that depression comes in different forms, primarily overt and covert depression. Overt depression is the kind we typically recognize, with clear and visible symptoms. Covert depression, on the other hand, is often hidden \u0026mdash; not just from those around the person but even from the man himself.\nAs the book explains, “covert depression is at its core a disorder of self-esteem. Healthy self-esteem is essentially internal. It is the capacity to cherish oneself in the face of one\u0026rsquo;s own imperfections, not because of what one has or what one can do.”\nOne of the greatest dangers of covert depression is its impact on intimacy. Men with covert depression often struggle to form genuine emotional connections because they cannot be emotionally honest with themselves. As the book puts it, “covertly depressed men do not dare know themselves; the man\u0026rsquo;s own experience, the pain of depression, is avoided. It is managed and denied.”\nThe dangers of covert depression, including its ties to intimacy issues, often drive men toward coping mechanisms like socially accepted addictions. These behaviors may stem from a misplaced sense of self-worth rooted in performance-based esteem.\nsocially accepted addictions can be worse than non-accepted Addictions come in many forms, often categorized as socially accepted or not. Some socially accepted addictions \u0026mdash; like workaholism in men or obsessive weight control in women \u0026mdash; can be even more harmful than stigmatized ones because they are often praised and normalized by society.\nThe defining characteristic of any addiction is persisting in a behavior despite knowing its negative impact. This holds true for these \u0026ldquo;rewarded\u0026rdquo; addictions, which can quietly erode a person’s well-being while appearing admirable or necessary. The cultural acceptance of these behaviors makes them harder to recognize and even more difficult to confront, sometimes with devastating consequences.\nperformance-based esteem is a big problem Many people attempt to build self-esteem through professional achievements. Climbing the career ladder, earning more money, or achieving recognition might feel like it’s building your self-esteem. But as the book emphasizes, covert depression is rooted in a disorder of self-esteem, and true self-esteem isn’t something you can earn \u0026mdash; it’s something you inherently have.\nPerformance-based esteem tries to compensate for an internal sense of inadequacy by comparing accomplishments to others and feeling validated only by \u0026ldquo;winning.\u0026rdquo; The problem is that no amount of performance can ever fill this void. The more you chase external validation, the more you realize it’s never enough. You’ll always feel like you’re falling short of being good enough for yourself.\ntraumas are passed from father to son, on and on again The way society treats boys and girls is often very different. Fathers, in particular, are usually tougher than mothers, and both tend to be stricter with boys than with girls. This stems from the traditional idea that masculinity means being brave, strong, and never showing weakness.\nBecause of this mindset, fathers often pass their unresolved traumas onto their sons, treating them the same way they were treated. A beating, for example, isn’t just a punishment, it becomes a twisted lesson in \u0026ldquo;how to be a man.\u0026rdquo; Fathers also rarely share their feelings, not only because they often don’t know how but also because they believe that showing emotions isn’t something a \u0026ldquo;real man\u0026rdquo; should do.\nReading about how fathers pass down their traumas struck a chord with me. It made me think of moments in my own upbringing where tough love might have been a reflection of my father’s struggles rather than an intentional parenting choice.\nFavorite quotes These are my 5 favorite quotes from the book:\n“Depressed women have obvious pain; depressed men often have \u0026ldquo;troubles.\u0026rdquo; It is frequently not they who are in conscious distress so much as the people who live with them. ”We know that across a wide spectrum of strictness, fathers tend to be tougher than mothers and both are tougher on boys than on girls. In many homes, violent fathers pass on active trauma to their sons as if toughness were a gift, a necessary initiation.” “It is hard for many successful men, like Thomas, to see the harmful effects of compulsive work until the relational bill comes due.” ”While workaholism in men may be socially acceptable, it can still wreak havoc upon their personal lives, and erode their physical health as well.” “Disempowering abuse shames the child setting the stage for victimization later in life. False empowerment instills grandiosity in the child and sets the adult up to become offensive. The first is a disorder of too much shame, the second a disorder of too little. Disempowering abuse leads to overt depression, falsely empowering abuse leads to covert depression.” This book gave me not just insights but also tools to better understand myself and my relationships. If you’re curious about male mental health or want to reflect on your own emotional well-being, I highly recommend giving it a read.\nThese are my learnings from the book I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression written by Terrence Real. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-i-dont-want-to-talk-about-it/","summary":"These are my learnings from the book I Don\u0026rsquo;t Want To Talk About It: Overcoming the Secret Legacy of Male Depression","title":"Learnings from the book I Don’t Want To Talk About It"},{"content":" Another year has flown by, and podcasts have remained my go-to source for learning, growth, and inspiration. Despite my best intentions to cut back, I found myself diving deeper into my favorite shows, uncovering new insights and ideas along the way.\nSince I started listening back in 2017, podcasts have profoundly enriched my life. This year, my focus shifted towards health \u0026mdash; learning actionable strategies and putting them into practice has led to tangible improvements in both my well-being and daily routines.\nFor me, the best time to listen is during outdoor walks or commutes. There\u0026rsquo;s something about the combination of moving my body in an easy, natural way while actively absorbing new knowledge that feels perfectly balanced \u0026mdash; working both body and mind simultaneously.\nInterestingly, I rarely listen at the gym (except during cardio) or while working; I find it hard to focus in those situations. For podcasts to truly capture my attention, I need to be physically moving; otherwise, my mind tends to wander.\nIf you’re new to podcasts, I encourage you to give them a try \u0026mdash; especially on a walk. You might even find yourself walking a little longer, just to finish an episode!\nThe top 5 podcasts I listened to in 2024 Before diving into the top five, let\u0026rsquo;s take a look at some interesting stats from my podcast journey this year.\nThis year, I clocked 14,481 minutes of podcast listening \u0026mdash; roughly 10 full days of non-stop audio! While it’s a staggering number, it’s still a little less than last year, so technically, I did cut down… just a tiny bit.\nMinutes of Spotify Wrapped\nSince Spotify tracks total minutes listened and I usually listen at 2x speed, I’ve actually consumed close to 29,000 minutes of content. That’s an insane amount of podcasts.\nMy go-to genre this year was Business \u0026amp; Technology, and according to Spotify, I’m in the top 1% of listeners. Yes, I’m one of those people.\nBut enough about stats, what really matters is the value I’ve gained from these hours of listening.\nNot much has changed from last year’s list. Four familiar names remain, albeit shuffled around, and one new addition managed to sneak in. So, without further ado, here are my top five podcasts of 2024, ranked from least to most listened to:\n5. The Tim Ferriss Show The Tim Ferriss Show\nI’ve been a longtime listener of Tim’s podcast and enjoy most of his episodes. His deep-dive interviews with world-class performers are consistently insightful and inspiring.\nThis year, The Tim Ferriss Show made its debut on my list, securing the 5th spot.\nHere are some episodes I liked.\n#728: Seth Godin — Coaching Tim on Overcoming Resistance, Lessons from Isaac Asimov, Writing Secrets After 8,500+ Daily Blog Posts, The Dangers of Authenticity, Practices for Consistency, and Much More #774: Learnings from 1,000+ Near-Death Experiences — Dr. Bruce Greyson, University of Virginia #730: Reed Hastings, Co-Founder of Netflix — How to Cultivate High Performance, The Art of Farming for Dissent, Favorite Failures, and More 4. Hidden Brain Hidden Brain\nI adore this podcast. Hidden Brain helped me uncover patterns in my own decision-making and relationships, making it a deeply reflective and practical listen. Shankar Vedantam masterfully blends science and storytelling to unravel the hidden behaviors and patterns that shape our lives. It’s an incredible resource for self-improvement and understanding how our choices affect our relationships.\nSome of my favorite episodes include:\nRewrite Your Money Story You 2.0: How To Say No You 2.0: The Gift of Other People The Cure for Self-Importance Innovation 2.0: The Influence You Have 3. The Knowledge Project with Shane Parrish The Knowledge Project\nShane Parrish’s interview series focuses on mastering the lessons that others have already figured out. Whether it’s business, decision-making, or life strategies, each episode feels like a masterclass with leaders in their fields.\nFavorite episodes:\nThe Storytelling Expert: Hidden Triggers That Make People Act | Matthew Dicks Esther Perel: Cultivating Desire The Marketing Expert: A Masterclass in Strategic Positioning | April Dunford Why the Kids Aren’t Alright with Abigail Shrier #191 Dr. Rhonda Patrick: Diet Essentials For Healthy Living 2. Lex Fridman Podcast Lex Fridman Podcast\nLex Fridman’s journey from The Artificial Intelligence Podcast to a broader interview format has been fascinating to follow. His intelligent questions and diverse guests (ranging from scientists and technologists to philosophers and historians) make every episode a learning experience. Topics span everything from consciousness and intelligence to love and power.\nMust-listen episodes:\n#449 – Graham Hancock: Lost Civilization of the Ice Age \u0026amp; Ancient Human History #448 – Jordan Peterson: Nietzsche, Hitler, God, Psychopathy, Suffering \u0026amp; Meaning #435 – Andrew Huberman: Focus, Controversy, Politics, and Relationships #430 – Charan Ranganath: Human Memory, Imagination, Deja Vu, and False Memories #420 – Annie Jacobsen: Nuclear War, CIA, KGB, Aliens, Area 51, Roswell \u0026amp; Secrecy 1. Huberman Lab Huberman Lab\nHuberman Lab, a science-driven podcast where Dr. Andrew Huberman dives into neuroscience and its connection to human behavior. What I love most is how practical and actionable his advice is, whether it’s understanding brain signals or optimizing daily routines.\nUnsurprisingly, Huberman Lab topped my list this year. With a strong focus on improving my health, I turned to this podcast for a wealth of actionable insights. Many of the concepts and strategies I’ve adopted as part of my “Pillars of Health” were inspired by the knowledge I gained from listening.\nEpisodes that left a lasting impression:\nDr. Cal Newport: How to Enhance Focus and Improve Productivity Dr. Jonathan Haidt: How Smartphones \u0026amp; Social Media Impact Mental Health \u0026amp; the Realistic Solutions Dr. James Hollis: How to Find Your True Purpose \u0026amp; Create Your Best Life Esther Perel: How to Find, Build \u0026amp; Maintain Healthy Romantic Relationships Dr. Gabrielle Lyon: How to Exercise \u0026amp; Eat for Optimal Health \u0026amp; Longevity Here is the image from Spotify Wrapped\nTop 5 podcasts on Spotify Wrapped 2024\nThis year’s podcast journey has been packed with knowledge, inspiration, and plenty of “aha” moments. Each show has left its mark, helping me grow in both my personal and professional life.\nReflecting on 2024, I’m amazed at how these podcasts have fueled my curiosity and improved my life. They remind me of the endless opportunities to learn and grow.\nSee what changed in my top podcasts of 2025.\nHappy listening!\n","permalink":"https://luizvieira.me/top-5-podcasts-2024/","summary":"Discover the top 5 podcasts that fueled my learning, health, and inspiration in 2024, along with key episodes and insights from my listening journey","title":"Top Podcasts of 2024: Smarter, Healthier, and Happier"},{"content":" I don\u0026rsquo;t remember exactly where I first heard about Hidden Potential, but it was likely through Adam Grant’s podcast or an interview he did. I’ve always enjoyed books about psychology and personal growth, so I decided to give this one a try.\nNow, let\u0026rsquo;s dive into Hidden Potential: The Science of Achieving Greater Things and explore what it has to offer.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book Hidden Potential Book Hidden Potential\nI’ve always enjoyed Adam Grant’s content, from his books to his podcasts. While Hidden Potential is a solid read, I’ve found that, like many books these days, you can grasp most of the key ideas just by listening to related podcasts or interviews. In my case, after listening to about five podcasts, I felt like I already knew most of the book’s content before even reading it. That said, there’s still valuable knowledge within its pages. In this post, I’ll share my top five takeaways from Hidden Potential.\nbe kind, not polite One of the key insights I took away from the book is the difference between being kind and being polite. We often think we\u0026rsquo;re helping by being polite and avoiding uncomfortable situations, but in reality, we’re just avoiding temporary discomfort. As the book explains, \u0026ldquo;We even hesitate to tell friends they have food in their teeth. We\u0026rsquo;re confusing politeness with kindness. Being polite is withholding feedback to make someone feel good today. Being kind is being candid about how they can get better tomorrow.\u0026rdquo; It’s possible to be direct while still being considerate in how you communicate. For example, telling a friend about broccoli stuck in their teeth might feel awkward, but it\u0026rsquo;s much kinder than letting them go on without knowing.\nask for advice and not feedback Another powerful lesson from the book is about asking for advice instead of feedback. Typically, when we ask for feedback, we focus on what went wrong in the past. But feedback often leads to criticism or praise without much guidance for the future. The author suggests asking for advice instead, as it is forward-looking and encourages more constructive, helpful coaching aimed at improving future performance.\nyou improve because you enjoy it, not because you should A recurring theme in many personal development books, including this one, is the importance of enjoying the process rather than just focusing on the outcome. The idea is that we improve not because we \u0026ldquo;should\u0026rdquo; but because we find joy in what we do. While there are many tasks we might not naturally enjoy, the key is to find ways to make the process more playful or enjoyable. This mindset shift can help us derive more pleasure from progress itself, rather than only from the result.\nbrainstorm is not a good approach I’ve never been a fan of brainstorming sessions. Often, the loudest voices dominate, and people get stuck on ideas that have already been mentioned. The book suggests replacing brainstorming with brainwriting. In brainwriting, everyone generates ideas independently before discussing them as a group. This approach ensures more balanced participation and helps avoid the influence of dominant voices. It leads to more diverse and refined ideas, ultimately resulting in better outcomes.\ndefine how well you want to do a task in advance I\u0026rsquo;m not a perfectionist, and I understand how perfectionism can lead to problems. However, the book introduced a helpful approach to managing tasks: defining your desired level of performance in advance. For example, you might aim for a high standard, like an 8 out of 10, but also set an acceptable minimum, like a 6. This way, you know when you’ve done enough to move on. It’s about balancing ambition with practicality. You could even have judges rate your progress on a scale of 0 to 10 and then ask for their input on how to improve. This strategy helps avoid the trap of perfectionism while still encouraging progress.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Breaks are not a distraction-they\u0026rsquo;re a chance to reset attention and incubate ideas. Play is not a frivolous activity - it\u0026rsquo;s a source of joy and a path to mastery. \u0026ldquo;Character is more than just having principles. It\u0026rsquo;s a learned capacity to live by your principles. Character skills equip a chronic procrastinator to meet a deadline for someone who matters deeply to them, a shy introvert to find the courage to speak out against an injustice, and the class bully to circumvent a fistfight with his teammates before a big game.\u0026rdquo; \u0026ldquo;Once people saw discomfort as a mark of growth, they were motivated to stretch beyond their comfort zones.\u0026rdquo; \u0026ldquo;It\u0026rsquo;s easier to overcome obstacles when we\u0026rsquo;re carrying a torch for people who matter to us. When others are counting on us, we find strength we didn\u0026rsquo;t know we had.\u0026rdquo; \u0026ldquo;The best teams have the most team players — people who excel at collaborating with others.\u0026rdquo; Other resources This section adds extra insights, incorporating content from other sources that align with the themes of the book.\nWorkLife with Adam Grant podcast episode Unlocking Hidden Potential with Malcolm Gladwell 10% Happier with Dan Harris podcast episode Adam Grant on the Science of Potential and Achievement Huberman Lab podcast episode Dr. Adam Grant: How to Unlock Your Potential, Motivation \u0026amp; Unique Abilities Hidden Brain podcast episode How to Believe in Yourself WorkLife with Adam Grant podcast episode Jennifer Garner realizes her hidden potential These are my learnings from the book Hidden Potential: The Science of Achieving Greater Things written by Adam Grant. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-hidden-potential/","summary":"These are my learnings from the book Hidden Potential: The Science of Achieving Greater Things written by Adam Grant","title":"Learnings from the book Hidden Potential"},{"content":"Growing up on a rural farm in Brazil, we didn\u0026rsquo;t have phones or computers at home. Without much control over the TV (and not really interested in watching soap operas), I had a lot of free time at night. I often found myself lying on the cow’s trough (it was clean, I swear), staring up at the night sky, thinking about how small we are, and hoping to catch a shooting star.\nRecently, during camping trips, my wife and I started a similar habit. After the campfire dies down, we lie on our beach chairs, either chatting or just quietly watching the sky, waiting for shooting stars and taking in the vastness above us.\nFor the moon, we use our Nikon binoculars, which are a nice upgrade from the naked eye, but they only offer 8x magnification.\nChoosing an Affordable Telescope I\u0026rsquo;ve always wanted a telescope, and after a few recent stargazing nights, that desire only grew. But I didn’t want to spend too much, and since we live in a small one-bedroom apartment in the city, space and light pollution are also issues.\nIt turns out that finding a good, affordable, and compact telescope is tricky. I learned through research that there are two main types, Dobsonian and Refractor, each serving different purposes. Dobsonians are better for deep space, while Refractors are great for the moon and planets. Given my budget and space limitations, I knew I couldn’t get both, so I had to make a choice for my first telescope.\nI ended up going with a Celestron, one of the more affordable brands that still seems to get good reviews. I paid about C$180 for the Celestron Travel Scope 80, which claims it can magnify up to 189x. It’s small, and even comes with a travel bag, which is convenient.\nFirst Impressions Setting it up was easy, and I started by using it during the day to get the hang of it. But when night came and I pointed it at the moon, I started to feel a bit frustrated. The tripod is really unstable, making it hard to focus on anything. Even the slightest touch makes everything shake, and if you\u0026rsquo;re trying to take a picture, it’s almost impossible to keep it steady.\nThe scope comes with two eyepieces, a 20mm and a 10mm, but the 10mm didn’t give me the zoom I was expecting. Even though it’s supposed to offer 40x magnification, the zoom didn’t seem nearly that strong. Taking a picture with my phone was even more difficult because the added weight threw off the balance of the whole setup.\nHere’s a photo I managed to take of the moon a few days after it was full, using the 10mm eyepiece. While the quality is decent, the whole process of getting this shot was a challenge. With the unstable tripod, even just looking through the scope is tough, and taking pictures is harder.\nView of the from the Celetron Travel Scope 80\nAlso, despite what the box claims, the zoom doesn’t feel anywhere near 189x. Even at 40x, I’m not sure if the tripod will be stable enough to handle it. I really wish they had invested a bit more in a sturdier tripod.\nFinal Thoughts In the end, it was a cool experience, but also frustrating. I bought a cheap telescope with a flimsy tripod, and now I’m trying to make the most of it. I’ll keep practicing on clear nights and see if I can work around its weaknesses. But in short, I would not recommend this one.\nMaybe one day, when I have more space, I’ll get a better one. But I’ve definitely learned that stability is key when buying a telescope.\nHappy stargazing!\n","permalink":"https://luizvieira.me/first-telescope-celestron-travel-scope-80-review/","summary":"My experience with the Celestron Travel Scope 80: a budget-friendly, compact telescope with some challenges in stability and magnification.","title":"Celestron Travel Scope 80 Review: My First Telescope"},{"content":"As part of an internal improvement, my team converted most of our internal JVM libraries to be published in a BOM (Bill of Materials) format. Previously, each of our over 60 libraries was published individually. This transition to a BOM was a huge step forward for our developer experience, as now we only need to upgrade a single version instead of updating each library’s version individually.\nHowever, while the BOM simplifies upgrades, it introduces a new challenge: tracking changes between different BOM versions. For example, what exactly changed between version 4.0.1 and 4.0.2?\nSince we use GitLab, we decided to enhance our release process by providing better release information for each library. After considering our options, we found that the GitLab changelog feature was the best approach for our use case.\nI drew inspiration from a project I like, Dependabot for GitLab, which uses changelog APIs to create awesome release notes like the one below.\nRelease notes from Dependabot Gitlab\nAdditionally, it automatically updates the CHANGELOG.md file, as shown below:\nChangelog from Dependabot Gitlab\nHow to Add Release Notes to a Project GitLab\u0026rsquo;s changelog feature relies on adding a commit trailer to the commit message. This tells GitLab what to include in the release notes. Since there’s no default value, you need to manually add the changelog trailer to each commit you want to appear in the release notes.\nYou can do this by appending changelog: value to the end of your commit message, like this:\nYour commit title Your commit message changelog: fix If you’re using the command line, you can achieve this with:\ngit commit --message \u0026#34;Fixed log format\u0026#34; --trailer \u0026#34;changelog: fix\u0026#34; To start the process of adding release notes to your project, you have to do the following steps.\nSteps to Add Release Notes to Your Project 1. Add a changelog_config.yml This step is only required if you want to customize the release note categories or template. The default configuration from GitLab’s documentation looks like this:\n{% if categories %} {% each categories %} ### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %}) {% each entries %} - [{{ title }}]({{ commit.web_url }})\\ {% if author.credit %} by {{ author.reference }}{% end %}\\ {% if merge_request %} ([merge request]({{ merge_request.web_url }})){% end %} {% end %} {% end %} {% else %} No changes. {% end %} The default categories include:\n- `added`: New feature - `fixed`: Bug fix - `changed`: Feature change - `deprecated`: New deprecation - `removed`: Feature removal - `security`: Security fix - `performance`: Performance improvement - `other`: Other To customize categories or the template, create a changelog_config.yml file in the .gitlab folder. Below is an example from the Dependabot project:\n--- categories: breaking: \u0026#34;💥 Breaking changes\u0026#34; security: \u0026#34;⚠️ Security updates\u0026#34; feature: \u0026#34;🚀 New features\u0026#34; improvement: \u0026#34;🔬 Improvements\u0026#34; fix: \u0026#34;🐞 Bug Fixes\u0026#34; dependency: \u0026#34;📦 Dependency updates\u0026#34; ci: \u0026#34;🔧 CI changes\u0026#34; chore: \u0026#34;🧹 Maintenance\u0026#34; doc: \u0026#34;📄 Documentation updates\u0026#34; other: \u0026#34;❓ Other changes (changelog not specified)\u0026#34; template: | {% if categories %} {% each categories %} ### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %}) {% each entries %} - [{{ title }}]({{ commit.reference }}) by {{ author.reference }}.\\ {% if merge_request %} See merge request {{ merge_request.reference }}{% end %} {% end %} {% end %} {% else %} No changes with `changelog` in the commit message detected {% end %} If your versioning tags differ from X.Y.Z or vX.Y.Z, you need to customize the tag regex. For example, if your tags follow version-X.Y.Z, you can add the following:\ntag_regex: \u0026#39;^version-(?P\u0026lt;major\u0026gt;\\d+)\\.(?P\u0026lt;minor\u0026gt;\\d+)\\.(?P\u0026lt;patch\u0026gt;\\d+)$\u0026#39;` The tag regex is used by GitLab when you create a new release to check for the commits between the two versions.\n2. Publishing Release Pipeline To automate releases, you need a pipeline that creates a tag (or just a release) based on a version and a commit reference. Here\u0026rsquo;s an example configuration:\npublish-gitlab-release: stage: release image: registry.gitlab.com/dependabot-gitlab/ci-images/release-cli:0.18 variables: RELEASE_NOTES_FILE: release_notes.md needs: - job: publish-bom artifacts: true rules: - if: $CI_COMMIT_TAG when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH \u0026amp;\u0026amp; $CI_PIPELINE_TRIGGERED != \u0026#34;true\u0026#34; \u0026amp;\u0026amp; $CI_COMMIT_MESSAGE !~ /Add changelog for version/ script: - echo \u0026#34;running publish-gitlab-release for $TAG_NAME\u0026#34; - .gitlab/ci/script/changelog.sh interruptible: false release: tag_name: \u0026#39;$TAG_NAME\u0026#39; description: $RELEASE_NOTES_FILE name: \u0026#39;$TAG_NAME\u0026#39; ref: \u0026#39;$CI_COMMIT_SHA\u0026#39; A few things to note in the above gitlab-ci.yaml job.\nKey points:\nImage: We use Dependabot’s release image to run the changelog.sh script. changelog.sh: This script fetches changelog information from the GitLab API, stores it in RELEASE_NOTES_FILE, and updates the CHANGELOG.md file. It is based on the file changelog.sh from dependabot chart and it is shown below. #!/bin/bash set -euo pipefail source \u0026#34;$(dirname \u0026#34;$0\u0026#34;)/utils.sh\u0026#34; changelog_endpoint=\u0026#34;${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/repository/changelog\u0026#34; header=\u0026#34;PRIVATE-TOKEN: ${GITLAB_ACCESS_TOKEN}\u0026#34; release_version=$(echo ${CI_COMMIT_TAG} | grep -oP \u0026#39;v\\K[0-9.]+\u0026#39;) data=\u0026#34;version=${release_version}\u0026amp;trailer=changelog\u0026#34; info \u0026#34;Fetching release notes\u0026#34; curl -s --header \u0026#34;${header}\u0026#34; \u0026#34;${changelog_endpoint}?${data}\u0026#34; | jq -r \u0026#34;.notes\u0026#34; \u0026gt; ${RELEASE_NOTES_FILE} info \u0026#34;Updating CHANGELOG.md\u0026#34; curl -X POST --header \u0026#34;${header}\u0026#34; --data \u0026#34;${data}\u0026#34; \u0026#34;${changelog_endpoint}\u0026#34; You’ll need a GitLab access token with API scope stored as a CI/CD variable (e.g., GITLAB_ACCESS_TOKEN), and permission for the user associated with the token to push to the protected master branch. So, in Settings -\u0026gt; Repository expand the Protected branches options and in Allowed to push and merge add the user for whom you created the token.\nWhen the CHANGELOG.md is updated in the master branch, the commit message is in the format Add changelog for version X, where X is the value of the version argument. If you don\u0026rsquo;t want to run circular dependency in the master branch you have to add to the rule to not run the job when the file is committed, as we did above.\nOptional: Adding a Check Pipeline for Commit Trailers Since adding commit trailers is manual, it’s easy to forget. To prevent missing trailers, you can add a pipeline that checks if the first commit in a merge request contains a trailer. Here\u0026rsquo;s the check_commit_trailer.sh script:\n#!/bin/bash set -euo pipefail source \u0026#34;$(dirname \u0026#34;$0\u0026#34;)/utils.sh\u0026#34; info \u0026#34;Fetching the merge base...\u0026#34; # Fetch the merge base between the target branch and the MR branch # shellcheck disable=SC2086 git fetch origin \u0026#34;$CI_MERGE_REQUEST_TARGET_BRANCH_NAME\u0026#34;:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME MERGE_BASE=$(git merge-base \u0026#34;$CI_MERGE_REQUEST_TARGET_BRANCH_NAME\u0026#34; \u0026#34;$CI_COMMIT_SHA\u0026#34;) info \u0026#34;Listing commits from the merge base to the latest commit...\u0026#34; # List all commits from the merge base to the current commit (in MR) COMMITS=$(git rev-list \u0026#34;$MERGE_BASE\u0026#34;..\u0026#34;$CI_COMMIT_SHA\u0026#34;) info \u0026#34;Identifying the first commit in the merge request...\u0026#34; # Get the first commit (the oldest) from the commit list FIRST_COMMIT=$(echo \u0026#34;$COMMITS\u0026#34; | tail -n 1) info \u0026#34;First commit is $FIRST_COMMIT\u0026#34; # Extract the commit message of the first commit FIRST_COMMIT_MESSAGE=$(git log -1 --pretty=%B \u0026#34;$FIRST_COMMIT\u0026#34;) info \u0026#34;First commit message is $FIRST_COMMIT_MESSAGE\u0026#34; PATTERN=\u0026#34;changelog: (breaking|security|feature|improvement|fix|dependency|ci|chore|doc|deploy|other)\u0026#34; info \u0026#34;Checking if the first commit contains the \u0026#39;changelog:\u0026#39; trailer...\u0026#34; # Check if the trailer \u0026#39;Changelog:\u0026#39; exists in the first commit message if echo \u0026#34;$FIRST_COMMIT_MESSAGE\u0026#34; | grep -i -qE \u0026#34;$PATTERN\u0026#34;; then success \u0026#34;Changelog trailer found in the first commit.\u0026#34;; else warn \u0026#34;Changelog trailer not found in the first commit.\u0026#34;; warn \u0026#34;please rebase or amend your commit to add a changelog in the format ${PATTERN}\u0026#34;; exit 1; fi And the corresponding GitLab CI job:\ncheck-first-commit-trailer: stage: check image: registry.gitlab.com/dependabot-gitlab/ci-images/release-cli:0.18 allow_failure: true # allow the pipeline to fail as it is just a warning variables: GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_UPDATE_FLAGS: --remote --force script: - ./gitlab-ci-templates/scripts/check_commit_trailer.sh rules: - if: $CI_PIPELINE_SOURCE == \u0026#34;merge_request_event\u0026#34; In this case as it is just a warning I added allow_failure: true so it will allow everything to proceed.\nUpdating Dependabot Configuration You can add the following to dependabot.yaml to ensure all dependency merge requests created by Dependabot include a trailer:\ncommit-message: trailers: - changelog: dependency Like the following.\nversion: 2 registries: Artifactory: type: maven-repository url: ... username: ... password: \u0026#34;...\u0026#34; updates: - package-ecosystem: gradle directory: / schedule: interval: daily time: \u0026#34;02:30\u0026#34; timezone: \u0026#34;America/Vancouver\u0026#34; open-pull-requests-limit: 100 commit-message: trailers: - changelog: dependency ignore: - dependency-name: \u0026#34;org.springframework*\u0026#34; update-types: [ \u0026#34;version-update:semver-major\u0026#34; ] Additional GitLab Project Configuration To ensure everything works correctly, you\u0026rsquo;ll need to adjust some settings in your GitLab project configuration. For these changes, you\u0026rsquo;ll either need maintainer access or assistance from someone who has it.\nModify the Squash Commit Message Template By default, the commit message for squashed commits uses the merge request (MR) title, which prevents the required trailer from being included in the release notes. To fix this, navigate to Settings -\u0026gt; Merge requests and locate the Squash commit message template section. Change the template from %{title} to %{first_multiline_commit}. This way, the full message of the first commit, including the trailer, will be used in the squashed commit. Remember to save the changes.\nBy making these improvements, we’ve streamlined the process of generating release notes and changelogs for our BOM libraries while also ensuring consistency and automation in our GitLab pipelines.\nCheers.\n","permalink":"https://luizvieira.me/enhance-gitlab-release-notes-automated-library-changelogs/","summary":"Learn how to automate GitLab library changelogs for streamlined release notes, improving efficiency and consistency in your development workflow","title":"Automated Library Changelogs in GitLab Release Notes"},{"content":"Upgrading to a major version of Spring Boot was something I\u0026rsquo;d been wanting to do for a while. I was inspired by an architect named Pacheco, who was my go-to expert on Spring Boot in the previous company, and Alex G in the current company. Recently, I upgraded all 11 services in my company from Spring Boot 2.7 to 3.2. Along the way, I learned a lot, not just about Spring, but also about myself, how our services work, and how to collaborate with my teammates.\nOne of the toughest parts was not just upgrading the services my platform team owned, but also helping out with other teams\u0026rsquo; services to speed up the migration.\nIn total, I updated 11 services, touching over 1,400 files across more than 50 merge requests (MRs), and nearly rewrote two services from scratch.\nI learned a lot, both technically and non-technically, but in this post, I\u0026rsquo;ll focus on the non-technical lessons. They are not exactly new things, but reminders of important things when doing such changes.\nKey Lessons from the Spring Boot Upgrade keep changes minimal When I work on code, I usually like to improve things as I go. But during this upgrade, I realized that with such a big change, it’s better to only modify what\u0026rsquo;s absolutely necessary. Keeping changes minimal made it easier to troubleshoot any issues that popped up. When you make too many changes at once, it’s harder to figure out what caused the problem. So, it\u0026rsquo;s best to make the required changes first, then handle any improvements in follow-up MRs.\ndeprecations can be a pain We had some things, like Netflix Zuul or Auth Resource Server, that were already deprecated in 2.7 but still in use. We managed to remove some before the upgrade, but others had to be dealt with during the process. The best approach is to clear out as many deprecations as possible before upgrading. The fewer deprecated elements you have, the smoother the upgrade will be.\ntests are essential This might be obvious, but when you’re making a big change like a Spring Boot upgrade, tests are crucial. They make it much easier to catch problems. Having multiple layers of testing (like unit tests and end-to-end tests) helps a lot. For instance, some issues, like conflicting library versions, might not show up in unit tests but could be caught in end-to-end tests after building the Docker image.\nmonitoring is a must Even with great test coverage and manual testing, production can still throw surprises your way. Good monitoring and SLOs (Service Level Objectives) are essential to ensure everything is working as expected. For example, we quickly noticed a performance drop after the upgrade thanks to our API latency SLOs and were able to fix it by adding indexes to the database.\nsupporting team While I did most of the work and created all the MRs, my team was crucial in reviewing my changes, ensuring I was on the right track, and, most importantly, helping out when issues arose. Having someone to debug and find the root cause with you is invaluable.\nexpect the unexpected No matter how thoroughly you test, there will always be an edge case that slips through. It’s important to be prepared for this and to understand the changes and their potential impacts as much as possible.\nunderstanding management Before starting the upgrades, I estimated how long it would take to complete all the services. Although I finished within my overall timeline, some services took longer due to unexpected issues like library conflicts or unmapped use cases. Having understanding management is key because things can get unexpectedly complex.\nplan for rollbacks Even after thorough testing, you can never be 100% sure things will go smoothly. That’s why having a rollback plan is essential. Make your changes as backward-compatible as possible so you can revert them if needed. Even if you don’t end up needing it, having that option provides peace of mind.\ncommunication is key When making big changes, especially to other teams\u0026rsquo; services, good communication is vital. It helps build confidence that everything is being handled properly and allows more eyes on the changes, which can help catch issues faster. It’s also important to keep other teams, like support and customer success, in the loop so they can connect any new issues from clients to the changes made.\ntechnical problems will get solved No matter how tough a problem seems at the moment, technical issues can be figured out. Sometimes you might not pinpoint the exact line of code causing the problem, but you’ll usually get close enough to find a solution or a workaround. We had a few problems that took hours, and a couple that took days to fully understand, but we eventually figured them out.\nI hope these lessons help you when performing a big upgrade in your systems. They’re not limited to Spring Boot and can be applied to any significant change.\nI didn’t dive into the technical details here, but if you\u0026rsquo;re interested, I’ve written some posts about the technical aspects of this upgrade. Here are a few:\nHow to Migrate Spring Boot from 2.7 to 3.2: A detailed migration guide Migrating Spring Sleuth to Micrometer Observability in Spring Boot 3 Migration from Netflix Zuul to Spring Cloud Gateway Server MVC Replacing deprecated @EnableResourceServer with Spring Security Backwards compatible migration for Spring Batch 5 params table How upgrading from Spring Boot 3.2.5 to 3.3.1 broke our object mapper 90% of distributed traces observability gone after Spring Boot upgrade We have since gone through the next one, from Spring Boot 3.5 to 4.1, and it was a much easier ride. I wrote about what changed and why in Upgrading to Spring Boot 4: Lessons From an AI-First Migration.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-upgrade-key-takeaways/","summary":"Learn key insights from upgrading Spring Boot from 2.7 to 3.2. Discover practical tips, challenges faced, and best practices for a smooth transition","title":"Navigating a Major Spring Boot Upgrade: Key Takeaways"},{"content":"With the Spring Boot upgrade from version 2.7 to 3.3 we had also to upgrade our Spring Batch as well from Spring Batch 4 to 5 and while there are not many changes, the big one for systems that are in production running with the older version is the change in table structure of BATCH_JOB_EXECUTION_PARAMS. In this post, I will go over a migration strategy we follow to be able to seamlessly migrate this table.\nThere are not many code changes required and they are well described in the migration guide in the project documentation, but one thing that the migration suggested in the documentation doesn’t consider is the case of rollback or the case that we need data migration and that’s what I’m gonna talk about in this post how did we do the data migration between Spring Batch 4 and Spring Batch 5.\nThis is a migration script provided by the Spring Batch framework and I’m gonna use the PostgreSQL version because it’s the one that we use as an example. Here is the Migration.\nALTER TABLE BATCH_STEP_EXECUTION ADD CREATE_TIME TIMESTAMP NOT NULL DEFAULT \u0026#39;1970-01-01 00:00:00\u0026#39;; ALTER TABLE BATCH_STEP_EXECUTION ALTER COLUMN START_TIME DROP NOT NULL; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DATE_VAL; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN LONG_VAL; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS DROP COLUMN DOUBLE_VAL; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD TYPE VARCHAR(100); ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME TYPE_CD TO PARAMETER_TYPE; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN KEY_NAME TYPE VARCHAR(100); ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME KEY_NAME TO PARAMETER_NAME; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN STRING_VAL TYPE VARCHAR(2500); ALTER TABLE BATCH_JOB_EXECUTION_PARAMS RENAME STRING_VAL TO PARAMETER_VALUE; As you can see by the migration, we are adding new columns. We are also renaming some columns and we are dropping other columns. This script is fine if you don’t need to roll back your application or you don’t have the risk of needing to roll back the application. But also, I’m not sure that the old batches are gonna fully open in the new application version because as you can see, we are not filling the date and other fields except for the string one.\nA better migration strategy for BATCH_JOB_EXECUTION_PARAMS To be able to have a smoother migration and also be able to roll back to the old version in case of any unexpected problem, we did the process in a few steps.\nThe first thing we did was to add the new columns and now also remove the constraint from the old columns so we can save null on them as well. As this is a backward-compatible change we added this script in the old version before the Spring Boot migration.\nALTER TABLE BATCH_STEP_EXECUTION ADD COLUMN IF NOT EXISTS CREATE_TIME TIMESTAMP NOT NULL DEFAULT \u0026#39;1970-01-01 00:00:00\u0026#39;, ALTER COLUMN START_TIME DROP NOT NULL; ALTER TABLE BATCH_JOB_EXECUTION_PARAMS ALTER COLUMN TYPE_CD DROP NOT NULL, ALTER COLUMN KEY_NAME DROP NOT NULL, ADD COLUMN IF NOT EXISTS PARAMETER_TYPE CHARACTER VARYING(100), ADD COLUMN IF NOT EXISTS PARAMETER_NAME CHARACTER VARYING(100), ADD COLUMN IF NOT EXISTS PARAMETER_VALUE TEXT; So now we have the columns that we are gonna need for the new version and also we still have the columns from the old version. But when inserting new records with the old version of Spring, we are going to have null values on the new columns and also when we run with the new application, the old columns are gonna be null so we’re gonna probably have access or new records or records.\nDespite not being a fan of triggers, it was a good approach to temporarily use triggers to fill the records of the new column when saving with the old application and the old column, saving with the new application. Below is an example of a trigger that we used to accomplish that.\nCREATE OR REPLACE FUNCTION keep_batch_job_execution_params_compatible() RETURNS TRIGGER AS $$ BEGIN -- Check if the new version is being saved IF NEW.PARAMETER_VALUE IS NOT NULL THEN -- Update the older columns from the new columns NEW.KEY_NAME := NEW.PARAMETER_NAME; IF NEW.PARAMETER_TYPE = \u0026#39;java.util.Date\u0026#39; THEN NEW.TYPE_CD := \u0026#39;DATE\u0026#39;; NEW.DATE_VAL := NEW.PARAMETER_VALUE::TIMESTAMP; NEW.STRING_VAL := \u0026#39;\u0026#39;; NEW.DOUBLE_VAL := 0; NEW.LONG_VAL := 0; ELSE NEW.TYPE_CD := \u0026#39;STRING\u0026#39;; NEW.STRING_VAL := NEW.PARAMETER_VALUE; NEW.DATE_VAL := \u0026#39;1970-01-01 00:00:00\u0026#39;::TIMESTAMP; NEW.DOUBLE_VAL := 0; NEW.LONG_VAL := 0; END IF; ELSE -- Update the new columns from the old columns NEW.PARAMETER_NAME := NEW.KEY_NAME; IF NEW.TYPE_CD = \u0026#39;DATE\u0026#39; THEN NEW.PARAMETER_TYPE := \u0026#39;java.util.Date\u0026#39;; NEW.PARAMETER_VALUE := to_char(NEW.DATE_VAL, \u0026#39;YYYY-MM-DD\u0026#34;T\u0026#34;HH24:MI:SS.MS\u0026#39;) || \u0026#39;Z\u0026#39;; ELSE NEW.PARAMETER_TYPE := \u0026#39;java.lang.String\u0026#39;; IF NEW.STRING_VAL IS NOT NULL THEN NEW.PARAMETER_VALUE := NEW.STRING_VAL; ELSE -- new version does not allow null so we wrap it with empty NEW.PARAMETER_VALUE := \u0026#39;\u0026#39;; END IF; END IF; END IF; RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER before_insert_batch_job_execution_params_migration_sync BEFORE INSERT ON batch_job_execution_params FOR EACH ROW EXECUTE FUNCTION keep_batch_job_execution_params_compatible(); Notice that the above trigger only fills in type String and Date and not Long, Double, etc as we only had String and Date parameters. If you want to support other types, you need to modify the above script to handle such scenarios.\nWith this trigger, we guarantee that all the new columns on the table will be filled when the old application is running and after the update, the trigger will fill up the old columns when saving with the new application making all the records backward compatible.\nBefore deploying the new version of Spring Batch, we need one more step. We need to migrate the old rows to fill in the values of the new columns. For that, we run this migration.\n-- update all the DATE fields update batch_job_execution_params set parameter_type = \u0026#39;java.util.Date\u0026#39;, parameter_name = key_name, parameter_value = to_char(date_val, \u0026#39;YYYY-MM-DD\u0026#34;T\u0026#34;HH24:MI:SS.MS\u0026#39;) || \u0026#39;Z\u0026#39; where type_cd = \u0026#39;DATE\u0026#39; AND parameter_type is null; -- Update all the STRING fields that are not null update batch_job_execution_params set parameter_type = \u0026#39;java.lang.String\u0026#39;, parameter_name = key_name, parameter_value = string_val where type_cd = \u0026#39;STRING\u0026#39; AND parameter_type is null AND string_val is not null; -- update all the STRING fields which are null update batch_job_execution_params set parameter_type = \u0026#39;java.lang.String\u0026#39;, parameter_name = key_name, parameter_value = \u0026#39;\u0026#39; where type_cd = \u0026#39;STRING\u0026#39; AND parameter_type is null AND string_val is null AND parameter_value is null; This migration can take from a few seconds to hours depending on the size of your database so I would recommend running directly on the DB before adding to the migration (Flyway) of your application. Otherwise, you could have startup problems as it can take a while.\nSo now we got to the point where we can just deploy the new application and it is gonna work when we try to get from the database the old batches data and also if we return the application to the old version, the new records are also going to be accessible by the old application.\nAfter the new application is running for a while and you are comfortable that you will not need to roll back to the old version anymore, we have some cleanup to do.\nThe first step is to drop the trigger and also drop the function that we needed for the trigger as shown by the script below.\nDROP TRIGGER IF EXISTS before_insert_batch_job_execution_params_migration_sync ON batch_job_execution_params; DROP FUNCTION IF EXISTS keep_batch_job_execution_params_compatible; Also, we can drop the old columns as we will not be needing them anymore and we have already copied the data to the new columns. The script below does the trick.\nALTER TABLE batch_job_execution_params DROP COLUMN IF EXISTS type_cd, DROP COLUMN IF EXISTS key_name, DROP COLUMN IF EXISTS key_name, DROP COLUMN IF EXISTS string_val, DROP COLUMN IF EXISTS date_val, DROP COLUMN IF EXISTS long_val, DROP COLUMN IF EXISTS double_val; Maybe there are better approaches to do this but this one worked well for us so I hope this helps you in the migration process between Spring Batch 4 and Spring Batch 5 and Spring Boot 2.7 to Spring Boot 3.3.\nCheers.\n","permalink":"https://luizvieira.me/spring-batch-5-migration-params-table/","summary":"From Spring Batch 4 to 5 there were changes in the rows on BATCH_JOB_EXECUTION_PARAMS we show an approach that makes the migration easy and backward-compatible","title":"Spring Batch 5: Backwards Compatible Params Table Migration"},{"content":"TL;DR While debugging missing traces from a service upgraded to Spring Boot 3.2.x, I discovered that Spring Boot 3 introduces a default sampling probability of 90%, meaning it discards 90% of traces unless explicitly configured otherwise. This hidden default caused 90% of observability data to be lost after the upgrade, which could have been critical during a major issue. Adjusting the sampling rules and learning how traces are handled in Spring Boot 3 provided valuable insights, though this default behavior feels counterintuitive and risky for developers. I\u0026rsquo;ve since updated my migration guide to highlight this change.\nFull Tale It was Friday afternoon when one of the product managers informed me that they were not able to see alerts from specific API calls to our system in a service that we upgraded from Spring 2.7.x to 3.2.x. We checked the triggers to see if they were configured correctly and they were. We also did not see the distributed trace of the calls in our observability tool (Honeycomb).\nOne of the possible scenarios was that our sampling at the collector level was sampling (discarding) this API request. As we have a good volume of traces that the service generated we introduced a tail-based sampling tool called Refinery which is provided by our vendor Honeycomb. What this does is analyze the whole trace (or part of it if it is too long) and check against the rules configured to check if we should sample or not.\nThere was a small possibility that Refinery could be the problem, but according to our sampling rules, we would be sampling only requests that happen a lot in a very small timeframe and not specific API calls that are not very frequent.\nBut anyway, we decided to exclude that specific API call on the sampling rules to check if it was being discarded by our sampling or not. And guess what it was not.\nThe thing is, there was no trace or any span of the API call after our NGINX reverse proxy. In downstream services, we could see some log lines that had the trace ID, but we didn’t find its spans or trace. So it was generating the trace, but for some reason, it was not arriving in the observability tool.\nAfter a lot of debugging and checking where the trace should be starting in our API gateway, I noticed that some of the tracers started by Micrometer were noop traces instead of real traces.\nNoopScoppedSpan being created due to sampling\nDigging a little bit deeper and after a lot of debugging we found out that in Spring Boot 3, they introduced a property that defines automatic sampling probability of sampling 90% of the traces. Here again, by sampling, I mean discarding 90% of the traces and only keeping 10%. They use the inverse concept that I use where by sampling they mean keeping the tracing (where I use sampling for discarding)\nSpring Boot Sampling Probability\nI was so surprised to see this and so worried at the same time because I realized that we had been missing 90% of the traces after the upgrade. I was also very pissed because it was a hidden property that is enabled by default. I know that people that work in the Spring Projects are a lot smarter than I am but I believe that this property should be optional.\nWe should always send 100% of the traces and if you want it, you could change it or disable it, but not have it by default to send a very small subset of data. I understand that they did that to not overload the services, but that should be an option for the service developer not a default thing.\nI was glad that during the time that the traces were missing, we had no big problems so we didn’t need to go deep, but if we had a severity one issue during that time, it would be really hard to find the calls because most of the observability traces were gone.\nAfter that, I updated my post of Migrating Spring Sleuth to Micrometer Observability in Spring Boot 3 to include this change.\nDespite the bad effect on the system. It was also a very good learning opportunity because I had to go a little bit deeper into how the traces were being started in the services and how that was different in the new version compared to Spring Boot 2.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-3-tracing-sampling-default-probability/","summary":"After upgrading Spring Boot version to 3.3.1 we noticed that 90% of our distributed tracing in our observability tool were gone. In this post we tell the story","title":"Spring Boot 3 Upgrade Lost 90% of Our Distributed Traces"},{"content":"TL;DR Upgrading from Spring Boot 3.2.5 to 3.3.1 introduced a serialization issue with Optional types due to an upgrade in the Jackson Databind library (from 2.15.4 to 2.17.1). To fix it, register the JDK8 module in your ObjectMapper:\nobjectMapper.registerModule(new Jdk8Module()); The issue stems from changes in the Jackson library that now require explicitly adding this module for proper handling of Optional.\nFull Tale After upgrading the services from Spring Boot 2.7 to 3.2.5 without major issues I was not expecting an issue when upgrading from 3.2.5 to 3.3.1 as it is a minor upgrade and in theory we should not have (many) breaking changes. Still, unfortunately, that was not true and we had a serialization issue.\nThe message below shows the stack trace with the message.\nCaused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 optional type java.util.Optional\u0026lt;xyz.joaovieira.models.Stock\u0026gt; not supported by default: add Module \u0026#34;com.fasterxml.jackson.datatype:jackson-datatype-jdk8\u0026#34; to enable handling (through reference chain: …. As it turns out in the new version of Spring Boot 3.3.1 the Jackson databind library was upgraded from 2.15.4 to 2.17.1 (in Spring Boot 3.3.0) and between these two versions, one of the bugs or improvements was added related to the optional class. This is the snippet of the code with the change from this issue and this code change.\nChanges in Jackson Databind library\nI’m not very smart so this doesn’t mean very much to me, but the side effect of this for our project was that we started to get the following error message when trying to serialize an object that had an Optional get method on it.\nAs the message clearly indicates, we need to add the JDK8 module to our object mapper for us to be able to serialize the optional.\nobjectMapper.registerModule(new Jdk8Module());; And doing that really fixes the problem. In a way, it was our mistake that we didn’t have this JDK eight module already in the object mapper but for some reason, it was working before and we did change it. It stopped working.\nSo yeah, if you get an error like the one shown above you just need to add the JDK8Module to your object mapper as the messages say, and the reason is because of that code change in the Jackson Databind library.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-3-3-1-jackson-jdk8module/","summary":"After upgrading Spring Boot from version 3.2.5 to 3.3.1 we started to have a serialization issue with the Optional class. Check how to fix it in this post","title":"How Spring Boot 3.3.1 Broke Our Jackson Object Mapper"},{"content":"My birthday recently passed, and unlike most people who set new goals at the start of the year, I use my birthday as a time to reflect and plan. In this post, I\u0026rsquo;ll share my aspirations and intentions for the upcoming year.\nThis post is more personal than usual, but since this is a personal blog, let’s dive in. For several years now, I\u0026rsquo;ve been writing down my goals. Initially, they were simple, but over time they\u0026rsquo;ve become more detailed and complex. Last year, inspired by the podcast episode Happiness 2.0: Cultivating Your Purpose, I shifted from setting goals to embracing a more enduring sense of purpose.\nGoals vs. Purpose Let’s briefly check what’s my definition of goals and purposes and why I choose purpose instead of goals.\nGoal: A goal is specific and finite. It’s great for changing behaviors or achieving specific tasks. Goals are clear intentions that can be completed.\nPurpose: Purpose is a lifelong pursuit. It is good when you want to continue doing something. Having a purpose is looking forward, and aspiring to do something. The purpose is to have intentionality, a life aim. Something that is always in front of you. It helps us decide when we have to move forward helping us clarify the decisions. Sometimes bigger than us.\nI may be overcomplicating things by focusing on purpose instead of goals, but I find it more fulfilling. Here are my purposes categorized by different areas of my life:\nPurposes for the Next Year (and Beyond) The idea of the purpose is that they are something that I see myself doing for many years, so they don\u0026rsquo;t tend to change a lot. Actually, it changed very little compared with last year. I just try to change it when things in my life change so I try to adjust it accordingly.\nAll of them are important, but the order defines the importance ranking.\nbe happy Enjoy life. Don\u0026rsquo;t let things upset you. Always look for something positive. Being happy (or content) is one of the most important things in life.\nbe healthy Taking care of myself comes first before others. If I am not well, I cannot help or take care of others.\nmaintain weight under 75kg Follow my Pillars of Health be a good husband Be deliberate and not reactive. Don\u0026rsquo;t let things get cold.\ndedicate time to staying together find interesting things to do together pay attention to her and her things be a good friend (and son) Purposely spend time keeping the friendship and investing in people.\nreach out to friends schedule things together spend time with parents be curious Read books, listen to podcasts, acquire knowledge, but don\u0026rsquo;t get overwhelmed.\nread important books listen to good podcasts have a stable financial life (be financially conscious) Keep a good balance between saving for the future and living in the moment.\nkeep investing a portion of the paycheck every month have a simple investment strategy be more playful Don’t take life too seriously. play for playing\u0026rsquo;s sake try to relax more\nbe less impatient (anxious) be comfortable doing nothing check the phone less be present (disconnect) I sometimes live in my imagination and my mind is always active thinking about something. I want to be able to be more present in nature and in the moments that I am sharing with people.\ngo for walks without the phone be present at the meetings (not doing anything else) don\u0026rsquo;t use the phone at the dinner table have a simple life Simplicity is the goal. Have fewer physical goods, fewer tasks, less everything. Throw away what I don\u0026rsquo;t use and just keep the essentials.\nhave only the essential things have a simple digital life explore the world Visit the most places possible and always try to learn something from the places that you go.\nuse the money on the Travel Piggy Bank to travel be in the moment, not in the phone be a good professional have extreme Ownership at work document knowledge and share it work only on work hours (AND NOT MORE) These are some of the things that I strive for. They don\u0026rsquo;t encompass everything but serve as a good guideline on what is important to me and what I have to focus on. I go back to the list often when I feel that I need a reminder of what I have to strive for.\nHope this helps you in any way, shape, or form.\nCheers.\nPhoto by Markus Winkler on Unsplash\n","permalink":"https://luizvieira.me/goals-purposes-year/","summary":"Planning for the year enables me to accomplish my goals. In this post, I share some of the aspirations I aim to achieve.","title":"Goals and purposes for the next year"},{"content":" I first heard about the book The Comfort Crisis when reading Outlive and as I really liked that book, I decided to give it a try to The Comfort Crisis as I am looking to improve my Pillars of Health and the title also caught my eye.\nLet’s see a bit more about the book The Comfort Crisis: Embrace Discomfort to Reclaim Your Wild, Happy, Healthy Self.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from The Comfort Crisis Book The Comfort Crisis\nThe book is a little bit different than expected because it contains many stories about the author\u0026rsquo;s adventures in places with discomfort and not only information from research. Maybe it is a good balance between stories and the information but I was not expecting a lot of stories.\nI liked the book, and maybe it is just confirmation bias, but I also think that we have too many comforts and we don\u0026rsquo;t expose ourselves to discomfort anymore so we are in a way becoming soft. Don\u0026rsquo;t get me wrong, I love comfort, but if we never expose ourselves to challenging situations, we are never going to grow and also never going to really get to know what we are really capable of doing.\nThe book has some good learnings and I will share the 5 most important learnings from the book.\nwe need more boredom This is something that I have been trying to expose myself to. Today we have many technologies and information (TV, cell phones, etc) and we are very rarely bored as we have an easy escape with any of these technologies.\nThe book cites some studies showing that our lack of boredom is leading us to be more mentally fatigued, less creative, and a lot more anxious because we are always being stimulated, not having our mind wander, and receiving a lot more information than we evolved to receive.\nwe need more nature time I am very biased on this one because even before I read this book, I added \u0026ldquo;Access to nature\u0026rdquo; to my Pillars of Health. Being in nature reduces a lot our stress levels as the book mentions \u0026ldquo;They discovered that 20 minutes outside, three times a week, is the dose of nature that most efficiently dropped people\u0026rsquo;s levels of the stress hormone cortisol.\u0026rdquo; (without the phone, of course).\nIt also helps us to give another perspective on our problems as we take in the beauty of nature. I personally feel a lot happier and grateful for what I have after a walk in nature.\nthe power of silence Silence is another thing that is hard to find especially for us that live in the cities. As I write this, I can hear trucks backing up, cars on the road, my dishwasher working, and the SkyTrain passing.\nBut silence is essential for relaxation. According to the book \u0026ldquo;Other research found that two minutes of silence led to the bigger drops in measures of relaxation like blood pressure and heart and breathing rate compared to a handful of other relaxation techniques. Yes, silence is more relaxing than most of the \u0026lsquo;relaxing\u0026rsquo; products marketers try to sell us.\u0026rdquo;\nSo, even if silence is uncomfortable, it is worth seeking it.\nexercising should not be only physical When we think about exercising, we think that we are going to exercise our muscles. That is true, but according to the book, we should also exercise our cognition while exercising. As the book says \u0026quot;\u0026lsquo;If you put people outside, like if you\u0026rsquo;re going for a bike ride or trail run, where you\u0026rsquo;re having to navigate, make decisions about when to stop, how to pace, where to turn\u0026hellip; all of those things add a cognitive challenge to that activity.\u0026rsquo; And that, Raichlen believes, could enhance and protect the human brain— sharpening it, making it quicker and more disease-resistant.\u0026quot;\nhard tasks improve us Another point brought from the book is that what improves us the most is the harder and uncomfortable things that we do. It makes sense as the real things that we value the most are not easily acquired but the ones that we need to put effort into.\nThe book also talks about misogi. Doing something that is really hard and that you have a high chance of failure. While I liked the concept and idea, I find that it is kinda hard for normal people to do that.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Scientists are finding that certain discomforts protect us from physical and psychological problems like obesity, heart disease, cancers, diabetes, depression, and anxiety, and even more fundamental issues like feeling a lack of meaning and purpose.\u0026rdquo; \u0026ldquo;What\u0026rsquo;s more, new comforts have moved the goalpost further away from what we consider an acceptable level of discomfort.\u0026rdquo; \u0026ldquo;Despite the fact that people today are rarely alone, we are increasingly lonely.\u0026rdquo; *\u0026ldquo;Finding a different outlet for boredom also lets us tap into creativity.\u0026rdquo; \u0026quot;\u0026rsquo;\u0026hellip;OK, many people find it odd to measure things. Many people are also sick, fat, poor, slow, and ignorant as a result of nonmeasurement.\u0026rsquo;\u0026quot; These are my learnings from the book The Comfort Crisis: Embrace Discomfort to Reclaim Your Wild, Happy, Healthy Self written by Michael Easter. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-comfort-crisis/","summary":"These are my learnings from the book The Comfort Crisis: Embrace Discomfort to Reclaim Your Wild, Happy, Healthy Self written by Michael Easter","title":"Learnings from the book The Comfort Crisis"},{"content":"Spring Cloud Starter Netflix Zuul was deprecated a long time ago and its last version was published in November 2021 and it was officially compatible with Spring 2.3.12.RELEASE but by a miracle, it was still working with the version 2.7.x which was the latest version of Spring Boot 2.x.\nBut postponing and hoping it continues working with newer versions of Spring is not a good strategy and also we would be stuck with a library with no security fixes and new functionalities, so we had to look for a replacement\nThe best contender for replacing Zuul is Spring Cloud Gateway. The first Spring Cloud Gateway project (and the main one) is reactive and while it may be the best option for an api-gateway, it is a very big change to do both the framework change and also from MVC to reactive and I personally don’t have experience with reactive apps and thought it to be a bit risky to try for an important service.\nLuckily for us in November 2023, Spring Cloud Gateway got a new Server MVC version released on the Spring Cloud 2023.0.0 release train. This new MVC was a great candidate for us, in case we want to continue it being an MVC so we decided to migrate our Spring Cloud Starter Netflix Zuul to Spring Cloud Gateway Server MVC\nSpring Cloud Gateway Server MVC Spring Cloud Gateway Server MVC is different from Zuul and also from the majority of other Spring Projects as it uses WebMvc.fn (functional endpoints) and it supports almost everything that we had with Zuul but also provides more filters compared to only Filter Path in Zuul.\nThe 3 main building blocks are Routes, Predicates, and Filters (source).\nRoute: In simple terms, to which downstream service the request will be sent. Predicate: What you use to filter requests. You can match anything from the HTTP request, such as headers or parameters. Filter: Used to modify requests and responses before or after sending the downstream request. Also, used to add logic to handle and block requests. Here is where we say what can and cannot go through. If you are familiar with Zuul, the concepts are kind of similar, but here we have a lot more flexibility in the new SCG Server MVC.\nIn our case, when we receive a request, the first step is that it goes to Authentication and Authorization. After that, it determines the routes based on the Predicates (in our case, the Path of the request) and uses the Filters to modify the request as needed and forward it to the downstream service.\nFrom Spring Cloud Starter Netflix Zuul to Spring Cloud Gateway Server MVC It is easier to understand with an example, so let’s talk about how we set up before when we were using Netflix Zuul and how we are setting up now with SCG Server MVC.\nFilters In Zuul, the basic structure of a filter is shown in the example filter ExampleFilter below.\n@Slf4j @Component public class ExampleFilter extends ZuulFilter { @Override public int filterOrder() { return -1000; } @Override public Object run() { // logic here return null; } @Override public boolean shouldFilter() { return true; } @Override public String filterType() { return PRE_TYPE; } } The filterOrder determines the order in which this filter will run relative to all other filters. In SCG the order is defined by the order we put the filters in the route configuration. I will show a bit more about the order when we talk about Routes.\nThe shouldFilter determines if this filter should run, in the example above it is true so it will always run, but for some other filters, we check ENV variables, request info, etc. This is not implemented in the SCG but we can still use the same function and just return the request. I will show a better example soon.\nThe most common filterType are PRE_TYPE and POST_TYPE. Basically, it defines if the filter should run BEFORE sending the request downstream or AFTER (before returning the response). In SCG, we have different filter types as well.\nBy default, SCG has many useful ready to use filters, but we can also write our own custom ones which is what you are probably going to need.\nWe have the Before Filter which is the same as PRE_TYPE where we manipulate a request before sending it downstream. For example, the ExampleFilter is a PRE_TYPE, and this is how it became after the change to SCG.\npublic static Function\u0026lt;ServerRequest, ServerRequest\u0026gt; exampleFilter() { return request -\u0026gt; { // your logic here return request; }; } One example of an After Filter (old POST_TYPE) is shown below in the SCG\npublic BiFunction\u0026lt;ServerRequest, ServerResponse, ServerResponse\u0026gt; afterFilter() { return (request, response) -\u0026gt; { // your logic here return response; }; } In this case, as it is an after-filter, we have access to the request and also the response so we can change the response if we want.\nSCG also has a filter that can do both before and after so you can manipulate the request and the response in the same place. We have a new RedirectFilter that applies this concept as shown below.\npublic HandlerFilterFunction\u0026lt;ServerResponse, ServerResponse\u0026gt; redirectIfNoAuthorization() { return (request, next) -\u0026gt; { // logic before ServerResponse response = next.handle(request); //logic after return response; }; } And that is basically the most important point from the filter perspective, but how do we make the filter be evaluated? That is where we need to define Routes.\nRoutes Routes define where you send the request downstream. To which service, to which path, etc.\nRoutes in Netflix Zuul In Zuul, one of the ways to define the route configurations was on the application properties file. Like the example below for my-service.\nzuul: routes: my-service: path: /my-service/** serviceId: my-service This basically uses a “path” filter and filters all the calls that start with /my-service and route to my-service. But then you ask (at least I asked myself), how does it know which port it forwards to? For that, Zuul has a ribbon configuration similar to the one below.\nmy-service: ribbon: listOfServers: http://my-service:9600 How do we make this work in SCG Server MVC? That is a great question, I am glad you asked.\nSetting Routes in Spring Cloud Gateway Server MVC While in SCG we can also set routes in the application properties file, I decided to go with the Java configuration as it is more compile-friendly and it can break if there are some configuration issues. It also allows us to pass non-static context to the filters (maybe it is possible in properties, I just didn’t try).\nLet’s see how we can configure my-service to continue working as before. For that, we created a ServiceRouter configuration component with beans for each route. The following bean is for my service.\n@Bean public RouterFunction\u0026lt;ServerResponse\u0026gt; myServiceRouter() { return route() .route(path(\u0026#34;/my-service/**\u0026#34;), http()) .filter(lb(\u0026#34;my-service\u0026#34;)) // other filters .build(); } Here we are creating a route to filter for the path(\u0026quot;/my-service/**\u0026quot;). Everything that starts with my-service will be using the load balancer with id my-service which is configured in line .filter(lb(\u0026ldquo;my-service\u0026rdquo;)).\nBut here again, you ask, how does it know the IP? In theory, it has some fancy ways to do discovery, but as we were not doing it before, I didn’t try here so I went with the simplest approach, I set up a list like we had before in application properties. The following is the configuration of the load balancer for the service.\nspring: cloud: discovery: client: simple: instances: my-service: - uri: http://my-service:9600 Notice that it does not use MVC, but Spring Cloud Discovery. But it works, I swear (I tested it on my machine 😬 )\nAdding Filters to Routes I told you guys that I was going to talk more about the order of the filters. Now it is the time. In the myServiceRouter above we omitted the filters on purpose, now it is the time to see more of them.\nYou can see that after .filter(lb(\u0026ldquo;my-service\u0026rdquo;)) we added a bunch of before(), filter(), and after().\n@Bean public RouterFunction\u0026lt;ServerResponse\u0026gt; myServiceRouter() { return route() .route(path(\u0026#34;/my-service/**\u0026#34;), http()) .filter(lb(\u0026#34;my-service\u0026#34;)) .before(before1()) .before(before2(\u0026#34;my-service\u0026#34;)) .before(before3()) .filter(filter1()) .before(before4()) .before(before5()) .after(after1()) .after(after2()) .build(); } All of these are our lovely custom filters. The keywords before, filter, and after define when they execute, based on their type, and the order in which they are defined is the order that they will execute. Easy peasy, piece of cake.\nWe already notice that almost everything is really different. I feel that I rewrote the whole api gateway service. But after finishing, it was not that complicated. We just had to put the things in new places.\nWhat we are missing It is not just flowers, Spring Cloud Gateway Server MVC also has its flaws. The only one that I was not able to find a workaround for is the specific service read-timeout configuration.\nIn Zuul with Ribbon, we were able to define a general read timeout\nribbon: ReadTimeout: 15000 And this we still can do with SCG using the config below\nspring: cloud: gateway: mvc: http-client: read-timeout: 15s But one nice thing that Ribbon had and that LoadBalancer does not have (as implemented yet on Server MVC) is the per-route timeout.\nIn Ribbon, we had this in some services\nanother-service: ribbon: listOfServers: http://another-service:9100 ReadTimeout: 30000 I even opened an issue in the repo https://github.com/spring-cloud/spring-cloud-gateway/issues/3378 and the god of SCG (the guy who coded it) said we don’t have it yet but hopefully we will get it in the future.\nPerformance I didn\u0026rsquo;t fully do a performance test to compare both versions, but what I can say is that the metrics of memory and CPU usage were basically the same in production as the previous versions. We still didn\u0026rsquo;t enable the virtual threads yet so I guess once we do it the performance will be even better.\nThis was a bit on how to migrate from Spring Cloud Starter Netflix Zuul to Spring Cloud Gateway Server MVC. I hope this article helps your migration to be less painful and with less incidents.\n","permalink":"https://luizvieira.me/migration-netflix-zuul-to-spring-cloud-gateway-server-mvc/","summary":"I have recently migrated our API gateway from Spring Cloud Starter Netflix Zuul to Spring Cloud Gateway Server MVC and here is a complete guide on how to do it","title":"Migrating Netflix Zuul to Spring Cloud Gateway Server MVC"},{"content":" When I started to write things down, the Pillars of Health was one of the first and main ones that I started. I started collecting information from many sources over the years and decided to compile it in a document to make it easy to follow.\nDespite being sourced from many places, the main ones were the Huberman Lab podcast and the book Outlive. Check the Sources section for more details.\nBut what is the goal of the Pillars of Health? For me, it is a list of ideal things that I should be doing in order to increase my healthspan and lifespan, or in other words, it is a central place with the best practices for me that if I follow, I will live more and better.\nThese pillars were designed in a way that I can follow for years or decades and not something to do for a while. They work as a guideline and I am always striving to accomplish them but I’m a fallible human. I try to do them as much as possible.\nWhen I started applying this I was relatively in good health but according to my bioimpedance scale* I was bordering obesity, 3 years older than I really was (metabolic age), with high subcutaneous fat and on the limit of the acceptable visceral fat (acceptable, but not good). I know that this kind of measurement device is not very precise, but I didn\u0026rsquo;t need precision to tell me that I was not on a good path.\nPillars of Health My Pillars of Health are divided into 6 parts, they are Sleep, Sunlight, Movement, Nutrition, Stress control, and Social connections. Let\u0026rsquo;s see all of them in detail below.\nSleep I never paid attention to my sleep that much and sometimes in my life, I tried to not sleep much to be more awake producing things and doing. I sometimes even said: \u0026ldquo;I will sleep a lot when I die\u0026rdquo;.\nHopefully, I changed my mind about that, and in the last 2 to 3 years, I have made sleep my priority.\nToday, my guidelines to sleep are:\nGive myself 9 hours of sleep opportunity. Last meal at least 3 hours before bed Go to bed at the same time every day (including weekends) Don\u0026rsquo;t read or do other activities in bed (we don\u0026rsquo;t have TV in the bedroom) Avoid caffeine after 12 PM Sunlight Having sunlight at the beginning of the day and its absence during sleep are essential to adjust our circadian rhythm and also for me, it helps in the mood.\nThese are my guidelines\nSee sunlight in the morning as early as possible when we wake up. 10 minutes when sunny and 20 when cloudy Dark room to sleep (with no electronic lights) Movement This is a very important pillar but for this one, I don\u0026rsquo;t have a very strict guideline. I have some general ideas and I change them according to what I am doing on that week/month.\nAs VO₂ Max is one of the most potent predictors of length of life and the more muscle mass we have when we are getting old, the lower the risk of death. I try to focus on both cardio and strength exercises.\nCardio (50%) I try to dedicate 50% of my time to cardio activities. I try:\nWalk as much as possible At least 10 thousand steps on average per day. I like walks after work as it helps me switch my mind off from work and also relax from the stress of the day.\n240 minutes (4 hours) of Zone 2 per week I don\u0026rsquo;t achieve this one every week, but I strive for it. I like hikes in nature as my primary source but I also complement it with a treadmill with elevation or a stationary bike.\n1 day of max VO2 max per week For this, I usually run 5k or do a 4 min run, 4 walk for 4 to 6 times.\nStrength (50%) I started strength exercises 3 to 4 months ago after years without going to a gym so I am still figuring out what I like to do but in general, I do exercise to build general strength and tone the muscles but not be a bodybuilder.\nI am doing strength exercises 3 to 4 times a week for around an hour now.\nI try to pay attention to:\nConcentric and eccentric loading for all movements (we need to be able to lift the weight up and put it back down, slowly and with control.) Grip strength, how hard you can grip with your hands Hip-hinging movements (Bend at the hips, not the spine, to harness your body\u0026rsquo;s largest muscles, the gluteus maximus and the hamstrings) Flexibility and stability I started doing yoga 4 years ago at home following an app and I still do it. I still don\u0026rsquo;t have the flexibility I wished but I keep doing yoga 3 times a week.\nNutrition I don\u0026rsquo;t subscribe to any \u0026ldquo;diet\u0026rdquo; or \u0026ldquo;eating style\u0026rdquo; and I eat everything but I have some guidelines I try to follow when eating that are pretty healthy compared to the average of people.\nWhat is most important for me is not what type of food I am eating, but how many calories I am consuming. I have paid a lot of attention to the calories in the last few months and it has been eye-opening for me and also helped me get good results.\nI mostly eat food cooked at home (we rarely go to restaurants) and most of our food is not processed. We don\u0026rsquo;t have much processed food at home and we are big on salad and vegetables. I say we because my wife and I try to take very good care of our food.\nIn general, these are the guidelines:\nFocus on quality nutrition. Get most of the calories from minimally processed foods. (No junk food) Don’t overeat. (pay attention to the body) Prefer food that your great-grandmother would recognize as food. Avoid food with added sugars Prefer organic Prefer Mediterranean-style diet, relying on more monounsaturated fats and fewer refined carbohydrates, in addition to regular consumption of fatty fish (Salmon, mostly). Drink water: When you think you are hungry, maybe you just need water. Targeting 160 grams of protein per day (around 2.1g/kg) Pay attention to the calories of things Reduce alcohol consumption Mental health In the last few years, I have been paying more and more attention to my mental health. I tried to simplify my life a lot and only worry about things that are under my control or things I cannot outsource.\nAccess to nature I grew up on a farm and I love nature. Where we live now we have some beautiful nature with mountains, sea, etc.\nSo I try to be more with nature. I try to connect with and let my mind wander. Many studies show that being more with nature decreases stress levels and increases life satisfaction.\nReduce information gathering In a way, I\u0026rsquo;m addicted to learning. I read a lot of books and listen to a lot of podcasts (16,789 minutes last year alone) but I am selective on what information I get.\nI for example don\u0026rsquo;t follow news or things that are happening with other people.\nBut I am also trying to reduce the books and podcasts that I listen to. I\u0026rsquo;m trying to pick the best only and not just do it because I\u0026rsquo;m bored or something.\nGood social connections Having good social connections is essential for a healthy and happy life but we want social connections that are positive, that help us, and not social connections that take you down. Focus on connections with people that give us energy.\nAvoid social media I deleted my Instagram account around a year ago and I have been loving not having the desire to share everything and also to check what others are doing. Also, I don\u0026rsquo;t have the obligation to reply to messages for very shallow connections. I now prefer a few deep connections to many shallow ones.\nI\u0026rsquo;m not totally free of social media as I have LinkedIn (but I rarely access it) and WhatsApp which for me is more like a fast communication tool than social media as I just use the message and calls features.\nSources As I mentioned above, I didn\u0026rsquo;t create this from scratch but based on a few sources that are based on science and studies. I have also adapted to what works for me and what I like or not.\nHere is a complete list of the sources:\nBook Why We Sleep: Unlocking the Power of Sleep and Dreams Huberman Lab Podcast episode Mental Health Toolkit: Tools to Bolster Your Mood and Mental Health Book Outlive: The Science and Art of Longevity Ten Percent Happier with Dan Harris Podcast episode The Science of Longevity | Dr. Peter Attia ","permalink":"https://luizvieira.me/pillars-health/","summary":"My Pillars of Health are guidelines that help me keep healthy and push me to do things that will make me feel better and have a good lifespan and healthspan.","title":"My Pillars of Health: Guidelines to Live Healthier"},{"content":" In a way, I have been exposed to some of the stoic philosophy by some blog posts and podcasts but after listening to William Irvine in a few podcasts I decided to dig a little bit deeper and read his book A Guide to the Good Life.\nLet’s see a bit more about the book A Guide to the Good Life: The Ancient Art of Stoic Joy.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from A Guide to the Good Life Book A Guide to the Good Life\nThe book contains nice content which for me was not so new as I was already exposed a bit via the podcasts. But I found the reading of the book too difficult sometimes. The author plays too many if-then scenarios or \u0026ldquo;a reader will point out this or that\u0026rdquo; which made it a less interesting read for me. Close to the last chapters, I found myself not interested anymore and just skipping some pages looking for good content.\nAs the stoic seeks tranquillity, I was losing mine at the end of the book already. But nevertheless, the book contains some good learnings, here are the 4 most important learnings from the book.\nwe need a philosophy of life The book from the start defends the idea of having a philosophy of life. The idea is that a philosophy of life will help you make decisions easily that go according to your goals. If you don\u0026rsquo;t have one, it is hard to know if what you are doing is in accordance with your goals or if you are misliving it.\nAlso, having a philosophy of life, makes you think of what is really important for you and what is not. Because if you don\u0026rsquo;t know what you are trying to achieve in life, how do you know if you are achieving it or not?\navoid hedonic adaptation Hedonic adaptation is a phenomenon in which we get accustomed to things we have and we start seeking new things. It is like a luxury becomes a need and we start looking for another luxury. This insatiable desire tends to make us unhappy as \u0026ldquo;rather than feeling satisfied, we feel a bit bored, and in response to this boredom, we go on to form new, even grander desires.\u0026rdquo;\nWhile it\u0026rsquo;s good to seek better things, if we are not aware and have a limit, we run the risk of never being satisfied and always looking. If you are content with what you have, it is a lot easier to be happier than if you are not.\nbe fatalistic about the past, not the future We cannot change the past, but we can work to change our future. Because of that, we only should be fatalistic about the past, and not the future.\nnegative visualization When we practice negative visualization, we are contemplating the bad things that can happen to us. The benefit is that when we do that, we tend to give more value to the things that we have because we know we can lose them and we have a glimpse of how we would feel when we do lose them. In a way it prepares us to be more emotionally resilient and also helps us appreciate more of what we have.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;There are things over which we have complete control, things over which we have no control at all, and things over which we have some but not complete control.\u0026rdquo; \u0026ldquo;When contemplating whether to criticize someone, he should consider not only whether the criticism is valid but also whether the person can stand to be criticized\u0026rdquo; \u0026ldquo;More generally, when we find ourselves irritated by someone\u0026rsquo;s shortcomings, we should pause to reflect on our own shortcomings.\u0026rdquo; \u0026ldquo;Of the kinds of humor we might use in response to an insult, self-deprecating humor can be particularly effective.\u0026rdquo; \u0026ldquo;Someone with a coherent philosophy of life will know what in life is worth attaining, and because this person has spent time trying to attain the thing in life he believed to be worth attaining, he has probably attained it, to the extent that it was possible for him to do so.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nHidden Brain Podcast Episode Minimizing Pain, Maximizing Joy The Knowledge Project with Shane Parrish podcast episode #123 William Irvine: How To Live a Stoic Life These are what I learned from the book A Guide to the Good Life: The Ancient Art of Stoic Joy written by William B. Irvine. A special thanks to Vancouver Public Library (VPL) for allowing free access to the book.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-a-guide-to-the-good-life/","summary":"These are my learnings from the book A Guide to the Good Life: The Ancient Art of Stoic Joy written by William B. Irvine","title":"Learnings from the book A Guide to the Good Life"},{"content":"At the end of last year, my wife (May) and I each listed our top 5 favorite places to go in the whole world and the idea was to travel to only places that were on our list. For May, Dubai was the first and when planning this year\u0026rsquo;s big travel, Dubai was one of the best options for the year so we decided to go.\nWe went at the beginning of the month of May, which is already getting very hot in Dubai as the summer is approaching. In theory, it is better to go before as the weather is milder and it is better to enjoy it, but we had an anniversary that we wanted to celebrate there.\nDubai is an incredible city, it is amazing to see how everything was built so fast and so big. It is really amazing that they built Burj Khalifa and the Palm Jumeirah in around 6 years. It is good to see what humans are capable of achieving (given enough resources and motivation).\nMajor things about Dubai It was a memorable trip in many aspects, especially for May as it was her top place to go in the whole world. I will try to summarize a bit of the most important aspects for someone who wishes or is planning to go there.\nCamels As I mentioned in the post, \u0026ldquo;Dubai Desert Safari: Is it worth it?\u0026rdquo;, camels were one of the main things that we wanted to see. They are really common if you go outside the city. We saw and rode one in our Desert Safari, and also in The Camel Farm.\nThe Camel Farm was the best place as we got an animal feeding tour and were able to feed the camels and also to be close to them. Despite people warning us that they smelled bad, we didn\u0026rsquo;t feel much as the places that we got close to them they were showered.\nThe Camel Farm For sure one of the best service experiences that we had in Dubai was in the Camel Farm. We got the \u0026ldquo;Admission with Tour Guide and Animal Feeding\u0026rdquo; for the first time available (9 AM) and our tour guide Samson was really amazing! We were the only ones at that time so we went animal by animal feeding and having fun knowing more about them.\nThe Farm is not big, but it is really nice! We saw many animals and the best of all was our experience feeding the birds and mostly the camels. They had many camels and we could really touch them and be close with them. We had lots of fun and really recommend this activity.\nWe also rested in the tent and drank an arabica coffee and rested there. We also did the \u0026ldquo;Short Camel Ride in the Farm\u0026rdquo; and it was nice, it was only one each and it was a good experience.\nWe and the Camels at the Camel Farm\nBurj Khalifa Burj Khalifa is amazing and impressive. We went to see it many times during the day and also at night. During the night it has some light show and a whole side lights up with its impressive LED panel.\nView of the Burj Khalifa\nWhen you think about going up in the paid floors, you basically have two options, the top which is \u0026ldquo;At the Top\u0026rdquo; which is the 124 and 125 floors, and \u0026ldquo;At The Top Sky\u0026rdquo; which is 148. The price difference is huge and we thought that the 124 and 125 were enough for us and it really was. There were not so many people and we were able to see everything. We waited close to the sunset so we saw it during the day and also during the night.\nView of the Dubai Fountain from Burj Khalifa 125th floor\nDubai Fountain Right in front of Burj Khalifa, we have the Dubai Fountain, and the water shows are amazing. We watched many and some of them also have the LED shows in Burj Khalifa.\nIt is amazing that human beings have the potential to create great things. Especially when the budget is not a big constraint.\nDubai Fountain water show\nDesert dunes The best view of the desert dunes that we had was during the Desert Safari because the car went a lot in the middle of the desert. Most of the desert around has a lot of bushes and does not have dunes like the stereotypical desert that we wanted.\nThere was one place that was recommended to us by a friend\u0026rsquo;s friend, and we were able to see dunes without the need to go inside the desert. This is the location in case you want. Unless you have a 4x4, we recommend leaving the car on the side of the road and going walking.\nDesert Safari We went on a Desert Safari tour and as it was one of the main things, I created the post Dubai Desert Safari: Is it worth it? where you can find more about it.\nParking Parking was free in all the malls that we went to. In the city, there\u0026rsquo;s paid parking and you can pay via WhatsApp. We sent a chat message to the RTA bot with the parking number and it charged us from a preloaded account that we paid with a credit card. We tried to use the App but it required phone number validation via SMS which I didn\u0026rsquo;t have access to.\nAlcohol Buying alcohol in Dubai is a bit challenging as there are only a few stores that sell it. We went to an MMI store and had to create an ID to be able to buy alcohol. We only bought Heineken and paid 8 DHS for a pint (473 ml). We went to another called African + Eastern but the prices were higher (same 8 DHS but for a 330 ml Heineken).\nIt is funny that the stores are usually kind of hidden and the only outside thing they have is the store logo, but no glass windows showing inside or anything showing.\nMobile data We bought in Nomad for 5G 5GB for 18 CAD each. It was enough for us for 8 days. The one that I was using Google Maps on the car was the one that used the most data and almost used all the data.\nIt was our first time using a travel SIM and it was really easy as we used an eSIM, so we just bought it online, scanned the QR code, and activated it when we got there, very very easy.\nLocal clothing We wanted to have some local clothing to look like the locals and also to use in the Mosque. We bought our clothing at Carrefour. I paid around 110 AED for the whole thing (Agal, Ghuthra, Kandura, Sawal)\nBeach We went to Jumeirah Beach which was close to Dubai Canal and it was not that good. We tried another one but it was not as good as the Jumeirah Beach which is closer to Burj Al Arab. It had clean water, a good patch of sand, and also a public restroom nearby. It was also easy to park.\nWe went very early (around 6 AM) and stayed until around 10 AM and left before the UV got too high.\nJumeirah Beach with view to Burj Al Arab\nSupermarket We went to two big supermarket chains, one was Carrefour and the other was Lulu. The ones that we went to were very conveniently located at shopping malls.\nWe like to save during travel, so we use a lot of the supermarket\u0026rsquo;s ready-to-eat food. Both are nice, but Lulu had a place to eat inside (the cafeteria) so we could have lunch there.\nHotel When looking for hotels we were trying to find a good hotel with a good price that was not very far away from the Burj Khalifa and the main attractions. Also, at that time we were not considering renting a car. The best cost-benefit option that we found was the Rove City Walk and it turned out to be an excellent choice. The hotel is great. It has a gym (that we didn\u0026rsquo;t use), a pool with a view to the Burj Khalifa (that we definitely used) and it is around 25 minutes walking to Burj Khalifa.\nThe room was really clean and beautiful with a very comfortable bed. It had a minibar, an electric kettle but lacked a microwave. We had a view but it was on the opposite side of Burj Khalifa.\nThe View at the Palm We were not planning to go to The View at the Palm but when we visited The Palm Jumeirah we decided it was worth taking a look from the view and it was really nice. It is not a very high point (compared to Burj Khalifa), but we could have a view of all the Palm.\nView from The View at the Palm\nAlso, we liked a lot the interactive history of the building of the palm that we had before going to the top of the view. It was really nice to learn more about how this amazing structure was built.\nPaying for things Almost all places accept credit cards. Only one or two only accepted cash. For the credit card, I used the Wise Credit Card to save on the conversion rate. I preloaded an account in AED and when paying, Wise got the money from that account.\nCash For cash, I withdrew money from an ATM at the airport. I used the Wise Credit Card and the ATM fee was only 1.06 AED\nCar rental When looking for a car rental, there are a lot of options. Most of them are very well-known brands like Enterprise, Alamo, Hertz, etc and they also have some that look local.\nI didn\u0026rsquo;t want to risk it so I booked Enterprise in advance. We got a mid-size SUV and the actual car was a JAC S3. The car was brand new (only 6k km) and it was in good condition. It had CarPlay but only used the cable. It was a good car but not a car to go in the sand. It easily got stuck when we went to the side of the road where it had sand.\nTolls The city has a lot of tolls on the main roads. The tolls are charged automatically when you rent a car. The Enterprise charged us 5.25 AED for each toll gate we passed and in total, we passed around 20 gates.\nExotic cars We didn\u0026rsquo;t see as many exotic cars as our friends were expecting as a lot of people asked us about the cars there. We saw very few exotic cars and the most we saw was on the Jumeirah Palm at night one day. In all fairness, we didn\u0026rsquo;t go out at night much and mostly visited things during the day.\nAl Fanar Restaurant We didn\u0026rsquo;t go to many restaurants, but we decided to go to one of the best that we could find that was thematic and had local dishes. We chose Al Fanar in the Dubai Festival City Mall and the experience was excellent.\nWe decided to try shobat harees, hobool, and the mix grill table which was excellent. The dessert was sizzling dates.\nAl Fanar Restaurant Dishes\nThe service was excellent, our server was Amit and he was very nice and very attentive. He explained the dishes with attention and calm and also gave us good food suggestions as he knew we didn\u0026rsquo;t know about the local food.\nMosque We didn\u0026rsquo;t go to a mosque in Dubai but we went to the Sheikh Zayed Grand Mosque in Abu Dhabi. It is huge and really beautiful.\nSheikh Zayed Grand Mosque in Abu Dhabi\nAre things cheap in Dubai? We are not big shopping people and we don’t buy anything (except in supermarkets), but we looked at the prices of things in the shopping mall and also in an outlet and for everything that we look at (clothes, shoes, perfumes, etc.) But most of the things were more expensive than they are in Canada (Or at least the same price). So we don’t know why Dubai is so famous for shopping because for us it was not interesting at all (but we are not shopping people anyway).\nIs Dubai a walkable city? Definitely not. Everything is big and far apart. Also, the sun and the heat don\u0026rsquo;t let you walk that much. We were able to walk in very few places, around the Burj Khalifa is really nice to walk, in the old city you only get by walking, and in a neighborhood where there were a lot of stores.\nSummary For sure Dubai is a really interesting place to go. It has many attractions for different people and different interests. This was a bit of what we did and what we liked. Hope it helps you to decide if it is a place for you to go or not.\nHappy travels!\n","permalink":"https://luizvieira.me/best-of-dubai/","summary":"We stayed 8 days in Dubai and in this post, we describe the best attractions and what you need to know before going to Dubai.","title":"The Best of Dubai: Everything We Did and Liked Most"},{"content":"One of the things that we were most looking forward to seeing in Dubai was the desert dunes and also the camels and the desert safari offered both things for us so we decided to do it.\nThere are a lot of options available from many different websites. We tried to choose one with a good review (4.9 out of 5 from more than 19k reviews) and affordable but not the cheapest one as we wanted to do a good tour because it was one of the main things that we were gonna do there.\nWe chose one that included dune bashing, sand boarding, camel ride, quadricycle, and barbeque dinner with show and presentations. We bought it via getyourguide.com and the tour was operated by Amar Tours.\nDescription of the Dubai: Safari, Quad Bike, Camel Ride, and Buffet Dinner\nquad (ATV) ride The first activity was the quad bikes (ATV). On the tour, each of us went with an ATV and we followed a guide in some small desert dunes and stopped in the middle for some pictures. It was a really good experience and it was worth it for us. It was our first time on an ATV and we really liked it. It is more difficult than it seems due to the sand and we recommend using some face protection as we didn\u0026rsquo;t use any and there was a lot of sand.\nJV in an ATV in the middle of the Dubai Desert Dunes\ndune bashing On this one, we stayed inside the 4x4 vehicle that picked us up and the driver (guide) drove us radically to the dunes. This was the worst experience possible. The car has 8 seats and unless you are the driver or the shotgun you almost cannot see anything and just feel the car shaking and moving as it goes via the dunes. We got motion sick, it was horrible. It was not the driver\u0026rsquo;s fault, it was the activity itself that was bad by design (for us at least).\ndesert view The only good thing about the dune bashing is that it goes into the middle of the desert dunes and the desert view was really awesome. It was really what we were expecting from the desert. We stayed around 15 minutes in the desert appreciating the view and taking photos. We were expecting to spend more time there to enjoy and take photos, but it was what we had.\nJV posing in the Desert Dunes\nsandboarding After we dune bashed to the middle of the dunes, we had an opportunity to do some sandboarding. The hill was not so high but it was enough for me as I had never done it before.\ncamel riding After sandboarding we returned to the road and drove for around 30 minutes to the camp where other activities would be performed and there they had the very expected camel ride.\nWe knew that it was supposed to be a short camel ride, but it was even shorter than we thought. It was less than 2 minutes and we had to argue with them to let each of us ride a different camel as they were pushing us to both be in a camel.\nWe were kind of disappointed with the camel experience as it was a lot shorter and not as expected and for us it was one of the most important.\nJV and May riding camels\nsunset in the desert The sunset photo is on the camp and not in the middle of the dunes. It is still a beautiful sunset but the desert is not that desertic with a lot of dunes. It has some green bushes and small dunes.\nBBQ dinner After all the motion sickness from dune bashing, it took me a while to be willing to eat something. The BBQ dinner was good. They have a buffet style for some dishes and you get some pieces of meat. It is nothing fancy but it is good and what we expected in the middle of the desert.\nperformances While we ate there were 3 performances on the stage. One dance, one fire dance, and a belly dance. We enjoyed them.\nDance performance\nhenna, shisha, etc They also had a free henna painting for women which May did and liked. The details were really good.\nThey also provided shisha for smoking at a place or they brought it to the table for a fee. We just went to the place to taste it and it was ok. We don\u0026rsquo;t smoke so it was just to try it out. We heard good comments about it.\nsellers There are a lot of people trying to sell you stuff at the camp. From photos to \u0026ldquo;gold\u0026rdquo; rings, etc. Be ready to say no a lot.\nguide Not sure if we were unlucky or something, but our guide was not very friendly. He was not rude, but not friendly as well. We would expect to be a place with a lot of tourism and that we paid a considerable amount of money that it would be more friendly and feel that they wanted us there. At some times, it looked like that it was a production line of tourism.\nAlso, he drove very aggressively in the city and in the road, mainly when going back. I am not sure if he was in a hurry or something, but it was very fast and aggressive to the point that it was not comfortable inside.\nsummary What we liked the most was the view in the middle of desert dunes and the quad cycle experience. The camel ride was too short.\nWhat we didn\u0026rsquo;t like was the dune bashing experience (it is horrible) and the guide service which was not friendly but maybe we were just unlucky.\nDespite having some bad moments, we don\u0026rsquo;t regret it as it was the best desert view we could have and we did things that we have never done before, so overall, we would do it again (just not the dune bashing).\nHappy travels.\n","permalink":"https://luizvieira.me/dubai-desert-safari/","summary":"We traveled to Dubai and we took a Desert Safari tour to see the two things that we wanted the most: Camel ride and desert view. But, is it worth it?","title":"Dubai Desert Safari: Is it worth it?"},{"content":" I first heard of the book The Good Enough Job on some podcasts (see Other resources at the end) and decided to add it to my reading list. I have been working for the last few years on being less workaholic and doing more things for fun and the book seemed to be the right fit for me.\nThe message from the book The Good Enough Job is good (perhaps it is a confirmation bias due to my life moment) but the book could be better. It has too many personal stories and it seems that sometimes the stories don’t even illustrate the point desired by the author.\nFor sure the problem is me, but I was expecting a bit more based on studies than stories and also I found that it could be shorter, like half shorter as it has too many stories.\nLet’s see a bit more about the book The Good Enough Job: Reclaiming Life from Work\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from The Good Enough Job Book The Good Enough Job\nDespite my high expectations that were not fulfilled, the book has some good learnings and I will share the 5 most important learnings from the book.\ncareer is a relatively new concept It is hard to imagine a different world than we live in and due to that, we sometimes think that things were always the way they are now, but that is for most things not true. Career is one of the things. We can think that people always had careers in their “jobs” but according to the book, “two hundred years ago, almost no one had a career—at least not in the way we currently conceive of careers as stories of progress and change.”\ndon\u0026rsquo;t be defined ONLY by what you produce This is one of my biggest points to work on (and it is probably yours as well). We as a society (at least in the ones that I lived) usually define or value people by what they do and what they produce. I don’t see a big problem in taking that view as it is the way we have a functional and growing economy, but I think the problem is when we are defined ONLY by what we produce. We should be able to be defined also as things that we do only for fun with no meaningful or useful outcome.\nplay for playing sake Similar to “rest for the sake of rest” from the book Four Thousand Weeks, the idea here is to have hobbies or activities that you don’t have an output or a goal, besides the goal to enjoy the process itself. We have hobbies (like this blog) we have some kind of outcome (posts) so it turns out to be work as the author mentions “[\u0026hellip;] striving for a goal still imposes a frame of improvement, which implies work in a fundamental sense.”\nSo we should play more, as in the book “Play is a natural antidote to workism. It indexes not on utility, but on curiosity and wonder. It cares not about \u0026ldquo;better,\u0026rdquo; but only about our present experience.“\nperks are a kind of trap As I work in tech I have close contact with the famous perks of tech companies. Actually, my company has very few perks compared to Google and other big tech, but we still have snacks, free lunches on Tuesdays, and free drinks on Thursdays.\nAnd who does not love some perks?! (I can say that I don’t when trying to lose some weight, I have to fight my willpower, which is not so good for food).\nBut companies don’t give things for free because they are nice, they do because most of the time, the return on the investments is worth it. And they do that because you tend to stay more in the office and also to tie your social life with coworkers. One study cited in the book found that “While there, she found that two organizational \u0026ldquo;perks\u0026rdquo; – dinner and a free ride home – were central to the long hours synonymous with banking culture. If workers stayed at the office until seven p.m., they could order dinner on the company dime.”\nyou are not the work you do Kind of related to the other topics above is the idea that you are not the work you do, we have to detach our sense of self-worth from the work we do. As the book states, “A good enough job is a job that allows you to be the person you want to be.”\nHere it is also useful to have other identities, not only a professional one. You have other identities, like father (or mother), husband (or wife), hiker, musician, curious person, etc.\nFavorite quotes These are my 5 favorite quotes from the book.\n”Of course, we do all manner of things. But in the United States, how we make money is shorthand for who we are. Our livelihoods have become our lives.” ”The answer, in short, is that the expectation that work will always be fulfilling can lead to suffering” ”But none of us is just one thing. We are workers, but we are also siblings and citizens, hobbyists and neighbors. In this way, identities are like plants: they take time and attention to grow. Unless we make a conscious effort to water them, they can easily wither.” ”I worshipped work, and as a result, settling for anything less than a job that was absolutely perfect felt like a failure. It was only by removing work from its pedestal that I was able to see my work as part, but not all, of who I was” ”If workism is the religion, dream jobs are the deities.” Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nTen Percent Happier with Dan Harris podcast episode The Myth of the Dream Job | Simone Stolzoff Afford Anything podcast episode The Importance of Having a Life Outside of Work, with Simone Stolzoff These are my learnings from the book The Good Enough Job: Reclaiming Life from Work written by Simone Stolzoff. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-the-good-enough-job/","summary":"These are my learnings from the book The Good Enough Job: Reclaiming Life from Work","title":"Learnings from the book The Good Enough Job"},{"content":" Designing Data-Intensive Applications is one of the best (if not the best) software engineering books that I have read. It explains very well the many characteristics and challenges that we can face in distributed systems.\nThis book covers a wide range of topics, from databases to messaging systems, transactions, and even clock skew. It\u0026rsquo;s definitely worth a second read, and I\u0026rsquo;ve been recommending it to all my coworkers.\nThis post of Learning is from a technical book, so it may be a bit different than the other posts of the collection Learnings from books, as when I read technical books I focus more on the parts that I looking to learn and for my current situation.\nLearnings from the book Designing Data-Intensive Applications Book Designing Data-Intensive Applications\nAs I said above, it is a very complete book, it is something that everyone who works with microservices or any distributed system has to read.\nThe book has a lot of learnings, but to not be too long a post, I will share my 5 most important learnings from the book.\ntime is also relative in systems I knew that I could not trust 100% in the times between machines because we could have differences but one thing that didn\u0026rsquo;t cross my mind is that in the same machine we could have clock skews. In other words, in the same machine, if asked for the time, it can be a lot more or even travel back in time.\nBasically, we have two types of clocks, time-of-day clocks and monotonic clocks.\nA time-of-day clock does what you intuitively expect of a clock: it returns the current date and time according to some calendar (also known as wall-clock time). A good example is the Java System.currentTimeMillis() which returns the number of seconds (or milliseconds) since the epoch: midnight UTC on January 1, 1970, according to the Gregorian calendar, not counting leap seconds.\nThe time-of-day clocks are usually synchronized with NTP which means that if the local clock is too far ahead of the NTP server, it may be forcibly reset and appear to jump back to a previous point in time\nA better time, from a single-machine perspective, is monotonic clocks. They are guaranteed to always move forward (whereas a time-of-day clock may jump back in time) and they are great for checking the time elapsed between two operations as they don\u0026rsquo;t go back in time nor jump into the future. In Java, you can get the monotonic clock value by calling System.nanoTime()\nconcurrency is not only things that happen at the same time Usually, when dealing with software development I thought about concurrent operations as being the things that happen \u0026ldquo;at the same time\u0026rdquo; by having an overlap in time. While that is true, the other important concept is operations that are unaware of each other. So if they don\u0026rsquo;t know about each other and they handle the same object, they can be considered concurrent.\nAs it is in the book, \u0026ldquo;For defining concurrency, exact time doesn’t matter: we simply call two operations concurrent if they are both unaware of each other, regardless of the physical time at which they occurred.\u0026rdquo;\nnot all ACIDs are the same The ACID acronym which refers to the set of 4 key properties that define a transaction: Atomicity, Consistency, Isolation, and Durability seems to be a very popular subject for interviews and it is good in general to know the concept and good to keep in mind when developing software.\nBut one thing that is important is that not all databases implement these properties the same way, as the book explains, \u0026ldquo;there is a lot of ambiguity around the meaning of isolation. The high-level idea is sound, but the devil is in the details. Today, when a system claims to be “ACID compliant,” it’s unclear what guarantees you can actually expect. ACID has unfortunately become mostly a marketing term.\u0026rdquo;\nadvantages of log-based message broker I have been using RabbitMQ as a message broker for a few years now and haven\u0026rsquo;t actually used others like Kafka. In RabbitMQ, when we consume a message from the queue and acknowledge it, it is removed from the queue and deleted. But in log-based message brokers (like Kafka) reading a message does not delete it from the log so we can replay messages if we want. I found that a really good feature as we can sometimes \u0026ldquo;lose\u0026rdquo; messages and as they were not persisted (unless the application does it) it is really hard to replay it.\na correct algorithm does not guarantee correct behavior in distributed systems When we design software, we try to make sure that our code is working correctly and the logic has no bugs. But even if you have a perfect running code it does not mean it will always behave correctly. One of the many reasons that can cause the behavior to not be correct is that a \u0026ldquo;process may pause for a substantial amount of time at any point in its execution (perhaps due to a stop-the-world garbage collector), be declared dead by other nodes, and then come back to life again without realizing that it was paused.\u0026rdquo;\nThese are my 5 most important learnings from the book Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems written by Martin Kleppmann.\nHappy coding!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-designing-data-intensive-applications/","summary":"These are my learnings from the book Designing Data-Intensive Applications","title":"Learnings from Designing Data-Intensive Applications"},{"content":"Spring Boot 3 was released at the end of 2022 but some projects are still using Spring Boot 2.7. I\u0026rsquo;ve recently migrated several projects and libraries from Spring Boot 2.7.15 to Spring Boot 3.2.4 and I\u0026rsquo;d like to share some insights into the changes I had to make to ensure everything functioned smoothly.\nJust a heads up, the update required quite a bit of file changes. The majority is due to the transition from Java EE to Jakarta EE, resulting in many javax. imports being replaced with jakarta. imports.\nWhile I aimed to provide as thorough an overview as possible, it\u0026rsquo;s important to note that your service might encounter specific situations not addressed here. This is because the implementation discussed pertains to a specific approach utilized by the projects that I have worked with.\nDependency changes The first thing is to change the dependencies. Let\u0026rsquo;s start with the spring dependencies. The examples will be shown using Gradle Groovy configuration.\nUpgrading Spring Look for the usage of the plugin id org.springframework.boot and set the version as 3.2.4.\nthis\nplugins { id \u0026#39;org.springframework.boot\u0026#39; version \u0026#39;2.7.11\u0026#39; becomes\nplugins { id \u0026#39;org.springframework.boot\u0026#39; version \u0026#39;3.2.5\u0026#39; We also need to update the Spring Cloud org.springframework.cloud:spring-cloud-dependencies from version 2021.x.x to 2023.0.1\nBefore we had something like this:\nimplementation platform(\u0026#34;org.springframework.cloud:spring-cloud-dependencies:2021.0.9\u0026#34;) and now we have something like this:\nimplementation platform(\u0026#34;org.springframework.cloud:spring-cloud-dependencies:2023.0.1\u0026#34;) Make sure to replace it in all subprojects and all places you use it.\nReplace Sleuth with Micrometer Spring Sleuth was replaced with Micrometer, so we have to remove the old Spring Sleuth starter, if your project has the following dependencies, please remove them.\nI have created a more detailed post about Migrating Spring Sleuth to Micrometer Observability in Spring Boot 3\nReplace hibernate-types We use PostgreSQL and a library for custom types com.vladmihalcea:hibernate-types-5. But this library was moved to another package, so we have to replace the following\nimplementation(\u0026#34;com.vladmihalcea:hibernate-types-5:2.3.5\u0026#34;) with the following\nimplementation \u0026#39;io.hypersistence:hypersistence-utils-hibernate-63:3.7.3\u0026#39; They are the same in a way, just the package changed. Due to this, all imports starting with\ncom.vladmihalcea.hibernate became io.hypersistence.utils.hibernate com.vladmihalcea.spring became io.hypersistence.utils.spring You can learn more here\nWiremock replacement old package In our case, some libraries had an old version of Wiremock. The library was migrated to another group and module, so the old one was.\ntestImplementation \u0026#34;com.github.tomakehurst:wiremock-jre8:2.35.0\u0026#34; replace it with the new one\ntestImplementation \u0026#39;org.wiremock:wiremock-standalone:3.5.2\u0026#39; Java EE to Jakarta EE dependencies With the change of the Java EE to Jakarta EE, a few libraries changed.\n\u0026lsquo;javax.xml.bind:jaxb-api:2.3.1\u0026rsquo; became \u0026lsquo;jakarta.xml.bind:jakarta.xml.bind-api:4.0.2\u0026rsquo; \u0026lsquo;javax.persistence:javax.persistence-api:2.2\u0026rsquo; becomes jakarta.persistence:jakarta.persistence-api:3.1.0 Other library updates that you may need to update These are other libraries that changed and your project may or may not have them, we recommend checking your project for each of them and updating accordingly. Some of them are:\nTomcat 10 (org.apache.tomcat.embed from 9.0.78 to 10.1.13 Hibernate 6 ( org.hibernate:hibernate-core from 5.6.15.Final to 6.2.9.Final) Flyway 9 (org.flywaydb:flyway-core from 8.5.13 to 9.16.3) Hazelcast 5 (com.hazelcast:hazelcast from 4.2.6 to 5.2.4) sl4j 2 (org.slf4j:slf4j-api and org.slf4j:slf4j-simple from 1.7.36 to 2.0.12) Javers (org.javers:javers-spring from 6.x.x to 7.4.2 Shedlock (net.javacrumbs.shedlock:shedlock-spring from 4.44.0 to 5.11.0 JAXB runtime (org.glassfish.jaxb:jaxb-runtime) from 2.3.1 to 4.0.3 Compile Changes Java EE to Jakarta EE Most of the packages from Java EE (javax.*) became Jakarta EE (jakarta.*). Due to that, we need to upgrade a lot of other libraries to match this and avoid ClassNotFoundException.\nYou can use IntelliJ to do most of the work for you (though it may miss some stuff). Navigate to Refactor → Migrate Packages and Classes → Java EE to Jakarta EE.\nSelect the whole project and Run.\nOn the window that opens, select Do Refactor\nTracing Import As we removed the Spring Sleuth dependency above and added Micrometer, all the imports that used Sleuth will break. You can do a simple find and replace and it will help you fix almost everything.\nYou can find the code\nimport org.springframework.cloud.sleuth. And replace it with\nimport io.micrometer.tracing. These should be enough to replace almost everything.\n@Type and @TypeDefs Mapping @TypeDefs and @TypeDef have been removed and @Type annotation changed, so we cannot specify a string anymore.\nWe remove all the @TypeDef and @TypeDefs as you don’t need them anymore.\nAs for the @Type, we remove them to replace it with the class directly.\n@TypeDefs({@TypeDef(name = \u0026#34;jsonb\u0026#34;, typeClass = JsonBinaryType.class)}) public class Company { @Type(type = \u0026#34;jsonb\u0026#34;) Map\u0026lt;String, String\u0026gt; inviters; } with @Type\npublic class Company { @Column(columnDefinition = \u0026#34;jsonb\u0026#34;) @Type(JsonBinaryType.class) Map\u0026lt;String, String\u0026gt; inviters; Repository In case you have repositories that extend PagingAndSortingRepository you need to replace it with ListCrudRepository or ListPagingAndSortingRepository. PagingAndSortingRepository still exists, but it does not have some basic stuff like count, save, etc.\nController Parameters Starting in Spring 6 (Spring Boot 3) Spring no longer attempts to deduce parameter names by parsing bytecode which means that if you have something like this\npublic void patchAccounts(@PathVariable String id, ...)\nit will break as it expects a name, like this one\npublic void patchAccounts(@PathVariable(\u0026quot;id\u0026quot;) id, ...)\nThis is also true for @RequestParam where you have to specify the name now.\nThe best way is to fix everything in the code, but if you think that is too much, you can use an arg in the Java compiler and add the following configuration to your build.gradle\ntasks.withType(JavaCompile).configureEach { options.compilerArgs.add(\u0026#34;-parameters\u0026#34;) } Feign decode404 Feign clients decode404 was removed in favor of dismiss404. You can just find and replace it in the project. According to the documentation, the behavior is the same, just a name change.\nFlyway ignores missing migration In version 8 of Flyway, the property spring.flyway.ignore-missing-migrations was deprecated and it was removed in version 9.\nTo have the same effect, you can have\nspring.flyway.ignore-migration-patterns=*:missing Check for migrated and broken properties Spring has a special dependency that you can use to detect properties that changed during the migration. Basically, you add the dependency, fix the things, and remove it.\nAdd the following dependency:\nruntimeOnly(\u0026#34;org.springframework.boot:spring-boot-properties-migrator\u0026#34;) Now you try to compile and it is gonna complain about the properties. Fix them and remove the dependency.\nUnable to resolve LocalServerPort If your plugin breaks because it cannot find the import\nimport org.springframework.boot.web.server.LocalServerPort change the import to\nimport org.springframework.boot.test.web.server.LocalServerPort Possible problems when running Flyway migration stuck when it contains CONCURRENTLY If you have a migration that contains CONCURRENTLY and is running indefinitely, you have to add the following configuration to your Flyway:\nFlyway flyway = Flyway.configure() // other previous configurations .configuration(Map.of(\u0026#34;flyway.postgresql.transactional.lock\u0026#34;, \u0026#34;false\u0026#34;)) .load(); You can see the discussion [here](https://github.com/spring-projects/spring-boot/issues/32629#issuecomment-2043481055\n@ExceptionHandler is returning XML instead of JSON If your exception is returning XML instead of JSON, it means that you didn’t specify a header with content type and you probably have Jackson XML in the classpath, so you have the return of something like this.\nreturn ResponseEntity.status(BAD_REQUEST).body(error); Just add .contentType(MediaType.APPLICATION_JSON) to the builder and it should work ok\nreturn ResponseEntity.status(BAD_REQUEST) .contentType(MediaType.APPLICATION_JSON) .body(error); HTTP Endpoints defaulting to XML By default, we were not setting JSON as the HTTP response type, but after the upgrade it stopped doing that and started returning XML (probably because we also had a Jackson XML library in the classpath).\nTo set the default content type, we changed our WebMvcConfigurer to set JSON as the default.\npublic class WebMvcConfiguration implements WebMvcConfigurer { @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { configurer.defaultContentType(MediaType.APPLICATION_JSON); } } These were the primary adjustments we needed to implement to ensure that the applications functioned smoothly on Spring Boot 3.2, similar to how they operated on Spring Boot 2.7. While I\u0026rsquo;ve aimed to provide detailed descriptions, it\u0026rsquo;s worth noting that each project may have unique configurations, and certain issues may arise that aren\u0026rsquo;t covered here. Nonetheless, I hope this information proves helpful in navigating potential challenges and finding suitable solutions.\nIf you are already past this one and looking at the next major version, I wrote the same kind of guide for it in Upgrading to Spring Boot 4: Lessons From an AI-First Migration, including the hypersistence-utils line you set up here moving from hibernate-63 to hibernate-73.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-3-migration/","summary":"I have recently migrated several projects and libraries from Spring Boot 2.7.15 to Spring Boot 3.2.4 and I would like to share some insights into the changes","title":"Spring Boot 2.7 to 3.2 Migration: A Detailed Guide"},{"content":"Spring Sleuth was removed in Spring Boot version 3 in favor of Micrometer and I recently migrated many services and want to share a bit of the learning and things that we need to change to make everything work with Micrometer as they were working before.\nWe were using mostly automatic instrumentation and in some places, we were using @NewSpan or even injecting the Tracer and starting a scoped span to track some specific operations. We had distributed tracing in HTTP requests, RabbitMQ messages, Scheduled Jobs, and Async executions.\nUnder the hood, our Spring Sleuth was using Brave as the implementation and we were exporting the context in the Zipkin B3 format with the multiple headers options (X-B3-TraceId, X-B3-ParentSpanId, and X-B3-SpanId).\nI am not going to go over all the things that require Micrometer work from scratch, as there are already very good guides on how to do it, I will mostly focus on what we need to change from Sleuth to Micrometer.\nLet\u0026rsquo;s start with the dependencies.\nDependencies After upgrading the Spring Boot version to something like 3.2.4 (the latest when this article was written), we have to remove the Sleuth dependencies, in our case we had two:\nimplementation \u0026#34;org.springframework.cloud:spring-cloud-sleuth-zipkin\u0026#34; implementation \u0026#34;org.springframework.cloud:spring-cloud-starter-sleuth\u0026#34; And we need to add the new ones.\nimplementation \u0026#39;io.micrometer:micrometer-tracing-bridge-brave\u0026#39; implementation \u0026#39;io.zipkin.reporter2:zipkin-reporter-brave\u0026#39; These are the basic ones, which should allow you to trace and export to Zipkin.\nHTTP request By default, Micrometer uses W3C propagation type. In the Migration Page they recommend setting Sleuth \u0026amp; Boot 2.x application\nspring.sleuth.propagation.type=w3c,b3 so it exports both and you can use the default in the newly migrated application. But we cannot do this as we don\u0026rsquo;t only have Spring Services, we also have Node.JS which expects the B3 format for now.\nTo continue being compatible with the whole system, we just changed the default propagation type in Micrometer to b3_multi by adding the following property.\nmanagement.tracing.propagation.type=b3_multi Sampling Learned this the really hard way (by having it in production for a few days) but by default, (not sure why they thought that it was a good idea), but it only exports 10% of the traces (source) and you have to change a property to send all.\nmanagement.tracing.sampling.probability=1 I was really pissed about this, it should always export everything and IF YOU WANT to change, you can, but not the other way around. Also, the naming is very confusing as setting it to 100% probability of sampling, means that it sends all and not discard all.\n@NewSpan To enable support for the \u0026ldquo;old\u0026rdquo; annotations like @NewSpan, we needed to add the following property (source)\nmanagement.observations.annotations.enabled=true You also have to make sure that you have Spring AOP in the classpath, as it is required by what I understood of the documentation.\nimplementation \u0026#34;org.springframework.boot:spring-boot-starter-aop\u0026#34; RabbitMQ For RabbitMQ, we were injecting\nprivate final SpringRabbitTracing springRabbitTracing; and setting the decorateSimpleRabbitListenerContainerFactory\nSimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory(); springRabbitTracing.decorateSimpleRabbitListenerContainerFactory(factory); With our container factory which was used to create our consumer factory.\nAs we don\u0026rsquo;t have the SpringRabbitTracing anymore in Micrometer, what we did was to remove these lines and simply enable tracing in the RabbitTemplate.\nrabbitTemplate.setObservationEnabled(true); We also have to set the enabled in the ConnectionFactory based on this to enable the tracing for the consumers\nfactory.setObservationEnabled(true); Database For databases, we had P6Spy via\nimplementation \u0026#34;com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.8.1\u0026#34; but we were not really using all the functionalities of P6Spy and only the JDBC tracing so we changed the library to use the\nimplementation \u0026#39;net.ttddyy.observation:datasource-micrometer-spring-boot:1.0.3\u0026#39;` which instruments the Database with Micrometer. Maybe com.github.gavlyukovskiy still works, I haven\u0026rsquo;t fully checked that as I wanted to get rid of P6Spy logging as we use the span duration to detect slow queries now.\nOne adjustment I had to make was to rename the service name in the spans for the Database spans. Without doing anything, it was using the Hikari Pool name (as our pool didn\u0026rsquo;t start with HikariPool-) but otherwise, it would use the schema name (as resolved by DefaultDataSourceNameResolver. I wanted to change it to the service name, so I created a custom DataSourceNameResolver that returned the service name from the application properties.\n@Configuration public class ObservabilityConfig { @Value(\u0026#34;${spring.application.name}\u0026#34;) private String serviceName; @Bean public DataSourceNameResolver dataSourceNameResolver() { return (beanName, dataSource) -\u0026gt; serviceName; } } Async For our async configuration, we were using LazyTraceExecutor in something like this\n@EnableAsync @Configuration public class AsyncConfiguration implements AsyncConfigurer { @Inject private BeanFactory beanFactory; @Override public Executor getAsyncExecutor() { return new LazyTraceExecutor(beanFactory, new OurCusomThreadPool(\u0026#34;async-task-\u0026#34;)); } } And we changed it to the code below based on this StackOverflow answer\n@EnableAsync @Configuration public class AsyncConfiguration implements AsyncConfigurer { @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); threadPoolTaskExecutor.setCorePoolSize(5); threadPoolTaskExecutor.setMaxPoolSize(5); threadPoolTaskExecutor.setThreadNamePrefix(\u0026#34;async-task-\u0026#34;); threadPoolTaskExecutor.initialize(); return ContextExecutorService.wrap(Executors.newCachedThreadPool(threadPoolTaskExecutor), ContextSnapshot::captureAll); } } Scheduled For the scheduled tasks, we did something a bit different, in the configuration that implemented SchedulingConfigurer, we injected the ObservationRegistry and set it in the ScheduledTaskRegistrar based on the docs\n@EnableScheduling @EnableSchedulerLock(defaultLockAtMostFor = \u0026#34;PT05M\u0026#34;) @RequiredArgsConstructor @Configuration public class SchedulingConfiguration implements SchedulingConfigurer { private final ObservationRegistry observationRegistry; @Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { taskRegistrar.setTaskScheduler(new OurTaskScheduler(\u0026#34;scheduled-task-\u0026#34;)); taskRegistrar.setObservationRegistry(observationRegistry); } } Differences I noticed some differences in the tracing and tags. These are not all the changes, but just the ones that I have noticed.\nHTTP spans In Sleuth, we have the following tags http.method, http.path, http.status_code, mvc.controller.class, mvc.controller.method and Client Address.\nIn Micrometer, http.method became method, http.path became http.url and http.status_code became status and we have a new uri which shows the URL without interpolation (a nice add).\nAlso, a good improvement is that database spans (select, insert, result-set) are not duplicated anymore. In Sleuth, it generated two for each operation, one for the server and one client, with the same data. In my opinion that was not necessary and only polluted (making us have to add sampling). Now we have only one span.\nThese were some of the changes that we made. I hope this helps you in some way.\nCheers.\n","permalink":"https://luizvieira.me/spring-boot-3-spring-sleuth-micrometer-migration/","summary":"Spring Sleuth was removed in Spring Boot version 3 in favor of Micrometer and I recently migrated many services and want to share the learnings with you.","title":"Spring Sleuth to Micrometer Migration in Spring Boot 3"},{"content":"The @EnableResourceServer and the library it comes from org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure were deprecated a while ago but some projects still use it. I spent a bit of time replacing this library in our current system and want to share a little bit of what we did to replace and that may help you when replacing yours as well.\nIn OAuth2 terms a resource server is your api service that handles a specific request after it has been authenticated. It uses the access token sent in the request to check if that specific client has access to the service\u0026rsquo;s resources.\nIn this post we are talking only about the resource server, so we are considering that your authorization server already generated the token and the client is using that token to issue a request.\nIn our case, we were using a JWT token. Our API proxy receives a request with an opaque token and generates an internal JWT which contains the information of the principal and authorities so the service can decode that JWT, check its signature, and extract the information to check if the request in question is authorized.\nOld code This is what we had before\nin our build.gradle\nimplementation \u0026#34;org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.6.8\u0026#34; and our resource server Spring configuration\npublic class ResourceOAuthConfiguration implements ResourceServerConfigurer { @Value(\u0026#34;${security.whitelisted_urls:#{null}}\u0026#34;) private String[] whitelistedUrls; @Inject private AuthProperties authProperties; @Bean public ResourceServerTokenServices remoteTokenServices() { return new CustomUserInfoTokenServices(authProperties.getClientId(), authProperties.getJwtPassword()); } @Bean public SecurityEvaluationContextExtension securityEvaluationContextExtension() { return new DefaultSecurityEvaluationContextExtension(); } @Override public void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers(whitelistedUrls) .permitAll() .and() .authorizeRequests() .anyRequest() .authenticated(); } } the ResourceServerTokenServices was also deprecated, and it was the thing that was really doing the job of receiving the JWT token and setting the Security Context.\npublic class CustomUserInfoTokenServices implements ResourceServerTokenServices { private final String clientId; private final String jwtPassword; @Autowired(required = false) private HttpServletRequest request; public CustomUserInfoTokenServices(String clientId, String jwtPassword) { this.clientId = clientId; this.jwtPassword = jwtPassword; } @Override public OAuth2Authentication loadAuthentication(String accessToken) { return extractAuthentication(); } private OAuth2Authentication extractAuthentication() { MyPrincipal myPrincipal = of(request.getHeader(\u0026#34;Authorization\u0026#34;).split(\u0026#34; \u0026#34;)) .skip(1) .findFirst() .map(this::userInfo) .orElseThrow(() -\u0026gt; new IllegalStateException(\u0026#34;Failed to read Bearer token\u0026#34;)); List\u0026lt;GrantedAuthority\u0026gt; authorities = myPrincipal.getRoles().stream() .map(SimpleGrantedAuthority::new) .collect(toList()); OAuth2Request request = new OAuth2Request(null, this.clientId, null, true, new HashSet\u0026lt;\u0026gt;(myPrincipal.getScopes()), null, null, null, null); UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(myPrincipal, \u0026#34;N/A\u0026#34;, authorities); return new OAuth2Authentication(request, token); } private MyPrincipal userInfo(String jwt) { Claims body = parseJwt(jwt); return MyPrincipal.builder() .authType(body.get(\u0026#34;authType\u0026#34;, String.class)) .userId(body.get(\u0026#34;userId\u0026#34;, String.class)) .externalToken(body.get(\u0026#34;externalToken\u0026#34;, String.class)) .externalId(body.get(\u0026#34;externalId\u0026#34;, String.class)) .build(); } private Claims parseJwt(String jwt) { return Jwts.parser() .setSigningKey(jwtPassword) .parseClaimsJws(jwt) .getBody(); } } Basically, we were using the loadAuthentication to extract the Authorization header to get the bearer token.\nThis JWT was then converted to MyPrincipal object which was being used in the return new OAuth2Authentication() so it could set the security context of the application.\nAnd this way, the application was authorized.\nReplacing with Spring Security Now, to replace this code with the Spring Security functionalities, we removed the\nimplementation \u0026#34;org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.6.8\u0026#34; and added\nimplementation \u0026#39;org.springframework.boot:spring-boot-starter-oauth2-resource-server\u0026#39; to our build.gradle\nthe logic of converting the JWT token string was moved to a new Converter, which received a string and returned a MyAuthenticationToken which has a simple logic\npublic class MyPrincipalJwtConverter implements Converter\u0026lt;Jwt, MyAuthenticationToken\u0026gt; { @Override public MyAuthenticationToken convert(Jwt jwt) { var principal = userInfo(jwt); return new MyAuthenticationToken(principal); } private MyPrincipal userInfo(Jwt jwt) { return MyPrincipal.builder() .authType(jwt.getClaim(\u0026#34;authType\u0026#34;)) .userId(jwt.getClaim(\u0026#34;userId\u0026#34;)) .roles(parseList(jwt.getClaim(\u0026#34;roles\u0026#34;))) .build(); } private List\u0026lt;String\u0026gt; parseList(Object object) { if (object == null) { return emptyList(); } if (object instanceof List list) { return list; } else if (object instanceof String string) { return singletonList(string); } return emptyList(); } } and then, we changed the configuration to\n@Configuration public class WebSecurityConfig { @Value(\u0026#34;${security.whitelisted_urls:#{null}}\u0026#34;) private String[] whitelistedUrls; @Value(\u0026#34;${security.jwt.password}\u0026#34;) private String jwtPassword; @Bean JwtDecoder jwtDecoder() { byte[] secretKeyBytes = Base64.getDecoder().decode(jwtPassword); SecretKey secretKey = new SecretKeySpec(secretKeyBytes, JwsAlgorithms.HS512); return NimbusJwtDecoder .withSecretKey(secretKey) .macAlgorithm(MacAlgorithm.HS512) .build(); } @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http.authorizeRequests() .requestMatchers(whitelistedUrls) .permitAll() .and() .csrf().ignoringRequestMatchers(whitelistedUrls) .and() .oauth2ResourceServer(oauth2 -\u0026gt; oauth2 .jwt(jwt -\u0026gt; jwt.decoder(jwtDecoder()) .jwtAuthenticationConverter(new MyPrincipalJwtConverter())) ) .authorizeRequests() .anyRequest() .authenticated().and().build(); } } The difference here is the JwtDecoder bean that will be used to decode the token that comes in the authorization header and we add a new converter so it can use the decoded token.\nThis configuration now will set the Security Context of the application so we don\u0026rsquo;t need other external stuff\nTo test it, we wrote some Spring Tests to validate if all the scenarios were working correctly.\n@SpringBootTest(classes = {SecurityApplication.class}) @AutoConfigureMockMvc @Import({DummyController.class}) public class DummyControllerTest { private static final String JWT_TOKEN_VALID = \u0026#34;eyJhbGciOiJIUzUxMiJ9.eyJyb2xlcyI6WyJST0xFX0NMSUVOVCJdLCJhdXRoVHlwZSI6ImFwaSIsImV4cCI6MjcxMTA1MzI3MiwidXNlcklkIjoidXNlcl9pZF8xMjM0NSJ9.By5guJ1PF-BoFR457KW6W5wcp8qclSVdYeXcQDv60L79iCvJs_IHau04XwWJk2hkISC-eXIsZyXOgGcBn2kOhg\u0026#34;; private static final String JWT_TOKEN_EXPIRED = \u0026#34;eyJhbGciOiJIUzUxMiJ9.eyJyb2xlcyI6WyJST0xFX0NMSUVOVCJdLCJhdXRoVHlwZSI6ImFwaSIsImV4cCI6MTcxMTA1MzI3MiwidXNlcklkIjoidXNlcl9pZF8xMjM0NSJ9.EQ82LhBw1hvQ10LajO7Rl3xBfCjKvaUTvVL8SYV1uMTahG08LFU6R1M0sNGdsFveQ0vXBZj9Di9LKCpNL2scjg\u0026#34;; private static final String JWT_TOKEN_INVALID = \u0026#34;eyJhbGciOiJIUzUxMiJ9.eyJyb2xlcyI6WyJST0xFX0NMSUVOVCJdLCJhdXRoVHlwZSI6ImFwaSIsImV4cCI6MTcxMTA1MzI3MiwidXNlcklkIjoidXNlcl9pZF8xMjM0NSJ9.y2A9fAI7wUIxN4VpeVQet-OyVwlqA6gvQ9o7NNy67-QSEEzjM8TnDCLUDjK8hDWXQx-QqN3mGlG8jovCbu1Pk3\u0026#34;; @Autowired private MockMvc mockMvc; @Test void shouldTestWithoutAuthentication() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get(\u0026#34;/api/secure\u0026#34;)) .andExpect(MockMvcResultMatchers.status().isUnauthorized()); } @Test @WithAnonymousUser void shouldTestWithAnonymousUser() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get(\u0026#34;/api/secure\u0026#34;)) .andExpect(MockMvcResultMatchers.status().isUnauthorized()); } @Test void shouldTestSecuredEndpointWithTokenExpired() throws Exception { MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(\u0026#34;/api/secure\u0026#34;) .header(HttpHeaders.AUTHORIZATION, \u0026#34;Bearer \u0026#34; + JWT_TOKEN_EXPIRED); mockMvc.perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isUnauthorized()); } @Test void shouldTestSecuredEndpointWithTokenInvalidSignature() throws Exception { MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(\u0026#34;/api/secure\u0026#34;) .header(HttpHeaders.AUTHORIZATION, \u0026#34;Bearer \u0026#34; + JWT_TOKEN_INVALID); mockMvc.perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isUnauthorized()); } @Test void shouldTestSecuredEndpointWorkingToken() throws Exception { MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(\u0026#34;/api/secure\u0026#34;) .header(HttpHeaders.AUTHORIZATION, \u0026#34;Bearer \u0026#34; + JWT_TOKEN_VALID) .contentType(MediaType.APPLICATION_JSON); mockMvc.perform(requestBuilder) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(result -\u0026gt; { MyPrincipal principal = convertResultInPrincipal(result); assertThat(principal).isNotNull(); assertThat(principal.getAuthType()).isEqualTo(\u0026#34;api\u0026#34;); assertThat(principal.getUserId()).isEqualTo(\u0026#34;user_id_12345\u0026#34;); assertThat(principal.getRoles()).contains(\u0026#34;ROLE_CLIENT\u0026#34;); }); } @Test void testWhitelistedUrlWithAntMatcher() throws Exception { mockMvc.perform(MockMvcRequestBuilders.post(\u0026#34;/api/user/1235/invite\u0026#34;)) .andExpect(MockMvcResultMatchers.status().isOk()); } private static MyPrincipal convertResultInPrincipal(MvcResult result) throws JsonProcessingException, UnsupportedEncodingException { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return objectMapper.readValue(result.getResponse().getContentAsString(), MyPrincipal.class); } } One thing that we needed to add that was not in the previous configuration was the disabling of CSRF protection for whitelisted URLs. In some cases, where we had public URLs which received a token, it was blocking so adding\n.csrf().ignoringRequestMatchers(whitelistedUrls)\nto the WebConfig was enough to fix it.\nSummary I hope this helps you a little bit in the migration and in the improvement of your code. The code for the examples is available in this GitHub repository\nCheers\n","permalink":"https://luizvieira.me/spring-security-resource-server-jwt/","summary":"We recently replaced the deprecated @EnableResourceServer with Spring Security and in this post I will share what we did and the new code.","title":"Replace Deprecated @EnableResourceServer in Spring Security"},{"content":"I just came back from the Tunnel Bluffs from Lions Bay hike (AllTrails link) and the view at the end is amazing.\nI decided to go on this hike on a Thursday because I was off work and I wanted a hike with a view that was accessible by public transportation. This hike is around an hour and a half by bus from downtown Vancouver.\nThe Trail From the bus stop to the official start of the hike is 30 minutes (1.5km) and it already starts with elevation.\nThe first 4km is where you get 600 meters of elevation gain which is almost all the elevation gain of this hike (as it is an out and back, you will have to go down) and the rest is very flat almost all the way to the end. Just in the last meters, you go up again to reach the viewpoint.\nKM 2 of the hike on the way up\nI went in the middle of March so after around 3 km it started to have snow on the floor. Crampons are really recommended (the way down is the most dangerous part).\nAs I went during the week, it was really quiet. I saw less than 20 people in total and I was by myself almost all the time. It was really calming and enjoyable.\nI decided not to use headphones or anything and just stay with nature and with my thoughts. It is a really recharging experience.\nThe View The view at the end is amazing. Really amazing. It is one of the most beautiful views from a hike that I have been to. Also, the day was really good when I went.\nView from Tunnel Bluffs\nThe total length for me was 15.8km with an elevation gain of 732 meters and a moving time of 3 hours and 44 minutes.\nAllTrails map of my Tunnel Bluffs hike\nI will for sure be back on this hike and bring my wife together so we can appreciate the view and the hike together.\nFor a winter option closer to the city, see Hiking BCMC Trail in Winter.\nCheers.\n","permalink":"https://luizvieira.me/tunnel-bluffs-hike/","summary":"Tunnel Bluffs from Lions Bay is a really nice moderate hike with an amazing view at the end","title":"Hiking the Tunnel Bluffs from Lions Bay trail"},{"content":"Grouse Mountain is one of the most accessible mountains in Vancouver and it is home to two very popular trails: Grouse Grind and BCMC Trail. Both the BCMC trail and the Grouse Grind trail are challenging hikes not because of the distance but because of the elevation gain. Of the two I think BCMC trail is the easier one.\nGrouse Mountain is very accessible because you can reach it by public transportation (buses), or go by Evo car sharing as you can park your Evo there (it is considered a “home zone”).\nWe wanted to have contact with nature and the Grouse Hikes are very good for it. We decided to use the BCMC trail to hike up the Grouse mountain as Grouse Grind was closed.\nThe BCMC Trail According to the AllTrails App, the BCMC Trail is around 2.4 km with an elevation gain of 791 meters.\nBCMC Trail in the AllTrails App\nWe went at a very slow and enjoyable pace as we wanted to appreciate the beautiful nature while doing outdoor exercises.\nMiddle of BCMC Trail\nThe winter in Vancouver is very cloudy and somewhat depressing and outdoor activities are a good way to move the body and also renew the energy. We usually don’t have snow in the city and the mountains are a good opportunity to really experience the winter with snow and everything.\nHiking in the Snow We could see snow from the beginning of the mountain, and we needed to put on the spikes after 20 minutes of going up the mountain. Spikes in this case were really recommended because otherwise, it was very slippery.\nAs we went slower it took us around two hours to get to the top of the mountain but we stopped and enjoyed a lot the view and the snow.\nAlmost at the top of BCMC Trail\nI was amazed by the trees covered in snow, and the floor full of snow. It is a really nice and calming view. My wife mentioned that it looked like we were in Narnia.\nIt was a really good way to do some exercise and also enjoy the outdoors in a very cold and cloudy winter even in Vancouver. Also, a good way to burn some calories. My Fitbit said I burned 772 calories.\nIf you are bored at home and want to enjoy nature and do some exercise, consider the BCMC Trail.\nAnother local hike I wrote about is Tunnel Bluffs from Lions Bay.\nCheers.\n","permalink":"https://luizvieira.me/grouse-bcmc-winter/","summary":"BCMC is one of the most popular hikes in Grouse Mountain and the view in winter is amazing","title":"Hiking BCMC Trail in Winter"},{"content":" Outlive: The Science \u0026amp; Art of Longevity is a great book and has prompted me to make significant changes in my life. My wife even says that it is a miraculous book to have made me act regarding my health.\nTo be more precise, I am (as the author’s wife said about him) Not-Thin. I have had a “goal” (for more than 3 years) to reach 75 kg but I never really followed it. After starting reading the book I created a strict plan and I have been following it for almost two months to reach my goal (for reference, I started with 86 kg). More than weight, I want to reduce my visceral fat.\nI am still working on my other pillars of health, but this book is a huge contributor and has given me the slap in the face that I needed in order to act on my health.\nLet’s see a bit more about the book Outlive: The Science \u0026amp; Art of Longevity.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Outlive Book Outlive\nThe book is very complete and talks about many aspects of longevity from the main diseases that decrease the healthspan and lifespan and also exercise, nutrition, sleep, and emotional health. It is a lengthy book but is worth the read.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\n(bad) health compounds I have been investing for a while now and I am very familiar with the compound phenomenon in investing where your money grows exponentially with time. But what I never thought about is that health works in the same way. Or more precisely, bad health.\nIt takes years for diseases (like atherosclerosis) to appear, and they are the accumulation of years of bad health. In the atherosclerosis case, calcification of the coronary arteries happens slowly and you only see it when it is in a very dangerous state.\nAs these kinds of diseases go undetected for many years, the best approach is to try to be as metabolically healthy as possible now to prevent the accumulation that causes the diseases.\nexercise is the key Exercise is the most important thing that you can do to improve your health. The author even put exercise as more important than nutrition.\nIf you don’t do anything now, just start. Even a small amount of daily activity is significantly better than none at all. According to the author, “Going from zero weekly exercise to just ninety minutes per week can reduce your risk of dying from all causes by 14 percent. It\u0026rsquo;s very hard to find a drug that can do that.”\nThe book describes the importance of exercises that raise your VO2 MAX, strength exercises, and stability exercises.\nI currently do more cardio (run) and agility (yoga) but have to work more on strength as it is a very important component of the healthspan.\nno such thing as too much protein Protein is essential for building and maintaining muscles and a very new piece of information for me is that we don’t store protein in the form of fat, as we do with carbs and fat. As the book says, “If you consume more protein than you can synthesize into lean mass, you will simply excrete the excess in your urine as urea.”\nProtein is essential as we age and start losing lean mass, it helps us rebuild part of the muscles that we lose. Also, if you are doing strength exercises, it is essential for muscle growth.\nnutrition is not that complicated We tend to create “diet wars” and judge our friends who are trying different diets (my vegetarian friends know this). The author stays clear of diets and talks about nutrition biochemistry to avoid falling into any diet camp.\nBut as he says, “Nutrition is relatively simple, actually. It boils down to a few basic rules: don\u0026rsquo;t eat too many calories, or too few; consume sufficient protein and essential fats; obtain the vitamins and minerals you need; and avoid pathogens like E. coli and toxins like mercury or lead. Beyond that, we know relatively little with complete certainty. Read that sentence again, please.”\nyou have to start now Your body will surely lose strength and ability as you age, so, if you want to continue to be independent and do the things you love in your last decade, you have to do a lot more now. The idea is that you have to increase your current capacity now and even if you lose over the years, your end position will be a lot higher than if you don’t do anything. For example, if you want to hike 5 km when you are 80 years old, you should be able to hike more than 20 km when you are 35 so even if your capacity decreases, you will still be able to do it.\nAs the book says, “Studies suggest that your VO, max will decline by roughly 10 percent per decade – and up to 15 percent per decade after the age of fifty.”\nFavorite quotes These are my 5 favorite quotes from the book.\n“If longevity were simple, then there might not be a need for this book.” “\u0026hellip; the only way to create a better future for yourself — to set yourself on a better trajectory — is to start thinking about it and taking action now.” “Even when someone dies \u0026ldquo;suddenly\u0026rdquo; of a heart attack, the disease had likely been progressing in their coronary arteries for two decades. Slow death moves even more slowly than we realize.” “Exercise is by far the most potent longevity \u0026ldquo;drug.\u0026rdquo; No other intervention does nearly as much to prolong our lifespan and preserve our cognitive and physical function. But most people don\u0026rsquo;t do nearly enough – and exercising the wrong way can do as much harm as good.” “While your genome is immutable, at least for the near future, gene expression can be influenced by your environment and your behaviors.” Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nTen Percent Happier with Dan Harris podcast episode The Science of Longevity | Dr. Peter Attia Huberman Lab podcast episode Dr. Peter Attia: Exercise, Nutrition, Hormones for Vitality \u0026amp; Longevity The Peter Attia Drive podcast These are my learnings from the book Outlive: The Science \u0026amp; Art of Longevity written by Peter Attia with Bill Gifford. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-outlive/","summary":"These are my learnings from the book Outlive: The Science \u0026amp; Art of Longevity written by Peter Attia with Bill Gifford.","title":"Learnings from the book Outlive"},{"content":" The book An Immense World is a bit different than the books that I usually read but I got really interested in it after watching the documentary Life in Colour with David Attenborough on Netflix.\nI wanted to understand more about how other animal senses are different from ours but learned a lot more about not only how their senses differ from ours but also how their senses build their view of their world (Umwelt).\nIt is so interesting how we have in a way a limited experience of the world as there\u0026rsquo;s much that we don\u0026rsquo;t know that exists.\nLet\u0026rsquo;s see more about the book An Immense World: How Animal Senses Reveal the Hidden Realms Around Us.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from An Immense World Book An Immense World\nLearning that the other animals see the world in a very different and unique way made me appreciate more and try to pay more attention to the small things around us and how all of them relate to each other.\nIt is fascinating that the way we perceive the world sometimes is so different that we may think of them as alien-like. We are such a visual being that we miss much of what other senses have to offer (mostly because we are not capable of sensing but sometimes just because we don\u0026rsquo;t pay attention to it)\nDuring the reading on a few occasions, I remember what Lex Fridman used to ask his guests when talking about if there\u0026rsquo;s life out there in the space. He would ponder about how would we perceive other intelligent beings if they operated very differently from us or in a very different time scale. The question was very provocative because we are so limited to what we can see by our senses, what we consider intelligence, or even by our limited lifetime. And reading this book brought up this feeling a few times.\nWe live in an alien world but don\u0026rsquo;t pay attention or we are not capable of sensing due to our limitations and what evolution focused on during our evolution.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\nevery animal senses the world in a different way We humans have vision as our \u0026ldquo;primary\u0026rdquo; sense and because of that we usually think that most other animals also see the world the same way we see it. But even animals that have vision as the primary sense may not see the same as us as their color sensing can be different, the sensitivity, the acuity, and even the speed they see things.\nOther animals have smell as a primary sense (like dogs), heat, surface vibrations, sounds, etc. So every animal sees their own world. We can be in the same environment and each animal will sense it in a different way.\nsmell is more important than taste for humans Comparing senses is a complicated thing, as each sense gives different or complementary information about the world, but one thing that I found nice is that we sometimes forget the importance of smell in our daily lives.\nWhen we eat something delicious, we mainly think that its flavor comes from the taste. But the sensation of the flavor comes more from the smell than from the taste. That\u0026rsquo;s the reason why food tastes dull during a cold: Its flavor remains unchanged, but without the ability to smell it, its richness fades.\nelephant\u0026rsquo;s main sense is the smell I like documentaries as a way to passively learn something while relaxing and nature documentaries are my favorites. In one of them (not sure if it was \u0026ldquo;Life on Our Planet\u0026rdquo;, \u0026ldquo;Our Planet\u0026rdquo; or \u0026ldquo;Our Great National Parks\u0026rdquo;) they showed how the elephants can find underground water during their migrations in Africa.\nI found it fascinating how they did that. One idea about how they did this was that they remembered where the water wells were buried from previous visits in past years but the book gives more clarity on the subject (at least for me).\nElephant\u0026rsquo;s main sense is smell. It is believed that they can recognize each other only by smell, recognize the sex, and age of other elephants, recognize if the poop left is from someone in their group or another group and it probably helps them find water. Maybe their capacity to find trails and places is not only due to their memory but also to their very good sense of smell.\na few fishes use electric fields Some fishes like Knifefishes and elephantfishes use their bodies as a kind of battery, they generate an electric field around them and use this electric field to detect their environment and also to communicate with one another. \u0026ldquo;Electricity is to them what echoes are to bats, smells are to dogs, and light is to humans—the core of their Umwelt.\u0026rdquo;\nlight is also pollution As we are a very visual species our eyes traded sensitivity for acuity, or in other words, we can see very clearly, but only in a place with good light. Once we turn off the lights, we are very limited. Due to this, we added very bright lights everywhere so we can see better in the dark. But that comes with a price.\nMany other animals are attracted to light or behave in a very different way in environments that contain light. As we are lighting more and more everywhere, we are disrupting the lives of other animals because we don\u0026rsquo;t usually think about them (or when we think we use our view of the world).\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Our Umwelt is still limited; it just doesn\u0026rsquo;t feel that way. To us, it feels all-encompassing. It is all that we know, and so we easily mistake it for all there is to know. This is an illusion, and one that every animal shares.\u0026rdquo; \u0026ldquo;It turns out that all living things produce electric fields when submerged in water. Remember that animal cells are bags of salty liquid.\u0026rdquo; \u0026ldquo;\u0026ldquo;We don\u0026rsquo;t have to look to aliens from other planets,\u0026rdquo; Jakob tells me.\u0026rdquo; \u0026ldquo;An animal\u0026rsquo;s visual field determines where it can see. Its acute zones determine where it sees well. Without considering both traits, we can seriously misinterpret an animal\u0026rsquo;s actions.\u0026rdquo; \u0026ldquo;We have to save the quiet, and preserve the dark.\u0026rdquo; These are my learnings from the book An Immense World: How Animal Senses Reveal the Hidden Realms Around Us written by Ed Yong. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-an-immense-world/","summary":"These are my learnings from the book An Immense World: How Animal Senses Reveal the Hidden Realms Around Us written by Ed Yong","title":"Learnings from the book An Immense World"},{"content":"We are smart engineers and sometimes when we face a fault in the system, we may tend to think the root cause of the problem is very complex, and that assumption guides our investigations when trying to find the root cause.\nWe tend to think this way because we know that we are dealing with complex systems that can cause complex problems. But, most of the time, the root causes are actually a lot simpler and (maybe stupider) than we think they are.\nI am going to share two anecdotes that illustrate this in practice. Both are real-world situations faced by me while debugging issues and trying to find the root causes at work.\nDid the Java version, Kotlin version (or both) break my service? The first example was a service whose basic task was to copy some files over SFTP.\nThe function was relatively simple. Fetch a list of configurations, for each configuration it should connect to an SFTP server, copy the files from the server over to a temporary folder in the local disk, filter out the files the ones already successfully processed (by querying a DB), and after that upload the unprocessed ones one by one to an S3 bucket. The final step was to download it from SFTP and decrypt the file and further process it.\nThat was the expected behavior, but what was happening was that we saw some files being uploaded twice to S3, and when that happened, the first one that was downloaded for decryption failed to be decrypted most of the time.\nOur first assumption was that we were reading incomplete files from SFTP. But why the second time it worked? Also, we checked the size of the file and it was the same.\nAnd then we checked the time the decryption error started happening. It correlated to a change in the Kotlin version and Java version. The code block that was running twice was inside a new thread, so we started to think it could be something with the new version of Java, Kotlin, or both together. See, here is where we start thinking that the problem is very complex.\nAfter running the service locally, we saw that it didn\u0026rsquo;t happen. So why was it?\nAfter a few other assumptions and tests, we decided to list all the production configurations in which the service iterates to download the files.\nAnd voilá, it turned out that we had two configurations with the same name, and due to that, it was downloading the same files twice. At the end of the day, the system was working as expected but the problem was in the configuration.\nSo in summary, we sometimes look for a complex solution or a complex problem, but in the end, it is maybe just a simple configuration error, and the system is working as expected (from the point of view of the service, not the user).\nDo we have a memory leak? In another situation (in another service) we started seeing a service with the following memory (RAM) profile. It was a Java service.\nMemory profile of the service\nSo, you can see that the memory is constantly increasing until it gets to a point where it reaches the maximum, and the service is killed by Kubernetes.\nUpon seeing this, the first question was: Do we have a load that would justify this increase? The answer was no.\nWith no apparent extra load on the service, and no new version released, what could be happening? For sure memory leak in the JVM crossed my mind, and actually was guiding the investigation.\nBut, by luck, we related it to processing a file but the file itself had nothing very apparent that could cause the problem, it was just a file, similar to others that we have been processing successfully.\nStill thinking it could be a memory leak, we started processing the file and watched while the memory continued growing, and right before it reached its maximum, we took a thread dump.\nThe memory dump clearly pointed out a collection, which was really huge, with almost all the service\u0026rsquo;s memory.\nThe first look at the code, we could see that there was no way that the collection would be this big, it could have hundreds of records, but not hundreds of thousands.\nSo what was it, was the GC not cleaning the reference? What are you doing JAVA????\nBut, looking more closely at the code, there\u0026rsquo;s a missing condition in the loop, in which depending on the file content, it would fall, and guess what? Never leave.\nBasically, in a few rare cases, the code would become an infinite loop and start accumulating the same items in the list until there was no more memory left for the pod and it would be killed.\nSo, poor GC was not to blame, but one line change was missed by the developer.\nI try to keep this in mind when I am looking for root causes of problems. Sometimes the root cause of the problems is simpler than they appear.\nPhoto by Nubelson Fernandes on Unsplash\n","permalink":"https://luizvieira.me/root-cause-simpler-than-appear/","summary":"We are smart engineers and sometimes when we face a problem we may tend to think the root cause is very complex, but usually, they are simpler than they appear","title":"Root causes are usually simpler than they appear"},{"content":" I loved the book Clear Thinking. Maybe because I have Shane Parrish as a role model for a thinker, problem solver, and curious person as I listen a lot to his podcast The Knowledge Project. His podcast The Knowledge Project was actually my second most listened-to podcast in 2023.\nNow, see more about the book Clear Thinking: Turning Ordinary Moments into Extraordinary Results.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book Clear Thinking Book Clear Thinking\nWhat I like the most about the book is the idea of our defaults (mainly the ego default). It is really nice to see that to be able to clearly think, we have to check and verify what is our state of mind when we make decisions, not only the factors that are part of decisions.\nI was kind of aware of the existence of most of the other defaults (not that just being aware without practice means anything) but the ego default was for sure a slap in the face. While reading the book I remember a lot of situations that the ego default took the best of me.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\nnew ideas require bad ideas Companies and other organizations usually say that they want new ideas, but what they usually mean is that they want good ideas and not bad ones. Because they really don\u0026rsquo;t want to choose bad ideas, they never explore enough to discover new good ones.\nego is your enemy Of the defaults explained in the book, the ego is by far the most dangerous in my view. Maybe because I see myself falling for it sometimes.\nThe idea is that ego default makes us react to anything that threatens our sense of self-worth and self-image at any cost. It makes us believe that we are more than we actually are.\nAs the author nicely says: \u0026ldquo;The ego default urges us to feel right at the expense of being right. Few things feel better than being right \u0026ndash; so much so that we will unconsciously rearrange the world into arbitrary hierarchies to maintain our beliefs and feel better about ourselves.\u0026rdquo;\nIf we\u0026rsquo;re not careful, having a little knowledge can make us too confident or even arrogant. When we learn something online, we might start thinking everything is easy. This can lead us to take risks without realizing how risky they are. As another part of the book says: \u0026ldquo;Our ego default wants us to think that we\u0026rsquo;re smarter than we are and tells us that we work harder and know more than we actually do. The overconfidence that the ego demon inspires prevents us from examining our decisions with a critical eye. It keeps us from distinguishing skill from luck—what\u0026rsquo;s in our control from what isn\u0026rsquo;t. If you get trapped by the demon, you\u0026rsquo;ll never learn from your decisions and never get better at making them in the future.\u0026rdquo;\nThe ego part reminded me a lot about the book Mistakes were made (but not by me)\nthe problem is defining the problem I remember that in the Startup Weekend world, the point about defining the problem is stressed a lot. But it also applies to anything that you are trying to solve in your life or in your company.\nWe usually spend very little time really trying to find out what the problem really is. We just hear a brief explanation and already start solving it instead of digging deeper to understand what the real problem really is.\nThe result is that we waste a lot of time solving the wrong problems or only treating the symptoms and not the real cause so we never really fix it. We want to add value, so we start solving a problem, any problem.\nbe kind, not nice There is a difference between being kind to others and being nice to others. Being kind means (in my view) being honest and helping other people be better as being nice means making them like us.\nAs the book says, \u0026ldquo;Kind people will tell you things a nice person will not. A kind person will tell you that you have spinach on your teeth. A nice person won\u0026rsquo;t because it\u0026rsquo;s uncomfortable. A kind person will tell us what holds us back even when it\u0026rsquo;s uncomfortable. A nice person avoids giving us critical feedback because they\u0026rsquo;re worried about hurting our feelings.\u0026rdquo;\nhappiness is a choice, not a condition Probably I am falling for confirmation bias here, but I truly believe in this. As I read a lot lately about death, life, priorities, etc, I truly believe that we have to choose to be happy.\nA great snippet from the book: \u0026lsquo;According to Pillemer, \u0026ldquo;The elders make the key distinction between events that happen to us, on the one hand, and our internal attitude toward happiness, on the other. Happy in spite of. Happiness is not a passive condition dependent on external events, nor is it the result of our personalities— just being born a happy person. Instead, happiness requires a conscious shift in outlook, in which one chooses—daily— optimism over pessimism, hope over despair.\u0026rdquo;\u0026rsquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;While the rest of us are chasing victory, the best in the world know they must avoid losing before they can win. It turns out this is a surprisingly effective strategy.\u0026rdquo; \u0026ldquo;A good position allows you to think clearly rather than be forced by circumstances into a decision\u0026rdquo; \u0026ldquo;Doing something different means you might underperform, but it also means you might change the game entirely.\u0026rdquo; \u0026ldquo;Eventually, almost everyone loses the battle with willpower; it\u0026rsquo;s only a matter of time.\u0026rdquo; \u0026ldquo;The biggest mistake people make typically isn\u0026rsquo;t their initial mistake. It\u0026rsquo;s the mistake of trying to cover up and avoid responsibility for it. The first mistake is expensive; the second one costs a fortune.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nTen Percent Happier with Dan Harris podcast episode How to Make Good Decisions | Shane Parrish The Greg McKeown Podcast podcast episode Clear Thinking with Shane Parrish Part 1 and Part 2 The Knowledge Project with Shane Parrish podcast These are my learnings from the book Clear Thinking: Turning Ordinary Moments into Extraordinary Results written by Shane Parrish. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-clear-thinking/","summary":"These are my learnings from the book Clear Thinking: Turning Ordinary Moments into Extraordinary Results written by Shane Parrish","title":"Learnings from the book Clear Thinking"},{"content":"Between Christmas and New Year, we got some vacation days and as the weather in Vancouver was not that cold (it hadn\u0026rsquo;t snowed yet) and because of that, we started looking for someplace to relax and enjoy the cold weather.\nLooking at Airbnb, we found a really nice log cabin around Ruth Lake, in Forest Grove, the interior of BC that was available. The drive was a bit longer, but we also wanted to take our time and explore a bit more of British Columbia.\nView of the log cabin\nThe Cabin The log cabin is very cozy very organized with everything that we needed and the decoration is really nice. We can see that they paid a lot of attention to the details.\nLog cabin interior\nThe fireplace inside made the place really warm and in a really nice cozy mood. We stayed there drinking wine and just looking at the fire.\nLovely fireplace\nThe Frozen Lake We were blessed with sunny days (that week was really cloudy) so we could see the sunrise sitting in the chair facing the frozen lake.\nSunrise with frozen lake view\nWe were amazed at the frozen lake. Coming from a tropical country, we are still not used to snow and seeing everything frozen.\nWe stayed outside a lot, we made a campfire facing the frozen lake. We stayed there for hours drinking wine admiring the lake, the sky, and the fire. We could even see a shooting star.\nCampifire outside\nFor sure, we loved the fireplace, the one inside, and the campfire outside.\nThe host Diana was also very friendly and helpful. We talked quite a bit, and it was really nice to learn more about them and their history building the place.\nCheers.\n","permalink":"https://luizvieira.me/log-cabin-ruth-lake/","summary":"We loved the log cabin in Ruth Lake as it was very cozy and the fireplace made the place really warm and nice","title":"Relaxing in a cozy log cabin in Forest Grove - BC"},{"content":" In 2023, I set a personal record for the highest number of books read in a single year. In this post, I\u0026rsquo;ll share my top 5 favorites from the list of books I enjoyed in 2023.\nWhile I do not consider myself a fast reader, I managed to complete 23 books this year. Among them, a few were technical reads, but the majority fell into the categories of business and self-improvement.\nThe 23 books read in 2023\nThe main subject across the books of 2023 was somewhat related to death. But what I believe is that it is more about learning how to live well. Remembering our limited time on this earth can help us focus on what is more important to us right now, and also help us not to get worried about things that are not important and also not under our control.\nThe second most read topic was self-improvement. I always try to improve myself, and I’ll improve aspects of my life.\nWhen writing this post I decided to exclude software engineer technical books, because most of the people are probably not engineers and not going to get much about the technical book so all the other books were considered, but not the technical ones.\nMy top 5 favorite books of 2023 So these are the top favorite books that I read in 2023 in reading order.\nBeing Mortal: Medicine and What Matters in the End Being Mortal: Medicine and What Matters in the End\nYou can think that the book Being Mortal is about death (and it is true), but for me, it is more about life. Death is unavoidable and talking about it, makes us reflect on what are the more valuable things for us in our lives. Being Mortal is a reminder that we have a limited time to live on this earth and it touches on complicated subjects, mainly regarding the last years of our lives and how we can have a better ending to our lives.\nIn the book-specific post, I highlight the Learnings from the book Being Mortal which are mainly: Medicine’s goal is to extend life, what matters to us changes, what is worth living for?, everything is trade-offs, hospice maybe is a good option and letting go.\nExtreme Ownership: How U.S. Navy SEALs Lead and Win Extreme Ownership: How U.S. Navy SEALs Lead and Win\nThe main idea of Extreme Ownership is that all responsibility for the success or failures of a team or organization falls with the leader. That means that the leader must own everything. No one to blame, only the leaders themselves.\nEven if in your work your job is not a \u0026ldquo;leader\u0026rdquo; job you can benefit as everyone in a way is a leader. You can even lead your own boss.\nIn the post Learnings from the book Extreme Ownership I highlight the principles that I like the most: Some are: Extreme Ownership, \u0026ldquo;No bad Teams, Only Bad Leaders\u0026rdquo;, Believe, Check the ego, Simple, Prioritize and Execute, Leading up the chain and others.\nQuit: The Power of Knowing When to Walk Away Quit: The Power of Knowing When to Walk Away\nThe primary objective of the book is to challenge and transform the negative perception associated with quitting, highlighting instances where it is indeed the most optimal course of action. By shedding light on various biases that often compel us to persist in unproductive situations, the book emphasizes our tendency to avoid using the term \u0026ldquo;quit\u0026rdquo; due to societal judgments.\nCheck out the post Learnings from the book Quit for more learnings like: Grit vs Quit, We avoid the word Quit, Expected value as a framework, Avoid escalation of commitment, Work on the hardest thing first, Have a kill criteria, The endowment effect, Your identity is not what you do, and The dark side of goals.\nFour Thousand Weeks: Time Management for Mortals Four Thousand Weeks: Time Management for Mortals\nThe name of the book comes from the approximate life span of a human. If you live to be eighty years old, you\u0026rsquo;ll have had about four thousand weeks of life. This is a surprisingly short period.\nThe book tries to help us face the fact that our time is very limited and we will not be able to do everything that we want to do in this life, so we have to prioritize, not do some things, live in the moment, or just enjoy the things by what they are not what is the value in the future.\nOn the post Learnings from the book Four Thousand Weeks I write why: You\u0026rsquo;ll never have time for everything, Being efficient is a trap, The value of your time is not measured by the results, We use leisure as a means to an end and Time alone is not worth\nSame as Ever: A Guide to What Never Changes Same as Ever: A Guide to What Never Changes\nThe book brings short stories about 23 things that never changed and in theory will never change in the future.\nAs the author puts it: \u0026ldquo;History is filled with surprises no one could have seen coming. But it\u0026rsquo;s also filled with so much timeless wisdom.\u0026rdquo;\nThe whole concept of the book is really nice: Instead of looking for the new shining thing, the book focuses on what tends to be stable over time, and due to that it tends to be dismissed by everyone.\nOn the post Learnings from the book Same as Ever I share the 5 main learnings of the book, which are: everything is so fragile, you can’t predict the unpredictable, low expectations is key to happiness, good stories are better than facts and optimism for the long run, pessimism in the short run.\nOther books I read in 2023 that have their own posts: Excellent Advice for Living, How Will You Measure Your Life?, Never Split the Difference, The Song of Significance, Think Again, Foundations of Scalable Systems, Mastering Distributed Tracing, Pro Spring 6 and RabbitMQ in Depth.\nIf you want to check out the learnings from the other books that were not on this list, check out the Learnings from Books category with all the posts.\nI hope that some of the books caught your interest and helped you learn something new.\nHappy reading!\n","permalink":"https://luizvieira.me/best-books-2023/","summary":"Out of 23 books, I selected 5 of my favorite books in 2023 to share with you","title":"The 5 Best Books I Read in 2023"},{"content":"We recently came back from our first all-inclusive resort experience and we felt like a king (and queen). In this post, I will describe the hotel and the experience.\nMe and Mrs Vieira decided to run away from the cold and celebrate our anniversary in a warm place and as we always wanted to visit Cancun we chose it as our destination.\nWe usually do low-cost trips but this time we decided to splurge and stay in an all-inclusive resort as it was a special anniversary for us. We chose a package in Costco Travel for Wyndham Grand Cancun All-Inclusive Resort \u0026amp; Villas as it was a good price for us.\nAs we arrived in Cancun we could feel the difference, in Vancouver the weather was around 4°C, and in Cancun, it was around 30°C.\nWyndham Grand Cancun All-Inclusive Resort \u0026amp; Villas We started feeling like kings when we got to the hotel, as we didn\u0026rsquo;t even need to pick up our backpacks from the transfer van, the hotel bellboys did it.\nView of the pool and Wyndham Grand Cancun\nthe resort The resort is very complete. It has an excellent view of the ocean, a lot of restaurants, beach access, and three (or more) pools.\nWe didn\u0026rsquo;t use the pools much, mostly only a few times mainly at night as we preferred to stay on the beach for most of the day.\nView of the beach from the hotel pools\nthe room Because of our anniversary, we got a free room upgrade and also a bottle of sparkling wine, it was nice of them to provide that.\nIt was really comfortable, more than we needed as we mostly just came back to the room to sleep and shower. We tried to stay as much as possible outside.\nView from the room balcony\nthe beach The beach in front of the resort is nice and larger than the other hotels around. When we went to the beach, the flag warning was all red but we could go into the water at the border. The water was really clear and the temperature was really good.\nWe stayed most of the time on the beach, we usually went there around 8 AM and stayed until 3 PM below a beach cabana, just going to the ocean to refresh ourselves, drinking, reading, and enjoying the view. I even finished the book Same as Ever there.\nRelaxing in the beach\nthe food The food was spectacular, mainly during dinner in the restaurants where we needed to make reservations. The one we liked the most was Da Vinci which was Italian cuisine. We ate a bit of everything there. Second was La Vista which is Brazilian food (the one that comes in the stick on your table). The Pina Grill was also great, but we ate seafood for lunch there a lot so we preferred the others for dining.\nMain courses at Da Vinci Restaurant\nthe drinks The drinks are also very good, there are so many options that we didn\u0026rsquo;t know what to order. We drank a lot of Pina Colada, Margarita, Dirty Monkey, Caipirinha and beer. The bartenders were really nice and the waiters were as well.\nA few drinks that we drank: Pina Colada, dirty monkey, margarita, cosmopolitan, beer, mango tango, michelada, mojito, caipirinha, and dry martini. Our favorite was Pina Colada.\nSpecial thanks to Antonio, the bartender from Kukus Bar, and Francisco, the bartender from the lobby bar.\ndrink (that I don\u0026rsquo;t remember the name)\nthe entertainment Another thing that is worth mentioning is the entertainment staff. Alan (or Alain) was very nice and friendly, always trying to make people laugh. The shows that they had during the night were nice as well.\nMichael Jackson show\nWe loved the experience and we are recommending it to all our friends. It is not a cheap thing, but it is nice to do it every few years for a celebration when you just want to relax and enjoy the place.\n","permalink":"https://luizvieira.me/cancun-all-inclusive-resort/","summary":"We recently came back from our first all-inclusive resort experience and we felt like a king (and queen)","title":"Cancun all-inclusive Resort: We felt like kings"},{"content":" This is the last book read in 2023 and by chance on the same subject as the first one of the year: Death. Actually, it is more about living than dying, because when we learn more about dying, we value and savor our lives and live better. As the author beautifully points out: \u0026ldquo;Death is not waiting for us at the end of a long road. Death is always with us, in the marrow of every passing moment. She is the secret teacher hiding in plain sight. She helps us to discover what matters most. And the good news is we don\u0026rsquo;t have to wait until the end of our lives to realize the wisdom that death has to offer.\u0026rdquo;\nLet’s now see more about the book The Five Invitations: Discovering What Death Can Teach Us About Living Fully.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from The Five Invitations The goal of the book with the invitations is to invite the reader to participate actively in their event of life, invite the reader to really be present in every aspect of their own life. As the author mentions, it can help you live a life of integrity and cope with death.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\navoid the hope that is disguised as expectation Hope is an essential resource for our lives. Hope acts as the driving force that propels us out of bed each morning, ready to embrace the potentialities of a fresh day. It helps us believe in a future that is good despite all the challenges and setbacks.\nThis is a good kind of hope, the belief that things will get better.\nBut as the author points out, this is not the kind of hope we usually have, our hope is more similar to wishful thinking, a rejection of the current situation, and a belief in a specific outcome.\nAs said by the author: \u0026ldquo;Ordinary hope disguised as expectation is fixated on a specific outcome. This hope gets conflated with the desire for a certain future result. It becomes object-focused. It takes us outside of ourselves. The quandary is that when the outcome isn\u0026rsquo;t achieved, the object isn\u0026rsquo;t grasped, then our hopes are dashed. Attaching our happiness to a specific outcome causes us all sorts of suffering. To manage that distress, we attempt to control everything that is happening around us. But we have no control over the weather on our wedding day, the moods of others, winning the lottery, or even receiving a cancer diagnosis. As we have seen, the law of impermanence trumps our best-laid plans. In the ever-changing landscape of our lives, attachment to outcome posing as hope only generates anxiety and interferes with our ability to be present to our experience of life as it is unfolding in this very moment.\u0026rdquo;\ndying is messy / there’s no \u0026ldquo;good death\u0026rdquo; We often like to believe in the idea that something like a \u0026ldquo;good death\u0026rdquo; exists. We hold onto the optimistic hope that when people die, everything will be neatly resolved, and they will be completely at peace.\nBut as the book points out, that rarely happens and the sort of expectation even puts the dying in the family under pressure.\nAs the book mentions: \u0026ldquo;Dying is messy. People who are dying often leave skid marks, dragging their heels as they go. Some people turn away from others and never look back. For many, the habits of a lifetime go unquestioned, and they fight fearfully to keep those habits in place. For others, their fight is like a badge of honor; they want to go down swinging. Very few people walk toward the immense challenge of dying and find peace and beauty there. But who are we to say how another should die?\u0026rdquo;\nforgiveness is for the forgiver We usually think that when we forgive someone, we are doing it for them, but that is not actually the case for most of us. When we forgive, we set down old pain, and it helps open us to love.\nForgiveness does not mean forgetting, that everything is back to normal, or even that we should welcome people back into our lives, it just means that that old thing does not have a hold on us anymore.\nAs this piece from the book beautifully says: \u0026ldquo;All forgiveness is self-forgiveness. It is a remarkable form of self-acceptance that allows us to release unbelievable pain. It\u0026rsquo;s about realizing that as long as you hold on to the hot coal of your anger, resentment, and sense of having been wronged, you are only hurting yourself. Unless you release that burden, you will carry it with you for the rest of your life. You will never be free. Don\u0026rsquo;t wait. Don\u0026rsquo;t wait until you find yourself on your deathbed to begin the process of forgiving those who have hurt you or those you have wronged. Allow the fragile nature of life to show you what\u0026rsquo;s most important\u0026hellip; then take action. It hurts too much to keep others or ourselves out of our hearts.\u0026rdquo;\nwe are not our roles Identity is also a very common subject in my recent books. When we attach our identity to our roles (\u0026ldquo;software engineer\u0026rdquo; for example) it defines us, confines us, limits us.\n\u0026ldquo;We are not our roles, and we are not our conditions. You may have cancer or bipolar disorder, but you are not your disease. You may be born into wealth or poverty, but you are not rich or poor. You may find yourself happy or sad, old or young, in supportive conditions or in conditions of despair, but you are not these things. We are first and foremost human beings, with all of the complexity, fragility, and wonder that life encompasses. When we only look through the lens of a role, it narrows our vision of the world. We don\u0026rsquo;t see things and people as they actually are, but rather project our story onto them.\u0026rdquo;\nsuffering is part of life Suffering is part of life. Instead of running away from the suffering, we should strive to face it and look deeper to see what is really there.\n\u0026ldquo;When we allow the experience — creating space and acceptance for it — we find that our suffering is not a static, monolithic thing, but rather it is composed of many elements, including our attitudes toward it. Understanding this, we can work skillfully to alleviate the underlying reactions that exacerbate our problems so that we might ease our suffering.\u0026rdquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;It is the impermanence of life that gives us perspective.\u0026rdquo; \u0026ldquo;Listening without judgment is probably the simplest, most profound way to connect. It is an act of love.\u0026rdquo; \u0026ldquo;We don\u0026rsquo;t get past our pain. We go through it and are transformed by it.\u0026rdquo; \u0026ldquo;Clinging to the old makes it difficult for something new to emerge.\u0026rdquo; \u0026ldquo;The willingness to sit with fear is an act of courage.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nMy blog post Learnings from the book Let's talk about death (over dinner) My blog post Learnings from the book Being Mortal These are my learnings from the book The Five Invitations: Discovering What Death Can Teach Us About Living Fully written by Frank Ostaseski. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\n","permalink":"https://luizvieira.me/learnings-book-the-five-invitations/","summary":"These are my learnings from the book The Five Invitations: Discovering What Death Can Teach Us About Living Fully written by Frank Ostaseski","title":"Learnings from the book The Five Invitations"},{"content":" I believe that this is the book that I have read in the shortest time. I’ve finished it in around 3 days. The reading is good and smooth but I had time on the plane and on vacation to finish it that fast.\nI was familiar with most of the concepts of the book as I’ve read almost all of Morgan Housel\u0026rsquo;s posts on the Collaborative Fund and also listened to his podcast. Also listened to some podcasts interviewing him (all links on resources at the end). But it is nice to have all of them together in the book.\nLet’s now see more about the book Same as Ever: A Guide to What Never Changes.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Same as Ever The book brings short stories about 23 things that never changed and in theory will never change in the future.\nAs the author puts it: \u0026ldquo;History is filled with surprises no one could have seen coming. But it\u0026rsquo;s also filled with so much timeless wisdom.\u0026rdquo;\nThe whole concept of the book is really nice: Instead of looking for the new shining thing, the book focuses on what tends to be stable over time, and due to that it tends to be dismissed by everyone.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\neverything is so fragile The idea that everything can change because of a small thing is so powerful and changed the way I think about things. The idea is that some of the big changes and important things in history happened because of a small random thing.\nI am sure you can think of instances in your life like that, one time when one small decision (or a random event) changed everything. For example, I met my wife on a double date with my roommate, if I got sick, or decided not to attend that date, I would not have married the same person and my life could go in a totally different direction.\nyou can’t predict the unpredictable We are aware that we are very bad at prediction, even people who live out of predicting things are not that good (check the weather forecast or the \u0026ldquo;best stocks\u0026rdquo; for next year and you will know what I am talking about). But what caught more attention was Morgan\u0026rsquo;s point about what the things that really matter (the biggest) events are the ones that no one predicts. The biggest risk is our lack of imagination of what could happen.\nAs well written in the book: \u0026ldquo;The biggest risk is always what no one sees coming, because if no one sees it coming, no one\u0026rsquo;s prepared for it; and if no one\u0026rsquo;s prepared for it, its damage will be amplified when it arrives.\u0026rdquo;\nA great example of this is the COVID-19 pandemic. No one predicted it and it was one of the most impactful events in our lives in recent years. When planning for 2020, I thought about some risks, like losing my job, some accidents, etc, but I never thought that my life would change and I would have to spend most of my time working from home.\nlow expectations is key to happiness I always say that having low expectations is key to happiness for my wife, not sure where I get this from (maybe Morgan or Charlie Munger) and I totally believe in this. Our happiness is reality less expectations, so the lower the expectation, the happier you are with reality.\nLow expectation is not complacency in my view, it is giving my best always but without attaching the happiness or the accomplishment with the result, but more importantly with the process. Like, I read a lot to improve myself, I listen to a lot of podcasts, etc.\nThe goal is to have an expectation goalpost to stop moving and we will be happier and happier with the outcome as the gap between reality and expectations increases.\ngood stories are better than facts I am not a very good storyteller, but that is something that I have to work on as the book nicely points out \u0026ldquo;Not the best idea, or the right idea, or the most rational idea. Just whoever tells a story that catches people\u0026rsquo;s attention and gets them to nod their heads is the one who tends to be rewarded.\u0026rdquo;\nHumans evolved by telling stories, not by telling facts. Being able to tell good stories is more important than knowing facts.\noptimism for the long run, pessimism in the short run In the long run, things tend to get better but in the short run, things are a lot more volatile. So, we should prepare for the worst in the short run (have an emergency fund, for example), but also be optimistic that in the long run, things will get better, as they almost always do.\nMost of that is because good things take a long time to compound so we will harvest the result only after a few years. For example, college takes a year but usually, you are better off after. Professional experience is the same, as you accumulate experience, things tend to get better. Investing is the same, compound interest takes time.\nAs the author points out: \u0026ldquo;The trick in any field – from finance to careers to relationships – is being able to survive the short-run problems so you can stick around long enough to enjoy the long-term growth.\u0026rdquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;People don\u0026rsquo;t want accuracy. They want certainty.\u0026rdquo; \u0026ldquo;A successful person purposely leaving gaps of free time on their schedule to do nothing in particular can feel inefficient. And it is, so not many people do it.\u0026rdquo; \u0026ldquo;A good summary of investing history is that stocks pay a fortune in the long run but seek punitive damages when you demand to be paid sooner.\u0026rdquo; \u0026ldquo;The most important things come from compounding. But compounding takes awhile, so it\u0026rsquo;s easy to ignore.\u0026rdquo; \u0026ldquo;Long-term thinking is easier to believe in than to accomplish.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nMorgan Housel posts on Collaborative Fund The Morgan Housel Podcast: My New Book, Same As Ever: A Guide to What Never Changes The Tim Ferriss Show: #702: Morgan Housel — Contrarian Money and Writing Advice, Three Simple Goals to Guide Your Life, Journaling Prompts, Choosing the Right Game to Play, Must-Read Books, and More These are my learnings from the book Same as Ever: A Guide to What Never Changes written by Morgan Housel. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy learning!\n","permalink":"https://luizvieira.me/learnings-book-same-as-ever/","summary":"These are my learnings from the book Same as Ever: A Guide to What Never Changes written by Morgan Housel","title":"Learnings from the book Same as Ever"},{"content":" I have been working with Spring for a few years now and I can consider myself with advanced Spring knowledge on the basics, rest, data, etc. But I haven\u0026rsquo;t touched on some of the other many projects that they have. In doing interviews for a Senior Software Engineer at my current company, I faced some doubts when some candidates replied to our questions. Also, we are planning a major upgrade from 2.7.x to 3.2.x so I wanted to know more about it. It was then that I found the book Pro Spring 6 in the O\u0026rsquo;Reilly library and decided to read it.\nThis post of Learning is from a technical book, so it may be a bit different than the other posts of the collection Learnings from books, as when I read technical books I focus more on the parts that I looking to learn and for my current situation.\nLearnings from the book Pro Spring 6 The book is really good and brings some overview and also some advanced concepts on how Spring works under the hood and also brings overview and examples about some of the projects. Even if you have been using Spring for a while you may benefit from reading it, like I did.\nThe book has a lot of learnings, but to not be too long a post, I will share my 4 most important learnings from the book.\nSpring has two proxy implementations I was already aware of how Spring Proxy worked and their goal of intercepting method invocations and adding additional behaviors, like caching (@Cache) and transactions (@Transactional) but I have never gone deeper to check the implementations of the proxy. Basically, Spring has two proxy implementations: JDK dynamic proxies and CGLIB proxies. One of the basic differences is that JDK proxy can generate proxies only of interfaces, not classes whereas CGLIB proxy can proxy both classes and interfaces.\nThe main difference is cited in the book: \u0026ldquo;With the JDK proxy, all decisions about how to handle a particular method invocation are handled at runtime each time the method is invoked. When you use CGLIB, CGLIB dynamically generates the bytecode for a new class on-the-fly for each proxy, reusing already generated classes wherever possible. The resulting proxy type in this case will be a subclass of the target object class.\u0026rdquo;\nEasily converting with Custom Converter One nice thing that I learned is that we can perform conversions between custom types by implementing the Converter\u0026lt;S, T\u0026gt; interface.\nSpring Native image can make the application startup faster I have heard of GraalVM before but never in detail, but one chapter of the book brought really good information about Spring Native images.\nDue to the ahead-of-time (AOT) compilation of the GraalVM native-image compiler, Spring behaves differently, as mentioned in the book\n\u0026ldquo;In a typical Spring application, a lot of reflection is required to inject beans into other beans. The Spring IoC container identifies @Configuration classes and bean definitions and creates a dependency tree to decide the order in which the beans are created, so that they can be injected. All this work is done when the application starts, at runtime. In a Spring Native executable, Spring behaves differently. Configuration classes are no longer identified and parsed and bean definitions are not created at runtime; all this work is done at build time. The bean definitions are processed and converted into source code that is analyzed by the GraalVM compiler, so that the ones that are not reached (used) can be dropped. The generated code is seriously verbose, because without the power of Spring IoC, all that is left is very explicit code, injecting the right beans in the right places through classic Java code—direct assignment and explicit instantiation of the bean type. This obviously increases the build time, but that is not really a problem.\u0026rdquo;\nReactive Programming is something nice to try In recent years there has been a lot of talk about reactive programming because, in theory, it makes the application more flexible, loosely coupled, and scalable, but I never understood it very well, but the book brings a well-explained chapter about how things work.\nIt is a complex subject, so better check the book or other resources, but my biggest takeaway is that both the client and server have to be reactive and all the functionalities in the flow must be as well, even the calls to the database have to be reactive.\nThese are my 4 most important learnings from the book Pro Spring 6: An In-Depth Guide to the Spring Framework written by Iuliana Cosmina, Rob Harrop, Chris Schaefer, Clarence Ho.\nHappy coding!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-pro-spring-6/","summary":"These are my learnings from the book Pro Spring 6: An In-Depth Guide to the Spring Framework","title":"Learnings from the book Pro Spring 6"},{"content":"As part of the increased resilience for our RabbitMQ cluster, we added the argument x-delivery-limit to our service\u0026rsquo;s quorum queues in order to avoid poisonous messages in our service queues.\nThe idea is that if we have a message that cannot be deserialized in our custom object types (or other errors, like NPE), it would try to perform the operation for a finite number of times, in our case 10, and after that, the not consumable message would be routed to the service\u0026rsquo;s DLQ.\nAfter the message arrives in the DLQ, it would be consumed as a default Message, logged the message metadata for debugging purposes, and after we would just discard the message.\nWhen the DLQ Message Is Also Poisonous One possibility that we didn\u0026rsquo;t think of was that even the basic Message maybe was not able to be received by the consumer, being itself a poisonous message in the Dead Letter Queue (DLQ).\nThat is what happened in one case. What happened was that one of the services published a message with a payload a little bit bigger than 64MB and we had the default value from the rabbitmq-java-client (which comes from Spring AMQP) library which is by default 64 MB.\nDefault maximum consumer message size in the RabbitMQ Client ConnectionFactory.java class\nWhen the consumer of the DLQ was trying to consume the message, it was throwing the following error message\nStack trace with error\nBut despite adding x-delivery-limit to all service queues, we forgot to add it also to the DLQ, so when the message was not able to be delivered, it was returned to the broker and being tried again, in an infinite loop.\nA Poisonous Message Can Kill the Connection But that is not the only and worst problem. What happens is that when the channel is faced with a big message like this, based on the current implementation, the channel is to shut down and stops the connection from receiving work\nMethod handleFailure in RabbitMQ Client AMQConnection.java class\nAs described in the docs.\nshutdown method on RabbitMQ AMQConnection.java class\nSo, besides being poisonous, it was also killing the connection affecting all other channels and consumers for other queues.\nThis shutdown of the connection caused multiple messages to be delivered more than one time as the connection was killed before the acknowledgment was delivered to the broker, so it tried to deliver all other messages again.\nAdd a Delivery Limit to the DLQ Too That is why it is also important to have an x-delivery-limit for DLQ as they also can drop messages that have a larger body size than allowed by the consumers (or other unforeseen errors).\nHappy coding!\n","permalink":"https://luizvieira.me/rabbitmq-dlq-poisonous-message/","summary":"Poisonous message handling is very important in the Dead Letter Queue (DLQ) and in this post we will show what happens when we do not take that into account","title":"RabbitMQ DLQs: Why Poisonous Message Handling Matters"},{"content":" I’ve been listening to podcasts for a while now, basically since the time that we had to explain what a podcast was (I believe around 2017). Most of the podcasts that I listen to are educational in some way, I like podcasts that make me think, that I learn something, or help me improve any aspect of my life in any way.\nLast year I switched to Spotify as a podcast player and with that, I got some nice stats at the end of the year about my listening, and based on the Spotify Wrapped I will share my top 5 listened to podcasts in the year 2023.\nThe top 5 podcasts that I listened to in 2023 I have spent 16,789 minutes with podcasts in 2023 which is 11.5 days. So, considering that Spotify counts the minutes listened and I listen in 2x, I listened to more than 33,000 minutes, it\u0026rsquo;s a crazy amount of podcast.\nSpotify Wrapped stats\nI will enumerate the top five podcasts, beginning with the least listened to and progressing towards the most popular.\n5. Motley Fool Money I was surprised to see this podcast in the list as I stopped listening, and following it a few months ago. The podcast is great, and it talks about the market and stocks and recent events related to investments but we converted our portfolio to ETFs.\nI kind of wanted to stop listening about stocks in the market and current events so while the podcast is still great, it’s not good for me now because I’m avoiding this kind of information right now.\n4. Lex Fridman Podcast I started listening to Lex Fridman when his podcast was called The Artificial Intelligence Podcast and continued listening and liked even more when he changed the name and the focus for a more generic interview-like podcast.\nHe is very smart and his questions are very good, together with the great guests, it becomes a very interesting and nice podcast. The variety of different guests is really good as well he talks about science, technology, history, philosophy, and the nature of intelligence, consciousness, love, and power. I learned so much from it.\nHere are my favorite episodes:\n#326 – Annaka Harris: Free Will, Consciousness, and the Nature of Reality #384 – Matthew McConaughey: Freedom, Truth, Family, Hardship, and Love #395 – Walter Isaacson: Elon Musk, Steve Jobs, Einstein, Da Vinci \u0026amp; Ben Franklin #396 – James Sexton: Divorce Lawyer on Marriage, Relationships, Sex, Lies \u0026amp; Love 3. Huberman Lab A science-focused podcast, Huberman Lab is great for learning about neuroscience and the relation between our brain, our behavior, and how we humans work at a science level, down to the signals and technical details.\nThe tools and knowledge that he shares are really nice and practical. I always like to know a bit more about how this complex machinery of the human body works.\nHere are my favorite episodes:\nTim Ferriss: How to Learn Better \u0026amp; Create Your Best Future Guest Series | Dr. Paul Conti: Tools and Protocols for Mental Health Dr. Lisa Feldman Barrett: How to Understand Emotions Mental Health Toolkit: Tools to Bolster Your Mood \u0026amp; Mental Health A Science-Supported Journaling Protocol to Improve Mental \u0026amp; Physical Health 2. The Knowledge Project with Shane Parrish Another interview podcast with a bit more focus on business, performance, etc. Shane describes the podcast as \u0026ldquo;Master the best of what other people have already figured out so you can use their lessons in your life to create an unstoppable advantage.\u0026rdquo;\nI love the wide range of topics and interviews with top people in their fields. It is a very good way to access the best of the best in the world.\nIt is currently number two as I started to re-listen old episodes that I missed or just forgot.\nHere are my favorites:\n#160 TKP Insights: Leadership #159 Dr. Anna Lembke: Between Pleasure and Pain #149 Neil Pasricha: Simple Rules for Happiness #152 Tobi Lütke: Calm Progress #170: TKP Insights: Philosophy #140 TKP Insights: Sex and Relationships #178 Jerry Colonna: The CEO Whisperer #180 TKP Insights: Learning and Thinking #136 David Sinclair: Reversing the Aging Process 1. Hidden Brain It is not a surprise for me that this is the most listened-to podcast. I love this podcast. The way Shankar Vedantam uses science and storytelling is unique. It helps me understand better the hidden behaviors and patterns that we follow without knowing. It is a very good source of self-improvement and learning about how we make our choices and how they affect our relationships.\nMy total listened minutes was 2,231 making me the top 2% fan of Hidden Brain in Spotify. A bit is because I am also going back to old episodes to refresh or just listening to the ones that I missed.\nHere are my favorite episodes:\nPersuasion: Part 1 and Part 2 Happiness 2.0: Cultivating Your Purpose Success 2.0: Getting What You Want Success 2.0: The Psychology of Self-Doubt When to Eat the Marshmallow The Best Years of Your Life How Others See You The Path to Enough Learning From Your Mistakes The Truth About Honesty You 2.0: Your Future Is Now You 2.0: Slow Down! You 2.0: Make the Good Times Last How We Live With Contradictions Outsmarting Yourself The Enemies of Gratitude Healing 2.0: Change Your Story, Change Your Life Here is the image from Spotify Wrapped\nTop 5 podcasts on Spotify Wrapped\nI hope you find this information useful and maybe start following some of the podcasts.\nHappy listening!\n","permalink":"https://luizvieira.me/top-5-podcasts-2023/","summary":"I dedicated an impressive 16,789 minutes to podcasts in 2023. Here are the top 5 podcasts that captivated my ears and mind throughout the year 2023","title":"The top 5 podcasts that captivated my ears and mind in 2023"},{"content":"At home, we are firm believers that we have to consistently invest part of our income every month to have more options and freedom in the future. Having money in the bank brings security and peace of mind, and also, brings a lot of freedom to (and maybe freedom from).\nOur first savings (what would later become investments) were made on the first paychecks around 2009 and since then we have tried to save consistently through the years.\nBut my portfolio changed a lot since we first started, from just savings to total individual stocks to the late all low-cost ETF (of stocks) portfolio. At the current moment, all our investments are in low-cost ETFs. The only cash we have is our Emergency Fund which is not really accounted for in the investments.\nMorgan Housel\u0026rsquo;s Reasoning for Holding Cash But after listening again to the book The Psychology of Money: Timeless Lessons on Wealth, Greed, and Happiness (I read it first in 2020) and hearing that Morgan Housel has 20% in cash, it brought some second thoughts about keeping all stocks.\nHere is where he mentioned the reasoning for keeping the 20% of cash.\n\u0026ldquo;We also keep a higher percentage of our assets in cash than most financial advisors would recommend — something around 20% of our assets outside the value of our house. This is also close to indefensible on paper, and I’m not recommending it to others. It’s just what works for us. We do it because cash is the oxygen of independence, and — more importantly— we never want to be forced to sell the stocks we own.\u0026rdquo;\nAnd here is a nice snippet from the book.\n\u0026ldquo;We’re so far committed to the independence camp that we’ve done things that make little sense on paper. [\u0026hellip;]. But our goal isn’t to be coldly rational; just psychologically reasonable.\u0026rdquo;\nWhy We Are Adding Cash These phrases resonate a lot with our current situation and beliefs. We want to continue to own stocks (via ETF) for the rest of our lives, and for sure, we will face many crises and down periods during our investment life. So if one of these crises happens and the Emergency Fund is not enough (extreme scenarios) we will have safety and will not have to be forced to sell our investments on a low point of the market.\nThe downside is that cash in general yields a lot less than stocks (over the long run) so we will be reducing the growth of the money and our compound rate. But that is the price of the security and peace of mind.\nWe are still not sure about how much cash we want to have in our portfolio, but we don\u0026rsquo;t have to decide now as well. We can slowly build up the cash reserve while we mature the idea more and check to refine the percentage.\nThe goal is not to get it right but to get to a point where we feel more comfortable and safe.\nHappy investing!\nPhoto by Kenny Eliason on Unsplash.\n","permalink":"https://luizvieira.me/cash-portfolio/","summary":"At the current moment, all our investments are in low-cost ETFs. But we decided to add cash to the portfolio and here is why.\u0026quot;","title":"We added cash to the portfolio and here is why"},{"content":" After more than three years of working from home, I’m considering going back to work at the office for most of the weekdays (if not every weekday). While contemplating the idea, I am writing about what I see to be the positive side of working from the office and the positive side of working from home.\nUntil recently, I had a strong opinion about working from home, that working from home was the best decision for me because I\u0026rsquo;m a lot more productive and I also waste a lot less time commuting and in things like dressing up and this kind of stuff. But after reading some articles, and also listening to some podcasts, I had some second thoughts about that which triggered me to start to think more about and that maybe returning to the office was not that bad.\nThe goal of this article is to outline the pros of both going to the office and working from home in my opinion, and with that make a more informed decision on which approach I should take, or even which one to do the most.\nThis is my point of view, and based on my situation. While your situation and priorities can differ, it may be informative for you as well.\n5 positive points about working from home more productivity I feel more productive at home as at home I have fewer distractions and more focus on my own work. Fewer interruptions with things that are not related to my tasks\ntime-saving No getting dressed and commuting. For me, it accounts for around 1 hour and a half each day.\nmoney saving No transportation cost and a cheaper lunch as I like to eat home-cooked (I meal prep on the week for the week). Also, I need less clothes in general.\nmore comfortable Working from home I have less exposure to heat and cold. For example, today here is cold and raining a lot.\nAlso, going to the office in rush hour is sure to see full metro and buses.\nquieter At home it is quiet. No other people in meetings or chitchatting on your side. Also, I can do meetings without noise and private meetings without caring much about what I say. (let\u0026rsquo;s say a 1:1 is a lot easier)\n5 positive points about working from the office better relationships Being surrounded by people creates stronger relationships. Be it a teammate or people from other teams, it is a lot easier to start a conversation and build trust.\nbetter knowledge sharing When you are in the same physical space, it’s easy to check what other people are working on and to ask questions. You sometimes start a simple conversation and things go a lot deeper.\nI move more When I stay at home, I tend to be seated for more time. At the office, I get up and move more. On an office day, I get more than double the steps that I get in a day at home. So I need to spend less time on the gym treadmill.\nmore context separation I work at a desk in my living room, so when I sit at that desk, it feels like work, even if I am doing it during a weekend to write something like this. Also, at home with the computer on the table, it is easy to open the computer to check something about work outside business hours.\nBut working from the office the context separation is a lot better. I don\u0026rsquo;t even unpack the laptop from the backpack.\nmore randomness When I go to the office I am exposed to more things. It\u0026rsquo;s like something random that happens on the way or just a random conversation with someone at the office. For example, I’m writing this line at lunchtime from a bench on the waterfront where I just spotted a seal.\nRandomness can be good or bad, so there\u0026rsquo;s a risk of being exposed to bad ones, like an accident for example. But maybe that is what life is about, chance events. Our brain has an incredible capacity to not remember boring repetitive things.\nSo, summarizing both points, home is more comfortable and productive, while going to the office is more about randomness and relationship building.\nOne question that I like to ask myself when I make decisions like this is: When I am at my deathbed, say like when I am 90 years old, which option would I be happy and proud that I chose? Would I be proud that I delivered a lot of tasks when I was young, or would I be proud of the people that I built relationships with?\nSo, which one is the best for you?\n","permalink":"https://luizvieira.me/work-from-office-or-home/","summary":"Work from home or from the office? Here I share 5 positive points from each for you to better decide","title":"Return to the office or not? Positive points of each"},{"content":" I first heard about the book Four Thousand Weeks: Time Management for Mortals on The Greg McKeown podcast interview with the author Oliver Burkeman and the concepts got me interested.\nLet’s now see more about the book Four Thousand Weeks: Time Management for Mortals.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book Four Thousand Weeks The name of the book comes from the approximate life span of a human. If you live to be eighty years old, you\u0026rsquo;ll have had about four thousand weeks of life. This is a surprisingly short period.\nThe book tries to help us face the fact that our time is very limited and we will not be able to do everything that we want to do in this life, so we have to prioritize, not do some things, live in the moment, or just enjoy the things by what they are not what is the value in the future.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\nYou\u0026rsquo;ll never have time for everything Probably you were already aware of this, (In a way I was), but just being aware and really thinking about it is a different thing. So, the real benefit of this time-conscious perspective is organizing your days with the recognition that there will inevitably be tasks you won\u0026rsquo;t have time to accomplish. So it is a goal that is doomed to fail from the start, so at the very least, you can stop beating yourself up for failing at this impossible task.\nAs we don\u0026rsquo;t have time for everything, we have to make the hard choices of choosing what to prioritize and what is not going to be done. The real difference is that you will now be consciously making the choices of what won\u0026rsquo;t be done and what will.\nBeing efficient is a trap We think that by being more efficient we will be able to do everything we want and need to do, but that is a trap. Increasing your efficiency, whether through the adoption of productivity strategies or pushing yourself harder, typically won\u0026rsquo;t lead to a sense of having \u0026ldquo;enough time.\u0026rdquo; This is because, under similar circumstances, the demands placed on you tend to increase and offset any benefits. Instead of accomplishing more, you\u0026rsquo;ll find yourself generating new tasks to complete and feeling that you still don\u0026rsquo;t have time for everything.\nThe value of your time is not measured by the results We usually tend to measure the value of time with the result that we produce. So if you spend some time and have an output, you tend to feel accomplished. But we shouldn\u0026rsquo;t measure the worth of our time solely by the results. And results are always in the future.\nSo by just striving to live in the moment as a means to an end (a result in the future), you are missing the present moment, which is the only one that you truly have. Embracing the present moment more wholly might be as simple as recognizing that you\u0026rsquo;ve always been left with no alternative but to exist in the here and now.\nWe use leisure as a means to an end The same is true for leisure. We are instructed to rest, but only to rest if it benefits our future productivity. We were taught that if we want to spend our time \u0026ldquo;wisely\u0026rdquo;, any activity that doesn\u0026rsquo;t contribute to some form of future value is inherently considered mere idleness. While relaxation is tolerated, it\u0026rsquo;s only sanctioned if it serves as a means of recuperation for work or, perhaps, as a form of self-enhancement. Enjoying a moment of leisure for its own sake, without any concern for potential future gains, becomes challenging because rest devoid of instrumental value appears wasteful.\nAs the author points out: \u0026ldquo;To rest for the sake of rest \u0026ndash; to enjoy a lazy hour for its own sake \u0026ndash; entails first accepting the fact that this is it: that your days aren\u0026rsquo;t progressing toward a future state of perfectly invulnerable happiness, and that to approach them with such an assumption is systematically to drain our four thousand weeks of their value.\u0026rdquo;\nTime alone is not worth it We like to be the \u0026ldquo;owner\u0026rdquo; of time, we strive to have flexibility and control our schedule. This is good, but if everyone has this control, everyone can have \u0026ldquo;free time\u0026rdquo; at different times than their friends and family.\nHaving an abundance of time is valuable, however, having endless time at your disposal isn\u0026rsquo;t particularly beneficial if you\u0026rsquo;re compelled to go through it in isolation. To accomplish numerous significant tasks with your time – such as socializing, dating, parenting, starting businesses, etc – it must be harmonized with the schedules of others. So time, just by itself, isn\u0026rsquo;t worth it.\nBecause of that, sometimes we must relinquish some of our personal time and flexibility to create more opportunities for meaningful moments with our loved ones.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;This is the maddening truth about time, which most advice on managing it seems to miss. It\u0026rsquo;s like an obstreperous toddler: the more you struggle to control it, to make it conform to your agenda, the further it slips from your control.\u0026rdquo;\n\u0026ldquo;The trouble with attempting to master your time, it turns out, is that time ends up mastering you.\u0026rdquo;\n\u0026ldquo;The technologies we use to try to \u0026ldquo;get on top of everything\u0026rdquo; always fail us, in the end, because they increase the size of the \u0026ldquo;everything\u0026rdquo; of which we\u0026rsquo;re trying to get on top.\u0026rdquo;\n\u0026ldquo;Results aren\u0026rsquo;t everything. Indeed, they\u0026rsquo;d better not be, because results always come later - and later is always too late.\u0026rdquo;\n\u0026ldquo;So it\u0026rsquo;s not simply that our devices distract us from more important matters. It\u0026rsquo;s that they change how we\u0026rsquo;re defining \u0026ldquo;important matters\u0026rdquo; in the first place.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nThe Greg McKeown Podcast #224. The Finitude of Life with Oliver Burkeman Part 1 and Part 2 These are my learnings from the book Four Thousand Weeks: Time Management for Mortals written by Oliver Burkeman. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\n","permalink":"https://luizvieira.me/learnings-book-four-thousand-weeks/","summary":"These are my learnings from the book Four Thousand Weeks: Time Management for Mortals written by Oliver Burkeman","title":"Learnings from the book Four Thousand Weeks"},{"content":"Keeping project dependencies up to date is always a challenge in the companies that I worked for (and I guess in yours as well). Usually, after we build the functionality, we rarely go to the dependency repository to check new versions and update them.\nI can say for me, I only see that happening when people saw that the new version had some new cool feature or when some security scans pointed out that the version that we were using had some kind of vulnerability.\nThis approach has a few drawbacks, the big one being that if we don\u0026rsquo;t update (small updates) frequently when we update, the changes accumulate making it more difficult to do the upgrade. Other drawbacks are manual work checking the dependencies, being reactive in fixing security warnings, etc.\nA better approach in my view is to have the dependencies updated as frequently as possible as with small changes, it becomes easier to update and check the potential problems. I also love automation, so I believe we should automate as much as possible.\nAnd that\u0026rsquo;s where Dependabot gets into the picture. Around 7 months ago, a coworker mentioned Dependabot. Reading the docs, I got hooked up.\nWhat Dependabot Does Dependabot\u0026rsquo;s function is to help us keep the services’ dependencies up to date. It basically analyzes all the service dependencies and checks if there’s a new version. If there are new versions, it creates merge requests to update the specific libraries. It is important to mention that it only creates the MR, but it is up to the developers and service owners to analyze and merge the MRs.\nRunning Dependabot on GitLab As we use GitLab, we don\u0026rsquo;t have the \u0026ldquo;native\u0026rdquo; Dependabot as GitHub has, but fortunately, we have the great work of andrejs who created a GitLab version of Dependabot using the core from GitHub. You can check his GitLab Dependabot here. Basically, he has a Helm chart that you can install and set up your GitLab repositories.\nDependabot pods deployed in Kubernetes\nAfter that, you have to add a YAML file to the repositories that you want to check for dependency updates and register that repository with Dependabot. After that, on the schedule defined by you in the YAML file, you will get MRs with dependency updates.\nYou can check the documentation for more details.\nProbably in the beginning you are gonna get bombarded with a lot of merge requests as probably most of your dependencies are gonna be not up to date. We got a lot. Some were just minor updates but some were major version upgrades that we were like 6 versions behind.\nResults After 7 Months It has been 7 months that we have been running Dependabot and currently, we have it monitoring 35 repositories and we merged more than 1500 Merge Requests with dependency updates. You read that right, a THOUSAND and HALF merge requests created by Dependabot.\nNumber of Dependabot MRs\nIf we consider that a dev would take 10 minutes to open each MR, Dependabot saved more than 250 hours (\u0026gt;30 business days) of tedious work and freed us to do more fun and productive things.\nIt also helps us to merge vulnerability fixes as they are published, and not only when we get an alert for the monitoring tools.\nTo see what changed in each library update, we also added library changelogs to our GitLab release notes.\nHappy updating!\n","permalink":"https://luizvieira.me/dependabot-benefits/","summary":"Keeping project dependencies up to date is always a challenge. Fortunately, Dependabot can help with that.","title":"How Dependabot Keeps Our Dependencies Up to Date"},{"content":" \u0026ldquo;Atomic Habits\u0026rdquo; is one of the most talked-about books in the self-improvement world. I had been hearing about it for ages but kept putting it off, partly because I felt I already knew what it covered from podcast interviews with the author. However, I finally decided to read it, and I am glad I did. In this post, I will share my five key takeaways and how they have shaped my thoughts on building better habits.\nLet’s now see more about the book Atomic Habits.\nLearnings from Atomic Habits The book is a solid introduction to habit formation, though it did not feel groundbreaking to me because I was already familiar with much of the content through other sources. That said, it is an excellent resource for those new to the topic or looking for a clear and actionable guide to habits.\nWhile the subject was not new, in the habits world it is not knowing that makes a difference, it is putting into practice.\nRegarding habit creation, I would say I am average. In my view, I have good ones (I read a lot for example) but also I have bad ones (mostly related to diet). So I found interesting things in the book that I can share here.\nNow, let’s dive into the key lessons I took away from \u0026ldquo;Atomic Habits\u0026rdquo; and how they apply to everyday life.\n1. Little changes matter We often dismiss small changes because they do not produce immediate results. However, as the book highlights, small, consistent efforts compound over time. For instance, saving a dollar a day may feel insignificant, but over a year, it adds up to meaningful progress.\nIf you start following a diet, you will probably see the results in a few months (not days). If you start saving money, you will see results in a few years and decades, not in a few months.\nStart with one small, manageable habit. For example, read one page of a book daily or take a 5-minute walk.\n2. True behavior change is identity change Real change in how you act comes from changing who you are, and your identity. You might begin a new habit because you\u0026rsquo;re motivated, but you\u0026rsquo;ll only keep it up if it becomes a natural part of who you are. As the author says, \u0026quot;\u0026hellip; the process of building habits is actually the process of becoming yourself.\u0026quot;.\nSo in order to have effective change, you have to change who you are and the habits will be a result of that.\nBut identity is a tricky thing. We change over time, so our identity will change as well. So we need to change our identity (and what we want to be) to a flexible one.\nA good example of a flexible identity that was provided in the book is the change from \u0026ldquo;I am an athlete\u0026rdquo; to \u0026ldquo;I\u0026rsquo;m the type of person who is mentally tough and loves physical exercise\u0026rdquo;. The first one is fixed, and as you grow older you can have an identity crisis as for any reason you cannot identify with that identity anymore. But the second one is more flexible and you can use it your whole life.\n3. Don\u0026rsquo;t rely on self-control Trying to exercise self-control is a very expensive task. It burns brain energy and willpower and it makes it easy to fall into the trap. As the author says \u0026ldquo;​​Self-control is a short-term strategy, not a long-term one. You may be able to resist temptation once or twice, but it\u0026rsquo;s unlikely you can muster the willpower to override your desires every time.\u0026rdquo;\nTo make it easy to not fall into temptation, a good approach is to change the environment so we don\u0026rsquo;t have the temptation there in the first place.\nI personally do that with food. I avoid having unhealthy food at home. Sometimes when I am anxious, tedious, frustrated, or any other strong emotion, I tend to go to my cabinets and refrigerator. If I only have healthy food at home, I have no choice of eating unhealthy food as I don\u0026rsquo;t have it.\nPS: This is very similar to the \u0026ldquo;The Ulysses Contract\u0026rdquo;\n4. Any progress is better than no progress Sometimes we feel that if we are not making big progress it is not worth it. But for habit creation that is not true. Doing something is better than doing nothing. Going to the gym for 5 minutes is better than not going at all. Saving 5 dollars is better than saving nothing at all.\nFew sensations are as gratifying as the sense of moving forward and making progress.\nIn summary, \u0026ldquo;Atomic Habits\u0026rdquo; reinforced the importance of small, consistent actions and aligning habits with identity. While much of the content was not new to me, it served as a helpful reminder to stay focused on the basics of habit formation. If you are looking for practical strategies to improve your habits, this book is worth a read. Have you read \u0026ldquo;Atomic Habits\u0026rdquo;? I would love to hear your thoughts or key takeaways in the comments!\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Habits are the compound interest of self-improvement. Getting 1 percent better every day counts for a lot in the long run.\u0026rdquo; \u0026ldquo;Environment is the invisible hand that shapes human behavior.\u0026rdquo; \u0026ldquo;Put another way, the costs of your good habits are in the present. The costs of your bad habits are in the future.\u0026rdquo; \u0026ldquo;This is a continuous process. There is no finish line. There is no permanent solution.\u0026rdquo; \u0026ldquo;Happiness is not about the achievement of pleasure (which is joy or satisfaction), but about the lack of desire. It arrives when you have no urge to feel differently. Happiness is the state you enter when you no longer want to change your state.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book:\nTim Ferriss Show Podcast Episode #648: James Clear, Atomic Habits — Simple Strategies for Building (and Breaking) Habits, Questions for Personal Mastery and Growth, Tactics for Writing and Launching a Mega-Bestseller, Finding Leverage, and More WorkLife with Adam Grant Podcast Episode Building atomic habits with James Clear Ten Percent Happier with Dan Harris Podcast Episode Atomic Habits, James Clear The Peter Attia Drive Podcast episode #183 – James Clear: Building \u0026amp; Changing Habits Liked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-atomic-habits/","summary":"These are my learnings from the book Atomic Habits: An Easy \u0026amp; Proven Way to Build Good Habits \u0026amp; Break Bad Ones written by James Clear","title":"Learnings from the book Atomic Habits"},{"content":"We all have a life philosophy (even if it is not written down), which is a set of beliefs, principles, values, and attitudes that guide and shape our approach to life. Having a life philosophy helps us understand our reality, purpose, morality, and how we should navigate the challenges and experiences that life presents.\nAs having a life philosophy helps us guide our decisions in life, having a professional philosophy helps us make decisions according to our personal preferences and goals. I believe that we have to purposely set and write down our philosophies so we can have a document to check when we are lost and also make us keep track of our changes during life.\nAn important part of the philosophy is that it evolves with time. As we evolve in life and also in our career, we start focusing on different things and we can even totally change our approach to life and career.\nThis document is a set of principles that are part of my software engineering philosophy. I am far from perfect and I struggle with most of them, so they serve to me as a goal, something to aim for. Also, I can change my mind and evolve.\nMy Software Engineering Philosophy Below are a few of the things that I believe and aim to be/do. The list is not exhaustive but brings the most important things.\nSmall updates, more frequently I believe that deploying small changes more frequently is better than deploying big changes less frequently. With small updates, we have a faster feedback cycle and can find more easily which part of the code is not working as expected.\nThere\u0026rsquo;s no environment like production We may try to have staging or environments to mock production, but we will never be able to have that. It is almost impossible to have the same data distribution, usage, and conditions that we have in prod. So, in a way, we need to test in prod.\nThe faster the feedback cycle, the better This is not only about small updates, it is also about the development process. The faster that your code goes from committed to production the better as you can avoid switching context.\nLet the IDE do most of the work Automation is the best friend of the developer and IDEs are getting better every day. So learning how to use the shortcuts, the features, and all that the IDEs provide will help you be more productive and happy.\nAlways leave the code better than you found it I always try to improve the code even if it is not related to the task at hand. If every time we touch the code we make it a little better than we found it, it will improve over time.\nIs it important and urgent? I try (not that I am able) to only work on the tasks that are important AND urgent. If it is only one of both, we could do it later.\nLess code the better If the code is not used, just delete it. The less code that we have, the lesser the need for maintenance. We are not paid by line for the codes that we provide, but the solution that we provide via code.\nWrite things down Writing things down, even if it is only for you helps a lot. We usually work on so many different things that after a few weeks we don\u0026rsquo;t remember almost anything, so writing things down helps us. Also, recording team decisions in ADR-like documents helps the team to know what and why the decisions are being made.\nAlways be willing to help Sometimes it is difficult to balance your own work with helping others, but I always am willing to help. People are more important than code. By helping others, you are leveraging the work. Also, in a few years, you will remember the people you helped (and them you) and not the specific tasks that you were working on.\nOwn the system I believe that we should own the system, not only the tasks that we are working on. Ownership helps us make the system better as we are always striving to improve the whole system, with a high-level view.\nEverything will break, eventually We live in an imperfect world. The things we make break when we least expect them to, so it is important to build systems with a fault-tolerant mindset.\nSummary As said, I use these principles to guide the way I work, but they are not set in stone, so I am always learning and evolving them.\nHope they help you as well.\nPhoto by TheMarketingHustle.com on Unsplash\n","permalink":"https://luizvieira.me/software-engineer-philosophy/","summary":"This document is a set of principles that are part of my software engineering philosophy","title":"My Software Engineering Philosophy: Guiding Principles"},{"content":" I am not a hundred percent sure where I first heard about this book, but most likely it was via the Head of Sales from the Company that I work for. In one of the meetings, he mentioned that it was a required read for the new people on his team. After a few months, I listened to a Chris Voss interview on the Lex Fridman podcast (link at the end of the post) so I got more and more curious about the book.\nLet’s now see more about the book Never Split the Difference: Negotiating As If Your Life Depended On It.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Never Split the Difference The book is really good, it has a lot of examples of situations that demonstrate well the principles in the book. The reading is enjoyable and fun.\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\nFocus on how you say it not only on what you say We usually put a lot of effort into the words that we choose during a conversation and negotiation, but watching for the tone of voice is also important. As the author mentions, \u0026ldquo;There are essentially three voice tones available to negotiators: the late-night FM DJ voice, the positive/playful voice, and the direct or assertive voice.\u0026rdquo; late-night FM DJ voice: Calm, soothing voice used to scale down situations and assert trust and authority. positive/playful voice: builds comfort, rapport, and collaboration. direct or assertive voice: used to assert dominance (but mostly should be avoided).\nPut all the ugly on the table at the start When you have something bad to say or you have a weak point in the negotiation, you should say the worst things about yourself and say them before the other person can. Conducting a proactive accusation audit equips you to proactively address potential issues before they become a problem. Additionally, when these accusations are vocalized, they often appear exaggerated, prompting the other person to assert that the opposite is, in fact, true.\nDon\u0026rsquo;t be afraid of a NO When we are negotiating, we are usually afraid of NOs. But when the person says \u0026ldquo;No\u0026rdquo; it gives them the feeling of safety, security, and control. When you ask a question that leads to a \u0026ldquo;No\u0026rdquo; answer, your counterpart believes that by refusing, they\u0026rsquo;ve established their control. Skillful negotiators actually appreciate and encourage a clear \u0026ldquo;No\u0026rdquo; at the beginning because it shows the other party is actively participating and considering the situation.\nLabel their emotions Rather than rejecting or neglecting emotions, effective negotiators recognize and influence them. It is important to accurately label not only the feelings of others but, crucially, their own.\nLabeling is a method of affirming someone\u0026rsquo;s emotions by recognizing them. When you put a name to someone\u0026rsquo;s feelings, you demonstrate your empathy with their emotional state. This helps you connect with the person without prying into external factors you might not be aware of. As the author says, \u0026ldquo;Think of labeling as a shortcut to intimacy, a time-saving emotional hack.\u0026rdquo;\nAsk \u0026ldquo;How\u0026rdquo; Asking \u0026ldquo;How\u0026rdquo; questions makes the other person hear like a problem to be solved. So asking questions like \u0026ldquo;How am I supposed to do that?\u0026rdquo; makes the other person help you fix your problem. \u0026ldquo;How\u0026rdquo; questions are also open-ended questions, so instead of closing the communication, it opens and expands it.\nSimilar to gentle language such as \u0026ldquo;perhaps,\u0026rdquo; \u0026ldquo;maybe,\u0026rdquo; \u0026ldquo;think,\u0026rdquo; and \u0026ldquo;it seems,\u0026rdquo; calibrated open-ended questions defuse the hostility in a confrontational statement or a closed request that could potentially irritate your counterpart. Their effectiveness lies in their flexibility, as they invite your counterpart to interpret them rather than being explicitly defined. This enables you to present thoughts and requests in a non-imposing or pushy manner.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;But allow me to let you in on a secret: Life is negotiation.\u0026rdquo;\n\u0026ldquo;Remember you\u0026rsquo;re dealing with a person who wants to be appreciated and understood.\u0026rdquo;\n\u0026quot;\u0026lsquo;That\u0026rsquo;s right\u0026rsquo; is better than \u0026lsquo;yes.\u0026rsquo; Strive for it. Reaching \u0026rsquo;that\u0026rsquo;s right\u0026rsquo; in a negotiation creates breakthroughs.\u0026quot;\n\u0026ldquo;While we may use logic to reason ourselves toward a decision, the actual decision-making is governed by emotion.\u0026rdquo;\n\u0026ldquo;As a negotiator, you should strive for a reputation of being fair. Your reputation precedes you. Let it precede you in a way that paves success.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nLex Fridman Podcast Episode #364 – Chris Voss: FBI Hostage Negotiator Huberman Lab Podcast Episode Chris Voss: How to Succeed at Hard Conversations These are my learnings from the book Never Split the Difference: Negotiating As If Your Life Depended On It written by Chris Voss with Tahl Raz. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-never-split-difference/","summary":"These are my learnings from the book Never Split the Difference: Negotiating As If Your Life Depended On It written by Chris Voss with Tahl Raz","title":"Learnings from the book Never Split the Difference"},{"content":" I have been working with scalable systems for a few years already but all the knowledge that I got was from experience and also reading articles but not books so my goal when I was reading this book was to review the basic knowledge and see if I missed some basic knowledge.\nThis post of Learning is from a technical book, so it may be a bit different than the other posts of the collection Learnings from books, as when I read technical books I focus more on the parts that I looking to learn and for my current situation.\nLearnings from the book Foundations of Scalable Systems As the name implies, the book brings the foundations of designing scalable services talking about service design, caching, asynchronous messaging, serverless processing, microservices scalable data systems, and scalable streaming systems.\nIf you are new to the Scalable Systems world, it is a good read, if you already have experience in the area some parts will be just a review for you.\nThe book has a lot of learnings, but to not be too long a post, I will share my 5 most important learnings from the book.\nFocus on hyper-scale systems When designing scalable systems, we should focus on systems that are characterized by the ability to expand exponentially, with costs increasing linearly. The book brings an excellent definition: “Hyper scalable systems exhibit exponential growth in computational and storage capabilities while exhibiting linear growth rates in the costs of resources required to build, operate, support, and evolve the required software and hardware resources.”\nSo, when thinking about new functionalities, balance achieving the performance and scalability you require, while also keeping your costs as low as possible.\nCache is king An effectively designed caching strategy proves invaluable when it comes to scaling a system. Caching is particularly effective for data that experiences infrequent changes but sees frequent access, such as inventory catalogs, event details, and contact information.\nIn the realm of scalability, distributed caching is a fundamental component. This caching approach allows the reuse of results from costly queries and computations in subsequent requests at a minimal cost. By avoiding the need to reconstruct cached results for every request, the system\u0026rsquo;s capacity is enhanced, enabling it to scale effectively to handle increased workloads.\nIdempotence is important When handling errors, we need a way to retry without generating duplicated results, for that one of the best ways is to make the API idempotent.\nThe standard methodology for constructing idempotent operations involves several key steps:\nClients incorporate a distinct idempotency key into all requests that induce state changes. This key serves to uniquely identify a particular operation originating from a specific client or event source. Typically, it consists of a combination of a user identifier, such as a session key, and a unique value such as a local timestamp, UUID, or sequence number.\nUpon receiving a request, the server verifies whether it has encountered the idempotency key value before by querying a specialized database designed for implementing idempotency. If the key is not present in the database, it signifies a new request. Consequently, the server executes the requisite business logic to update the application state. Additionally, it records the idempotency key in the database to signify the successful application of the operation.\nIf the idempotency key is found in the database, it indicates that the current request is a retry from the client and should not be processed anew. In such cases, the server issues a valid response for the operation, with the expectation that the client will refrain from further retry attempts.\nFail fast Cascading failures pose a subtle threat, stemming from their initiation through the gradual deterioration of response times in dependent services. In contrast to the immediate error notifications received when a downstream service crashes or becomes temporarily unavailable due to network issues, the insidious aspect arises when services experience a gradual slowdown. Requests still yield results, albeit with prolonged response times. If the besieged component remains inundated with requests, it lacks the necessary time to recover, perpetuating the growth of response times.\nThe fundamental issue with sluggish services lies in their prolonged utilization of system resources for requests. As a requesting thread awaits a response, it remains stalled for extended durations. Extended response times not only pose technical challenges but also negatively impact client engagement.\nThat is why it is important to fail fast, as things don\u0026rsquo;t get clogged.\nBuilding a distributed system is hard The inherent complexity of distributed systems stems from their multifaceted nature, encompassing various failure modes that demand thorough consideration and strategic design to effectively navigate all possible scenarios. This complexity is further compounded when applications face heightened demand with substantial request volumes and rapidly expanding data resources.\nThese are my 5 most important learnings from the book Foundations of Scalable Systems: Designing Distributed Architectures written by Ian Gorton\nHappy coding!\n","permalink":"https://luizvieira.me/learnings-book-foundations-scalable-systems/","summary":"These are my learnings from the book Foundations of Scalable Systems: Designing Distributed Architectures written by Ian Gorton","title":"Learnings from the book Foundations of Scalable Systems"},{"content":"One of the things that I most admire about nature in Canada is the change in the landscape between seasons. It is very nice that each season is distinctly different from the other.\nComing from a tropical country, I haven\u0026rsquo;t seen this much difference, our trees didn\u0026rsquo;t get orange colors in autumn, we didn\u0026rsquo;t have snow there, and so on.\nDue to this, I loved to see the colors change and I wanted to capture these changes in a timelapse. From June 2022 to June 2023 I took a photo every day at around 12PM from my balcony to create the timelapse that we see below.\nIn it, we can see the colors going from green to orange (maple trees) after losing all the leaves. Here in Vancouver, the snow is light and very short (thankfully) so we can see only a few seconds of snow. And then we can see the colors of the spring and finally, the trees getting back the green color.\nOne thing that was not intentional but anyway nice, it is that during the one-year period, one of the houses in the view was taken down and another one was rebuilt in the place, you can see the whole process in the timelapse.\nI also made a time-lapse of my first garden.\n","permalink":"https://luizvieira.me/vancouver-seasons-timelapse/","summary":"One of the things that I most admire about nature in Canada is the change in the landscape between seasons. This post shares a timelapse of these changes","title":"One year in 15 seconds:  4 Seasons Timelapse of Vancouver"},{"content":"My wife (May) and I recently went camping for the first time in the Canadian Rocky Mountains with a group of friends from our hiking group. We were 11 in total and stayed for 6 nights. In this post I will share a bit of the highlights and what we did in these 8 days in the Canadian Rockies.\nWe divided our 6 nights stay into two, staying 3 nights in the Wapiti Campground in Jasper National Park and the other 3 nights at Lake Louise Soft-Sided Campground in Banff National Park.\nJasper National Park This was the first stop, 3 nights.\nGetting to Jasper National Park We drove from Vancouver to Jasper National Park. The road is really good and also very scenic. I liked to listen to the Guide Along app guides, which have very nice (nerdy) information about the road, history, and everything.\nWe stopped at Kamloops for restaurants and groceries as it is one of the biggest cities on the way.\nWapiti Campground Wapiti Campground is really nice. It has a few trees which can be bad on a hot day, but it has a nice view of the mountains around.\nIt is also not fenced, so we had the privilege of seeing some elks walking in the middle of the campground while we were there. They were not bothered at all by the humans there.\nOur tent in Wapiti Campground with sunrise view\nBest in Jasper National Park What I liked more about Jasper National Park was the wildlife. We saw many elks, many marmots (calling Steve), a mamma black bear with a cub, and even a moose which was very far away.\nElk alongside the road in Jasper\nWhat we visited in Jasper National Park We visited the Maligne Lake and there we did two hikes, the Opal Hills Short Loop and Maligne Lake Viewpoint which was easy because we did most of the way on the other hike. It was during these hikes that we saw a lot of marmots and also a moose from far away. On the way back we saw a lot of elks as well. We had much closer moose sightings later in our 5 days in Alaska.\nWe also visited Pyramid Lake and I tried to paddle board there. Unfortunately, I fell into the water losing my new sunglasses, and also my Fitbit Charge 5 stopped working, even though it was supposed to be waterproof.\nWe also went close to the Mount Edith Cavell. We didn\u0026rsquo;t do the hike, as it was pouring rain but we got close to the pond and were able to enjoy the glacier view. Later, in our 9-day Iceland Ring Road trip itinerary in May, we had a different glacier experience with ice meeting water much more directly.\nBanff National Park Here we stayed for 3 nights as well.\nGetting to Banff National Park We went from Jasper to Banff via the very scenic Icefields Parkway. Despite this being a relatively quick drive, we took our time and explored a few attractions that there are on this road.\nWe stopped at Athabasca Falls, Sunwapta Falls, Columbia Icefield, Peyto Lake \u0026amp; Bow Summit, and a few other random stops. You can see the main stops along the way here.\nLake Louise Soft-Sided Campground The Lake Louise Soft-Sided Campground is very different from the Wapiti Campground. This one is fenced and it has a lot of trees. You basically feel that you are in a forest. This one also has a river very nearby which is in itself very nice.\nLake Louise Campground\nBest in Banff National Park The thing that I liked the most in Banff National Park was the lakes (mainly Louise and Moraine), each one has its own beauty and the high mountain views. Moraine Lake has a kind of blueish color.\nMoraine Lake\nWhile Lake Louise has a turquoise-like color.\nLake Louise\nWhat we visited in Banff National Park As it was our first time camping (in the last 10 years), we were a bit tired, so we took a day to just chill on the camping ground and nearby things.\nBut the other day was busy, we went to Moraine Lake and Lake Louise via the Shuttle as it is the easiest way possible. In Lake Louise, we did a very small hike (Fairview Lookout) just to have a high view of the lake.\nWe also visited the charming Banff Town, which has an incredible view of Cascade Mountain.\nThe best about the trip One of the best things about the whole camping experience was being around the campfire with friends. We set a campfire every night and stayed talking, laughing, and drinking around the fire. The cold weather was bad for other things, but it was nice as everyone wanted to stay around the fire to get warm.\nSitting around the campfire\nAnother very nice thing was cooking outdoors. May and I like to cook and it was very nice to be cooking outside with a mountain view and also in the middle of the forest at the other camping site. In Wapiti we had an opportunity to see an elk passing by when we were cooking. We also took the challenge to make dinner for everybody in one day. It was hard but it was really nice to share a meal with everybody at the same time (other times each carpool did its own dinner).\nThe nature is amazing. The wildlife, the mountains, and the lakes are unique! We definitely want to go back more times.\nThe challenge in the trip I think the biggest challenge was the rain. It was rainy for like 4 out of the 6 days so it was hard to cook at the camping site and also it was hard to visit places.\nAnother small challenge was the cold. It got pretty cold on some days, like 4°C during the night. We were a bit prepared for it, but it was challenging anyway.\nAlso, organizing 11 people is not an easy task. Even though we were divided into 3 groups (3 cars), people have different waking up time preferences and also eating preferences. 11 people is a lot for being our first time.\nLearnings and tips Some learnings during this trip: Be prepared for all types of weather 6 nights is a lot for the first camping trip Traveling with 11 people is very nice, but it is also challenging. I loved the audio tours of the Guide Along app, but my carpool didn\u0026rsquo;t (have a headphone) Have a shared playlist. We had 4 people with different musical tastes and we combined all in one playlist\nNerdy details about the camping trip I mentioned before that we went in 11 people. We were divided into 3 cars (SUVs). Two cars had 4 people and the other had 3. Every carpool was responsible for its own food and they shared the travel cost (gas, groceries, etc).\nWe used the app Splitwise for sharing the trip costs and we created a group there with 11 people.\nFor Lake Louise and Moraine Lake, the best way is to get a Shuttle from Parks Canada. It costs $8 per person and you can book it starting at 8 AM two days prior. They also have a last minute that opens at 8 AM on the current day. We kept searching while we were there and we were able to get the tickets for all the people.\nThe whole trip from Vancouver to Jasper, Banff, and back to Vancouver we drove 2,325 KM.\nFor a quieter getaway in BC, see our stay in a cozy log cabin by Ruth Lake.\n","permalink":"https://luizvieira.me/canadian-rocky-mountains-camping-trip/","summary":"My wife (May) and I recently went camping for the first time in the Canadian Rocky Mountains with a group of friends from our hiking group.","title":"Canadian Rockies Camping Trip: Jasper and Banff in 6 Nights"},{"content":"At the company that I work for (FISPAN), we recently had an internal Mentorship program that offered employees the opportunity to participate either as mentors or mentees, supporting the growth of fellow professionals. Opting to be a mentee, I was fortunate to be paired with Aleksey, who is the Head of Architecture at FISPAN.\nThe mentorship with Aleksey provided an invaluable opportunity to learn from his extensive experience and gain insights into his approach to work. I am tremendously grateful to Aleksey for generously sharing his time and knowledge with me. Thank you, Aleksey! \u0026lt;3\nThroughout our mentorship, we discussed various important topics and made significant progress. I have experienced significant personal and professional growth during this time.\nUnveiling the 3 Most Significant Learnings From all the valuable insights gained during the mentorship, I carefully handpicked the three most impactful and essential learnings that I incorporated into my professional journey.\nTaking more ownership Taking ownership entails a commitment to giving your best effort and taking full responsibility for successes and failures without blaming others. It involves continuously seeking improvement, seeking knowledge, exploring avenues for enhancement, and offering guidance, strategies, and any other resources necessary to ensure the success of the tasks at hand.\nDuring the mentorship, I read the book [Extreme Ownership: How U.S. Navy SEALs Lead and Win] as recommended by Aleksey. A really good and insightful read!\nPush back on what you don\u0026rsquo;t agree with It is essential not to readily accept things that you disagree with solely based on the authority of the person conveying them. Instead, politely challenge such viewpoints, directing the discussion towards the subject matter rather than personal differences. Pushing back in a respectful manner allows for personal growth, broadens your perspective, and enables you to consider viewpoints that may have been previously unseen.\nFurthermore, the act of pushing back when you don\u0026rsquo;t agree signifies a genuine interest and investment in the subject under discussion. It demonstrates that you care about the topic and are actively seeking a deeper understanding. Conversely, individuals who remain silent or readily agree often indicate a lack of concern or investment in the subject.\nAlways try to understand why we are doing it One significant takeaway from our meetings was recognizing my tendency towards an action bias. I realized that I often dive into tasks without fully understanding their purpose or expected outcomes. This insight prompted me to reflect on the importance of comprehending the \u0026ldquo;why\u0026rdquo; behind each action I take.\nMoving forward, I aim to approach tasks with a greater focus on understanding their intended results. By doing so, I can align my efforts more effectively, ensuring that my actions are purposeful and contribute meaningfully towards achieving desired outcomes.\nAfter starting the mentorship, I became much more conscious about understanding \u0026ldquo;why\u0026rdquo;. Also, following the mantra of my manager Anubhav, I ask myself a few questions: Why do I need to do this? (what is the desired outcome) Why now? (what is the urgency)\nAs Anubhav says, it has to be important AND urgent. If it is one or the other, we shouldn\u0026rsquo;t do it now.\nThese were the three most significant learnings I gained from the mentorship program. I am immensely grateful to Aleksey for generously sharing his knowledge, experience, and time with me!\nI also shared how I prepare for job interviews in my interview preparation guide for software engineers.\nPhoto by Simon Abrams on Unsplash\n","permalink":"https://luizvieira.me/insights-from-mentorship-key-learnings/","summary":"The mentorship with Aleksey provided an invaluable opportunity to learn from his extensive experience and gain insights into his approach to work","title":"Insights from Mentorship: Three Key Learnings"},{"content":" This book Excellent Advice for Living is really different from all others that I read this year. It is basically a collection of some things that the author learned about life that he wished he had known earlier. The book has no structure, it is just a collection of snippets of knowledge.\nLearnings from Excellent Advice for Living: Wisdom I Wish I\u0026rsquo;d Known Earlier As the book does not tell one story but a lot of random things, in this post I am also going to do something different from the other posts from the Learning from Books series I am going to share the 5 pieces of advice that I liked the most.\n\u0026ldquo;If you are not falling down occasionally, you are just coasting.\u0026rdquo;\n\u0026ldquo;A vacation + a disaster = an adventure.\u0026rdquo;\n*\u0026ldquo;Curiosity is fatal to certainty. The more curious you are, the less certain you\u0026rsquo;ll be.\u0026rdquo;\n\u0026ldquo;Writing down one thing you are grateful for each day is the cheapest possible therapy ever.\u0026rdquo;\n\u0026ldquo;Your behavior, not your opinions, will change the world.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nTim Ferriss Show Podcast Episode #669: Kevin Kelly — Excellent Advice for Living: Kevin Kelly helped launch and edit Wired magazine. He has written for The New York Times, and The Wall Street Journal, among many other publications. The Knowledge Project with Shane Parrish Episode #166 Kevin Kelly: Excellent Advice for Living: When Kevin Kelly turned 68 years old, he began writing down notes and thoughts about all the lessons he’d learned in his life and the ones he wished he’d learned earlier. While those notes were originally intended for his young adult children, they eventually became the book Excellent Advice for Living: Wisdom I Wish I\u0026rsquo;d Known Earlier, which was released in May 2023. These are my favorite pieces of advice from the book Excellent Advice for Living: Wisdom I Wish I\u0026rsquo;d Known Earlier written by Kevin Kelly. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-excellent-advice-for-living/","summary":"These are my learnings from the book Excellent Advice for Living: Wisdom I Wish I\u0026rsquo;d Known Earlier written by Kevin Kelly","title":"Learnings from the book Excellent Advice for Living"},{"content":" I have been following Seth Godin for a while now, but mainly in his podcast Akimbo. Usually, I like his ideas and questions. When I heard that he published a new book Song of Significance: A New Manifesto for Teams, I was curious and interested. After reading, these are the main learnings.\nLet’s now see more about the book Song of Significance: A New Manifesto for Teams.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Song of Significance The author calls the book a manifesto, it is basically a summary of the author\u0026rsquo;s view related to work, teams, and making a difference. If you listen to Akimbo, one of his podcasts, you are going to see many topics in common.\nThe book compares industrialism work (the cog in the system) with work that makes a difference, work that changes the world or just changes us. Work with significance.\nA nice quote from the book is: \u0026ldquo;Each of us can show up in our own way, but the choice is the same: to lead, to create work that matters, and to find the magic that happens when we are lucky enough to co-create with people who care. We can do well and do better at the same time. In fact, it\u0026rsquo;s the only useful way forward. We can create the best job someone ever had, the best experience any customer can imagine.\u0026rdquo;\nThe book is full of learnings, but to not be a too-long post, I will share the 5 most important learnings from the book.\nWorkers want agency and dignity Once people have their basic needs covered, they know exactly what they\u0026rsquo;re after in a job. It\u0026rsquo;s not about extra stock options or a fancier office. It\u0026rsquo;s much more fundamental: agency and dignity.\nHaving agency means having control over our time and the freedom to decide how we contribute. Since it involves responsibility and a bit of authority, agency goes against the idea of tightly controlled industrial tasks.\nDignity comes with agency, enabling us to be treated as people, not just as parts of a machine. It means getting respect for what we do and being treated with as much kindness as the circumstances permit.\nAvoid false proxies When measuring work, we should try to really measure the work, not the false proxies, like hours, for example.\nThings that are straightforward to measure are usually not the most crucial and sometimes are not even important. However, it\u0026rsquo;s the easy-to-measure aspects that often take the spotlight. This includes personal charm, the number of hours put in, the rapport with the boss, and, of course, visible errors compared to a consistent lack of extra effort.\nTension is not the same as stress Stress is the unpleasant sensation of desiring two conflicting things simultaneously. It\u0026rsquo;s the push-pull of wanting to stay and leave, speak up and hold back, or complete one task while needing to finish another. Stress interferes with our well-being, making it challenging to experience flow, joy, or a sense of significance.\nOn the other hand, tension is the feeling that propels us forward. It\u0026rsquo;s an indicator of the resistance described by Pressfield. Tension could manifest as a countdown, a deadline, or a budget. It\u0026rsquo;s the dynamic process of unraveling a riddle or answering a question that opens up new possibilities.\nSignificant organizations are team-centric The goal of a significant organization is to effect change and achieve this alongside a community of individuals passionate about making a difference. This is why having committed team members is far more valuable than merely providing a convenient workplace.\nAs the book puts it very well, \u0026ldquo;The purpose of a beehive isn\u0026rsquo;t to make honey: honey is a by-product of a healthy hive. A significant organization can please its customers and make a profit as well. But it begins by earning enrollment and then doing the work to make change happen.\u0026rdquo;\nIt is up to us It is up to us to care, to show up, lead, to create work that matters, and to discover the enchantment that arises when we are fortunate enough to collaborate with individuals who genuinely care about the work to be done.\nWe need to make commitments and to keep them. To be courageous, to be open to be uncomfortable in order to make a difference. We need to create the conditions for people who care to do work that they\u0026rsquo;re proud of.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Measuring the easy thing is the easy thing.\u0026rdquo;\n\u0026ldquo;No grades, no check marks, no badges. I\u0026rsquo;m not in charge of you, and I\u0026rsquo;m not manipulating you. I\u0026rsquo;m simply establishing the conditions for you to get to where you said you wanted to go.\u0026rdquo;\n\u0026ldquo;Real value is no longer created by traditional measures of productivity. It\u0026rsquo;s created by personal interactions, innovation, creative solutions, resilience, and the power of speed.\u0026rdquo;\n\u0026ldquo;The revolutions begin at the edges but ultimately end up changing whatever they interact with.\u0026rdquo;\n\u0026ldquo;Encouraging employees to keep their LinkedIn profiles and resumes up to date ensures that they are part of the team voluntarily, not because they believe they have no options.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nAkimbo Podcast These are my learnings from the book Song of Significance: A New Manifesto for Teams written by Seth Godin. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-song-of-significance/","summary":"These are my learnings from the book Song of Significance: A New Manifesto for Teams written by Seth Godin","title":"Learnings from the book Song of Significance"},{"content":"If you\u0026rsquo;re someone who strives for excellence, much like myself (which is probably the case by your interest in reading this post), you establish your goals or purposes and work towards accomplishing them. But as you may know, the true challenge does not lie in setting these aspirations, but in actually training to achieve them.\nA similar scenario unfolds when we attempt to alter our behavior or make adjustments to our current actions. We have an understanding of what needs to be changed, yet life happens and we get stuck, forget, and end up with no substantial progress or transformation.\nA technique that I have discovered to enhance the practical aspect of behavior change and prioritize what truly matters to me is through the utilization of Daily Questions. Which I initially came across in the book The Earned Life by Marshall Goldsmith.\nThe Daily Questions aim to address the common issue many of us face: having good intentions for making changes but struggling with their execution. As the author says. \u0026ldquo;We are superior planners and inferior doers.\u0026rdquo;\nHowever, what exactly are the Daily Questions? They consist of a set of inquiries that you ask yourself when you desire to make a change in your life, and you answer them on a daily basis. The crucial aspect is that when responding to these questions, you focus not on measuring the outcome, but on evaluating the effort you have invested in pursuing that change.\nAs the author says: \u0026ldquo;The key: Each question begins with \u0026ldquo;Did I do my best to ..\u0026rdquo; followed by a specific goal such as \u0026ldquo;Set clear goals?\u0026rdquo; and \u0026ldquo;Exercise?\u0026rdquo; and \u0026ldquo;Not waste energy on what you cannot change?\u0026rdquo;\u0026rdquo;\nThe crucial aspect is to engage in this practice every single day, as it serves as a reminder of the things that hold greater significance to you. By doing so, you establish a short feedback loop and create a sense of personal accountability.\nHow do I do it? I will provide the daily questions shortly, but for now, I\u0026rsquo;d like to share my personal approach as an idea for you. Keep in mind that it\u0026rsquo;s essential to discover the method that works best for you.\nI personally use the notetaking app called Obsidian, as a Software Engineer, I like to play around with markdown and also I like the way the app works. The Obsidian app has a Daily Note and you can create a template so every day it creates a copy of the template. So I put there the questions and every day I see them and reply from 1 to 10 what was my effort (Did I do my best?) for that specific question.\nBut you can use any notetaking app, or a spreadsheet if you want to compare your effort as you progress. For me I don\u0026rsquo;t make averages or check past results, it is more like a daily reminder of what is important for me and what I have to focus on.\nWhat are my Daily Questions? In the book The Earned Life Marshall shows some examples of questions. I started with some example questions but in these three months that I have been doing this, I have changed the list to reflect my personal purposes.\nWhile certain questions may prove beneficial to you, feel free to eliminate any that don\u0026rsquo;t resonate with you, and incorporate ones that hold personal significance. Customize the list according to your own needs and priorities.\nDid I do my best to be healthy? Did I do my best to be happy? Did I do my best to be fully engaged? Did I do my best to be a better husband? Did I do my best to build positive relationships? Did I do my best to have a good work/life balance? Did I do my best to simplify things? Below is a short explanation of each question\nDid I do my best to be healthy? I prioritize healthspan over just lifespan. My goal is to not only live a long life but also maintain good health throughout. So, this serves as a daily reminder for me to be mindful of my dietary choices and engage in regular exercise.\nDid I do my best to be happy? I firmly believe that we must be intentional in pursuing the things we desire, and this includes happiness. Therefore, it is important for me to be reminded each day to cultivate gratitude, steer clear of anger, embrace tranquility, and prioritize happiness.\nDid I do my best to be fully engaged? Often, I\u0026rsquo;ve caught myself being mentally absent and distracted while in the presence of others. Sometimes having dinner with my wife I was distracted by Googling nonsense that could wait or when meeting with friends I was on social media instead of being with them. Or even in the meetings at work when I was doing something else instead of paying attention to the presenter.\nSo now I am deliberately trying to be present in the moment, with the people that I am with.\nDid I do my best to be a better husband? Marriage involves the commitment to share your entire life with another person. Recognizing that you contribute 50% to the equation, striving to become a better spouse not only enhances the marriage but also improves your overall quality of life.\nI try to ask every day what I can do to be a better husband.\nDid I do my best to build positive relationships? Nurturing strong friendships necessitates intentional effort. It involves regularly checking in on friends, providing support, and dedicating quality time to be with them.\nDid I do my best to have a good work/life balance? I often find myself working more than necessary, especially when faced with problems to solve or challenges to overcome. So, I make a conscious effort to remind myself to limit work to designated hours and refrain from thinking about work-related issues outside of those hours.\nDid I do my best to simplify things? I believe in the principle of simplicity. There was a time when my portfolio consisted of around 90 different stocks. But why complicate things unnecessarily? Now, I have simplified it to just one index, and I feel much more at ease. Additionally, I have streamlined my financial obligations by setting up direct debit for all bills (excluding rent). This is an example of how I am actively simplifying my life.\nSummary Don\u0026rsquo;t be alarmed if this post turned out longer than expected. The key is to begin with just one or two questions and respond daily by assigning a rating from 1 to 10, indicating how well you did your best. Over time, you can gradually add more items or even remove ones that you feel no longer require a reminder. Flexibility and adaptability are essential in this process.\nLife is a long game, but it is played day by day.\nPhoto by Towfiqu barbhuiya on Unsplash\n","permalink":"https://luizvieira.me/daily-questions/","summary":"The Daily Questions aim to address the common issue many of us face: having good intentions for making changes but struggling with their execution","title":"How I Use the Daily Questions to Focus on What Matters"},{"content":" Without a doubt, this book has secured its place among my top reads this year, and considering the numerous books I have devoured, that\u0026rsquo;s saying something. Quit: The Power of Knowing When to Walk Away is the second book from Annie Duke that I have read, the first one was Thinking in Bets which is also great.\nLet’s now see more about the book Quit.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Quit: The Power of Knowing When to Walk Away The primary objective of the book is to challenge and transform the negative perception associated with quitting, highlighting instances where it is indeed the most optimal course of action. By shedding light on various biases that often compel us to persist in unproductive situations, the book emphasizes our tendency to avoid using the term \u0026ldquo;quit\u0026rdquo; due to societal judgments.\nUltimately, when we remove the negative connotations, quitting simply becomes the decision to conclude something that was previously initiated.\nGrit vs Quit Grit possesses an intriguing duality. While it can drive us to persevere in challenging endeavors that hold value, it can also bind us to arduous pursuits that have lost their worth. The key lies in discerning the distinction. While goals provide a foundation for resilience, grit does not always equate to virtue. As you are well aware, grit proves invaluable in persevering through worthwhile hardships, but it can also trap us in futile struggles.\nIn essence, the decision to quit and the embodiment of grit are two sides of the same coin. Numerous demanding endeavors warrant our pursuit, and grit empowers us to endure when it is appropriate. However, countless challenges are unworthy of our continued investment, and the ability to walk away at the right moment is a skill worth cultivating.\nWe avoid the word Quit Although grit is commonly praised as a virtue, quitting is often regarded as a vice. As a result, we tend to steer clear of using the word \u0026ldquo;quit\u0026rdquo; and instead resort to various euphemisms such as \u0026ldquo;starting a new chapter\u0026rdquo; or \u0026ldquo;pivoting.\u0026rdquo;\nExpected value as a framework In order to make an informed decision between sticking with a pursuit or quitting, it is crucial to assess the likelihood of favorable outcomes and unfavorable outcomes. This assessment enables you to determine if the positive outcomes are frequent enough to justify persevering on your current path.\nThe concept of expected value (EV) serves as a valuable tool in addressing two important questions. Firstly, it provides insight into whether a particular option under consideration will, overall, bring positive or negative outcomes in the long run. Secondly, it allows for a comparison of different options to identify the optimal choice, with the better choice being the one that yields the highest expected value.\nAdopting a mindset of expected value analysis aids in evaluating the viability of the current path you\u0026rsquo;re pursuing. Expected value extends beyond monetary considerations and encompasses measures of health, well-being, happiness, time, self-fulfillment, satisfaction in relationships, or any other factors that impact your life.\nWhen faced with a situation where the decision between persisting and quitting appears closely balanced, it is often an indication that choosing to walk away is the wiser option.\nAvoid escalation of commitment In times of experiencing losses, our inclination to persist with a failing course of action not only increases but often leads us to intensify our efforts. This behavioral tendency is commonly referred to as \u0026ldquo;escalation of commitment.\u0026rdquo;\nEscalation of commitment is a prevalent and enduring phenomenon observed across individuals, organizations, and governmental entities. Once we embark on a particular course of action, we tend to become trapped in it, particularly when confronted with unfavorable outcomes. This inclination to stay the course persists despite mounting evidence suggesting the need for a change.\nIt is worth noting that escalation of commitment is not exclusive to high-stakes situations. It can manifest even when the stakes are relatively low, highlighting the widespread nature of this cognitive error. Our propensity to double down on a failing endeavor, regardless of its significance, underscores the pervasive influence of escalation of commitment in our decision-making processes.\nWork on the hardest thing first The \u0026ldquo;Monkeys and Pedestals\u0026rdquo; mental model serves as a tool to facilitate timely quitting.\nPedestals represent the aspects of a problem that you are already capable of solving, such as designing a flawless business card or logo. The real challenge lies in training the monkey.\nWhen confronted with a complex and ambitious goal, it is important to (a) identify the most difficult aspect; (b) focus on solving that challenge promptly; and (c) remain cautious of false progress.\nBy applying this mental model, you can prioritize tackling the toughest parts of a problem, enabling you to quit sooner when necessary.\nHave a kill criteria Before embarking on a particular endeavor, it is crucial to establish a set of kill criteria. These criteria serve as a predefined list of signals or indicators that will inform you when it\u0026rsquo;s time to quit.\nBy creating kill criteria, you can protect yourself from making poor decisions while fully immersed in a pursuit. They act as a safeguard by reducing the number of decisions you need to make once you find yourself already experiencing progress or setbacks.\nEstablishing clear kill criteria in advance equips you with a proactive framework that assists in avoiding prolonged commitment to unproductive endeavors. It helps you make informed decisions and facilitates a more efficient evaluation of when it is appropriate to quit.\nThe endowment effect The endowment effect refers to our tendency to place a higher value on items we own compared to identical items we do not own. This cognitive bias influences our perception of value.\nIn the context of quitting behavior, the endowment effect holds relevance. Selling something we own is akin to quitting, as it involves relinquishing ownership. On the other hand, choosing not to sell reflects persistence in maintaining ownership. When deciding whether to sell possessions like wine, a car, or a house, we are essentially determining whether to continue owning those items.\nThe endowment effect and sunk cost fallacy intertwine, amplifying the escalation of commitment. Additionally, the presence of status quo bias further compounds the cognitive forces at play, impacting decision-making.\nYour identity is not what you do When our identity becomes closely intertwined with our actions, abandoning what we do becomes challenging because it feels like quitting a part of who we are.\nIdentity plays a significant role in our lives, as we all strive to maintain a positive self-narrative. We desire to hold ourselves in high regard, believing in our consistency, rationality, and the accuracy of our beliefs about the world.\nQuitting becomes particularly difficult when it threatens our sense of self. Our ideas, beliefs, and actions form an integral part of our identity, making them the most painful aspects to let go of when considering quitting.\nHave a backup plan Having a diversified portfolio is essential for safeguarding against uncertainty. It provides a layer of protection and helps mitigate risks. Similarly, having backup plans in various aspects of life is beneficial, as sometimes these alternative paths can turn out to be more advantageous than our current pursuits.\nEven if you have no immediate intention of changing jobs, it is advisable to answer recruiting calls and explore potential opportunities. Maintaining a backup plan ensures that you are prepared for unexpected changes or opportunities that may arise. It is always wise to have a contingency plan in place.\nThe dark side of goals While goals can be empowering, they also have a downside. The binary nature of goals, with their pass-fail distinction, can hinder progress, lead to escalation of commitment, and prevent us from acknowledging the incremental successes we achieve along the way.\nUndoubtedly, goals serve as potent tools that enable us to accomplish worthwhile endeavors. However, it is important to recognize that the mere presence of a goal can trigger escalation of commitment. This can result in persisting with a goal even when it is no longer the most effective or optimal path to achieve our desired outcomes.\nRedefine failure The fear of failure and the perception of wasted time, effort, or money often surround the act of quitting.\nIt is crucial to redefine our understanding of \u0026ldquo;failure\u0026rdquo; and \u0026ldquo;waste.\u0026rdquo; When we contemplate quitting, it is essential to ask ourselves what exactly we would be failing at. If we choose to quit something that is no longer worth pursuing, it should be considered a success rather than a failure.\nTo move forward, we must redefine our notions of failure and waste. However, the ultimate goal should be to rehabilitate the concept of quitting itself. By shifting our perspective and embracing quitting as a strategic decision-making tool, we can unlock its potential and recognize its value in our personal and professional journeys.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Persistence is not always the best decision, certainly not absent context. And context changes.\u0026rdquo;\n\u0026ldquo;Success does not lie in sticking to things. It lies in picking the right thing to stick to and quitting the rest.\u0026rdquo;\n\u0026ldquo;Having the option to quit helps you to explore more, learn more, and ultimately find the right things to stick with.\u0026rdquo;\n\u0026ldquo;Success means following a good decision process, not just crossing a finish line, especially if it is the wrong one to cross.\u0026rdquo;\n\u0026ldquo;Don\u0026rsquo;t just measure whether you hit the goal, ask what you have achieved and learned along the way\u0026rdquo;\nThese are my learnings from the book Quit: The Power of Knowing When to Walk Away written by Annie Duke. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\n","permalink":"https://luizvieira.me/learnings-book-quit/","summary":"These are my learnings from the book Quit: The Power of Knowing When to Walk Away written by Annie Duke","title":"Learnings from the book Quit"},{"content":" I have been following Adam Grant\u0026rsquo;s work for several years, primarily through his podcasts and interviews. I have listened to a lot of \u0026ldquo;Work Life\u0026rdquo; and more recently, \u0026ldquo;ReThinking\u0026rdquo;, which touches on some aspects related to his book. \u0026ldquo;Think Again\u0026rdquo; is the first book of his that I have read, and I thoroughly enjoyed it.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book Think Again \u0026ldquo;Think Again\u0026rdquo; is a book by Adam Grant that challenges readers to rethink their beliefs, open their minds to new ideas, and embrace the power of intellectual humility. Grant, an organizational psychologist, and professor at the Wharton School, explores the importance of being open to changing our minds and how it can lead to personal and professional growth.\nThink like a scientist Approach your thinking like a scientist. Instead of immediately advocating, accusing, or politicking when forming an opinion, treat it as a tentative hypothesis and subject it to testing with data. By adopting the mindset of entrepreneurs who treat their business strategies as experiments, you\u0026rsquo;ll cultivate the flexibility to pivot and adapt as needed.\nFocus on how and not why Instead of focusing on the \u0026ldquo;why,\u0026rdquo; shift your attention to the \u0026ldquo;how.\u0026rdquo; When individuals explain the reasons behind their extreme views, they often reinforce their commitment and become more entrenched in their beliefs. However, when they delve into the practical aspects of implementing their views, they often recognize the limitations of their understanding and begin to moderate their opinions.\nDisagreements are good Embrace constructive conflict instead of avoiding it. Disagreements don\u0026rsquo;t have to be unpleasant. While conflict in relationships tends to be unproductive, task-related conflict can actually foster new thinking. Reframe disagreements as debates, encouraging people to approach them intellectually rather than personally, leading to more constructive outcomes.\nAsk questions By posing sincere inquiries, we leave others intrigued and eager to delve deeper into the subject. Our goal shouldn\u0026rsquo;t be to persuade them that we\u0026rsquo;re correct; rather, we aim to broaden their perspective by introducing the possibility that they could be mistaken. Their innate curiosity may then take over, leading them on a path of exploration and discovery.\nBy engaging in questioning instead of assuming the role of the sole thinker, we extend an invitation for the audience to become our partners in independent thought. If we treat an argument as a battle, it will inevitably result in winners and losers. However, if we view it as a dance, we can begin to collaborate and choreograph a path forward.\nBe careful with preaching When we engage in preaching, our minds are closed, and our sole focus becomes winning the argument or decision, leaving no room for reconsideration, only persuasion. It\u0026rsquo;s crucial to be mindful during discussions, assessing whether we genuinely maintain an open mind or if we\u0026rsquo;re merely trying to promote our own ideas. The danger lies in becoming so consumed with the conviction of our righteousness, the prosecution of others for being wrong, and the pursuit of support through political means that we neglect the vital process of reevaluating our own views.\nDon\u0026rsquo;t accept what you read as true When we encounter a story and embrace it as truth, we often neglect the act of questioning it. The key lies in interrogating ideas before embracing them and maintaining the willingness to continue questioning them even after acceptance. It is crucial to constantly pursue new information and seek stronger evidence, particularly evidence that challenges or contradicts our existing beliefs. The active pursuit of disconfirming evidence can lead to a more comprehensive and accurate understanding of the world.\nThe worst about best practices In performance cultures, people often develop strong attachments to best practices.\nHowever, there is a risk associated with declaring a particular routine as the \u0026ldquo;best\u0026rdquo; because it tends to become fixed in time. We extol its virtues and cease questioning its flaws, losing our curiosity about its imperfections and potential for improvement.\nOrganizational learning should be an ongoing and dynamic process, but the concept of best practices implies that we have reached a final destination. Perhaps it would be more beneficial to shift our focus to seeking better practices instead.\nLet go of the notion of best practices. The idea of best practices implies that we have already achieved the pinnacle of optimal routines. If our goal is to encourage people to continuously rethink the way they work, it would be more advantageous to embrace process accountability and consistently strive for better practices.\nLife scheduled checkups ﻿﻿﻿﻿Make time for a life checkup. It\u0026rsquo;s easy to become trapped in a cycle of commitment to a path that no longer brings fulfillment. Just as you schedule regular health checkups with your doctor, it\u0026rsquo;s valuable to mark your calendar for a life checkup once or twice a year. This serves as an opportunity to evaluate how much you\u0026rsquo;re learning, how your beliefs and goals are evolving, and whether your next steps require some reevaluation.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;We don\u0026rsquo;t just hesitate to rethink our answers. We hesitate at the very idea of rethinking.\u0026rdquo;\n\u0026ldquo;Reconsidering something we believe deeply can threaten our identities, making it feel as if we\u0026rsquo;re losing a part of ourselves.\u0026rdquo;\n\u0026ldquo;The less intelligent we are in a particular domain, the more we seem to overestimate our actual intelligence in that domain.\u0026rdquo;\n\u0026ldquo;The goal is not to be wrong more often. It\u0026rsquo;s to recognize that we\u0026rsquo;re all wrong more often than we\u0026rsquo;d like to admit, and the more we deny it, the deeper the hole we dig for ourselves.\u0026rdquo;\n\u0026ldquo;Changing your mind doesn\u0026rsquo;t make you a flip-flopper or a hypocrite. It means you were open to learning.\u0026rdquo;\nThese are my learnings from the book Think Again: The Power of Knowing What You Don\u0026rsquo;t Know written by Adam Grant. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-think-again/","summary":"These are my learnings from the book Think Again: The Power of Knowing What You Don\u0026rsquo;t Know by Adam Grant","title":"Learnings from the book Think Again"},{"content":"When we developers start a project from scratch, we usually use the default values for most of the configurations and that is very useful as it makes everything very easy to start. Also, the default values work for the majority of the cases. This is also true for the prefetch count in RabbitMQ consumers.\nWhen using Spring AMQP version 2.x, the default for prefetch count is 250, and for most cases that works great. It works so great to the point that many developers don\u0026rsquo;t even need to know about the existence of this parameter or its default value.\nI recently faced a situation where the value of the prefetch count was mattering a lot and the default value didn\u0026rsquo;t work anymore.\nBefore starting to describe the situation, let\u0026rsquo;s see what the docs say about the prefetch count.\nWhat Is the Prefetch Count? The Spring AMQP definition of prefetchCount is\n\u0026ldquo;The number of unacknowledged messages that can be outstanding at each consumer. The higher this value is, the faster the messages can be delivered, but the higher the risk of non-sequential processing. Ignored if the acknowledgeMode is NONE. This is increased, if necessary, to match the batchSize or messagePerAck. Defaults to 250 since 2.0. You can set it to 1 to revert to the previous behavior.\u0026rdquo;\nThe idea to increase the prefetch is to reduce the communication overhead as it fetches many more messages at once. The greater the prefetch count, the lower the communication overhead.\nSo, does that mean that the higher the prefetch the better? Not necessarily, let\u0026rsquo;s take an example of an actual situation that was happening.\nReal Case Scenario I was facing a situation where the messages were not being consumed at a desirable rate. We had a process that added around a thousand messages to the queue every hour (around 7 times a day) and we wanted all of them consumed in around 40 minutes, so when the new process added the messages to the queue again, the queue would be empty and the consumers would start consuming and processing those new messages.\nWhat was happening was that the messages started to accumulate in the queue as the consumption rate was not able to handle everything before new ones were added.\nTotal messages (active + unacknowledged) before\nWe had the minimum concurrent consumer values as 3 and the maximum concurrent consumers set as 6.\nThe first thought was to increase the number of concurrent consumers in order to be able to process more events in parallel, so we did it. We increased the number of maximum consumers to 12 but we didn\u0026rsquo;t see much improvement.\nLooking at the number of consumers being used, we noticed that the consumer number rarely went above 6, even though we had around 1.5k messages in the queue.\nUsed concurrent consumers before\nIt was when we looked at the number of unacknowledged messages that the light struck for us. As we never changed the number of the prefetch count, every consumer was prefetching 250 messages. So if we have 1.5k in the queue, we would only be using 6 consumers (1500/250 = 6).\nLowering the Prefetch Count If we wanted to improve throughput, what we needed to do was to also decrease the number of prefetch count, so more consumers could be started and would be able to work in parallel.\nWe tried that, we decreased the prefetch count from 250 to 5 (in many steps) so if we had more than 30 messages ready in the queue, the AMQP could spin out more consumers to handle it.\nAfter a few iterations, we set the prefetch as 5 and the number of max concurrent consumers to 30. We set the minimum number of active consumers as 15. We also decreased the consecutiveActiveTrigger from 10 to 2 so the consumers would scale up faster. The images below show the result.\nThis shows the total number of messages in the queue (active + unacknowledged)\nTotal messages (active + unacknowledged) after\nThis shows the current number of consumers.\nUsed concurrent consumers after\nWhy the Prefetch Count Mattered Why did we need to adjust the prefetch count? Turns out the processing of the messages for us is slow, so it can take up to a few minutes for the message to be consumed and processed. As the bottleneck was the processing, in order for us to process faster we need to prefetch less so more consumers could be spun to handle messages in parallel.\nThe docs have a very clear warning about the prefetch count.\n\u0026ldquo;There are scenarios where the prefetch value should be low — for example, with large messages, especially if the processing is slow (messages could add up to a large amount of memory in the client process), and if strict message ordering is necessary (the prefetch value should be set back to 1 in this case). Also, with low-volume messaging and multiple consumers (including concurrency within a single listener container instance), you may wish to reduce the prefetch to get a more even distribution of messages across consumers.\u0026rdquo;\nOur use case fell in the \u0026ldquo;especially if the processing is slow\u0026rdquo; case.\nHappy coding!\n","permalink":"https://luizvieira.me/rabbitmq-prefetch-count/","summary":"Prefetch count is a very important parameter that we have when configuring consumers in RabbitMQ, this real-case scenario shows an example of this","title":"The importance of the prefetch count in RabbitMQ consumers"},{"content":" I am a Staff Software Engineer, and I am always looking to grow in my career and improve at my job. I picked up The Staff Engineer’s Path to understand what skills I already have, what I am missing, and what I should focus on to become a better fit for the Staff Software Engineer role.\nLearnings from The Staff Engineer\u0026rsquo;s Path The Staff+ Engineer role is naturally ambiguous, but this book provides a lot of useful information for current staff engineers and those who want to become one. It helps you define what the role means to you and how to shape it to fit your strengths.\nThe book is divided into three main parts, which the author calls pillars: big-picture thinking, project execution, and leveling up the engineers around you.\nI am not listing everything covered in the book, but rather focusing on what applies to my situation. In this case, I am more interested in the behaviors and characteristics of a Staff Engineer than the details of how they work for now.\nStaff engineering is a leadership role The first thing to understand is that staff engineering is a leadership position. You will have the same seniority as a team manager, but instead of leading people, you lead through technical expertise. This means you are expected to be \u0026ldquo;the grown-up in the room.\u0026rdquo;\n\u0026ldquo;Whenever there’s a feeling of “someone should do something here,” there’s a reasonable chance that the someone is you.\u0026rdquo;\nUnderstand the big picture One of the key responsibilities of a Staff Engineer is seeing the bigger picture.\nYou need to understand trade-offs, costs, risks, and long-term impact. It is important to avoid the local maxima problem, where a decision benefits one team but harms the company as a whole.\nJust as important as understanding the present is anticipating how your decisions will affect the future.\n\u0026ldquo;At staff+ levels, you’re often trying to find a balance between seeing the big picture and accepting pragmatic local solutions\u0026rdquo;\nBe a role model As mentioned earlier, you are expected to be the \u0026ldquo;adult in the room.\u0026rdquo; People will pay attention to not just what you say but also what you do. The way you work will set the standard for others. If you do not follow best practices, you cannot expect others to follow them either.\n\u0026ldquo;When acting as a role model, your review comments should make code and designs better, and your opinions need to be well thought out—you need to be right!\u0026rdquo;\nHave high standards for quality To be an effective role model, you need to maintain high standards of engineering quality.\nYour code and design reviews should not only improve the work itself but also help your colleagues learn. You need to understand trade-offs, ask the right questions, seek help when needed, and be well-informed.\n\u0026ldquo;Having high standards means making your work as good as it can be. Look for opportunities to put aside your ego and ask someone else to help make your work better.\u0026rdquo;\nOptimize for maintenance, not just creation Building something new is exciting, but most software exists in maintenance mode for far longer than it takes to create.\n\u0026ldquo;Software gets maintained for much longer than it takes to create it, so don’t build code that’s hard to maintain. Make your systems observable: easy to inspect, analyze, and debug. And keep them simple\u0026rdquo;\nTake ownership As a senior engineer, you are responsible for the whole problem, not just when things go well. If you make a mistake, own it and learn from it.\n\u0026ldquo;You’re not running someone else’s project for them: it’s yours and you don’t passively let it sink or swim.\u0026rdquo;\nHelp others grow You are responsible for improving not just your project but also your team. You should actively look for opportunities that help your colleagues grow.\nSince you set expectations through your actions, lead by example.\nWhen reviewing code, make your comments useful and explain your reasoning. When writing tests, set a high standard. When making proposals, clearly outline trade-offs. Everything you do impacts your team, for better or worse.\nLearn to prioritize You cannot do everything. As your career progresses, more responsibilities will come your way, but you will still have only so much time.\n\u0026ldquo;Every time you choose what to work on, you’re also choosing what not to do, so be deliberate and thoughtful about what you take on.\u0026rdquo;\nYour job is to help the organization succeed, not to solve every problem yourself. Focus on what truly needs your attention and delegate where possible. Since you are helping your teammates level up, you can share responsibilities and achieve more together.\nWrite things down According to the author, the number one tool for success is writing things down.\nDocument your decisions, the trade-offs you considered, and how you arrived at your conclusions. It does not have to be a long document. Even a short summary helps.\n\u0026ldquo;Write things down. Be clear and opinionated. Wrong gets corrected, vague sticks around.\u0026rdquo;\nThe job is supposed to be difficult If you ever feel like the job is hard, that is because it is meant to be. Learning and dealing with unknowns is uncomfortable, but you are not alone.\n\u0026ldquo;When it gets difficult, everyone needs to know that the difficulties are expected, and that they can be overcome.”\nIt is normal to feel overwhelmed at times. You are tackling difficult problems.\n\u0026ldquo;If it wasn’t messy and difficult, they wouldn’t need you.\u0026rdquo;\nChoose what is important to you As a Staff+ Engineer, you will often choose your own work. This means you need to be mindful of what kind of work energizes you and what drains you.\n\u0026ldquo;Choosing projects that support your growth, reputation, and happiness can feel a little selfish in the short term, but your needs are important, and you’re the person with the most incentive to watch out for them.\u0026rdquo;\nAt the end of the day, your career is your responsibility.\n\u0026ldquo;There are a lot of options about what to optimize for. Know what’s important to you. Be deliberate.\u0026rdquo;\nFinal Thoughts The Staff Engineer\u0026rsquo;s Path provides valuable insights into what it takes to succeed in a Staff+ engineering role. It highlights the importance of leadership, big-picture thinking, high standards, and mentorship. The book emphasizes that success in this role is not just about technical skills but also about ownership, prioritization, and the ability to level up those around you.\nAt the core, being a Staff Engineer means making thoughtful decisions, taking responsibility, and continuously growing. It is a challenging role, but one that can be deeply rewarding.\nFavorite quotes These are my 5 favorite quotes from the book:\n\u0026ldquo;There’s only one person in the driver’s seat for your career, and that person is you.\u0026rdquo; \u0026ldquo;Being a senior engineer means having a growth mindset and a drive to improve.\u0026rdquo; \u0026ldquo;Your organization, codebase, and production environment probably existed before you joined them. They’ll probably exist after you move on. Don’t optimize for now at the cost of future velocity or engineering ability. It’s OK to plant some seeds that you won’t personally see grow.\u0026rdquo; \u0026ldquo;Write things down. Be clear and opinionated. Wrong gets corrected, vague sticks around.\u0026rdquo; \u0026ldquo;There’s a Martin Fowler quote that I love: “Any fool can write code that a computer can understand. Good programmers write code that humans can understand\u0026rdquo;\u0026rdquo;. These are my learnings from the book The Staff Engineer\u0026rsquo;s Path: A Guide for Individual Contributors Navigating Growth and Change written by Tanya Reilly.\nHappy career!\n","permalink":"https://luizvieira.me/learnings-book-the-staff-engineers-path/","summary":"These are my learnings from the book The Staff Engineer\u0026rsquo;s Path: A Guide for Individual Contributors Navigating Growth and Change written by Tanya Reilly","title":"Learnings from the book The Staff Engineer's Path"},{"content":" I recently went through the process of migrating some of our classic queues to the new quorum queues and in this post I will explain some of the arguments that we chose for the RabbitMQ queue definition and why we decided on which one to choose.\nFor those who are not aware, the RabbitMQ classic queues were deprecated and are planned to be removed in RabbitMQ version 4.\nRabbitMQ Quorum queues So, for most use cases, the classic queues will be replaced by the Quorum queues. Quorum queues are optimized for a set of use cases where data safety is a top priority. So you will replace all those ha-mode policies with a queue made with data safety in mind.\nQuorum queues are durable, replicated FIFO queues based on the Raft consensus algorithm. It was first available in version RabbitMQ 3.8.0.\nThis guide considers that you use at least RabbitMQ version 3.10 as there are a lot of improvements in this version compared to the 3.8. Also, some arguments will only work on the 3.10 forward.\nRabbitMQ Quorum queues arguments Quorum queues share most of the arguments of Classic queues but a few differ or have limited options.\nTo easily see the difference, let\u0026rsquo;s take a look at what the Dashboard shows when creating the different queues.\nThe image below shows the argument options for a Classic queue.\nClassic queue definition using RabbitMQ Dashboard\nAnd the image below shows the ones for the Quorum queues\nQuorum queue definition using RabbitMQ Dashboard\nAs you can easily notice you don\u0026rsquo;t have the durable option, as Quorum queues are always durable.\nLet\u0026rsquo;s see some of the arguments and sample values that I used. Of course, they will vary depending on your use case, but take it as an example.\nx-overflow Official definition\nThis determines what happens to messages when the maximum length of a queue is reached. Valid values are drop-head, reject-publish or reject-publish-dlx. The quorum queue type only supports drop-head and reject-publish.\u0026quot;\nValue selected: reject-publish\nWhy we need it: It defaults to drop-head so we want to change the behavior. If we use drop-head the message will be published successfully and the publisher will confirm it, as it is going to be delivered to the queue and the first message will be dropped to the DLQ. Using reject-publish allows the publisher to know that the message was not delivered to all queues as it will be rejected. This way the consumer can handle it in the way of their choosing. The overflow size is defined by x-max-length-bytes below.\nx-max-length-bytes Official definition\nTotal body size for ready messages a queue can contain before it starts to drop them from its head.\nValue selected: 1_073_741_824 (1GB) Why we need it: to protect Brokers from overload. This prevents the queue from getting too big and impacts the disk space of the node.\nx-message-ttl Official definition\nHow long a message published to a queue can live before it is discarded (milliseconds).\nValue selected: 604_800_000 (7 days) Why we need it: To avoid long lasting messages. This is only meant to be a safeguard, if the message spends a long time in the queue like 7 days, it is probably due to some problems and there are high chances that it is not needed, so having an expiry helps us remove it from the queue.\nx-delivery-limit Official definition\nThe number of allowed unsuccessful delivery attempts. Once a message has been delivered unsuccessfully more than this many times it will be dropped or dead-lettered, depending on the queue configuration.\nValue selected: 10 Why we need it: To avoid poison messages. If the message is not delivered for 10 retries, it is probably not deliverable so that we can route it to the DLQ.\nx-dead-letter-exchange Official definition\nOptional name of an exchange to which messages will be republished if they are rejected or expire.\nValue selected: mainDeadLetterExchange Why we need it: To be able to route messages that are dropped from the queues. This exchange is responsible for receiving all rejected or expired messages and will be responsible for routing them to the dead letter queues.\nx-dead-letter-routing-key Official definition\nOptional replacement routing key to use when a message is dead-lettered. If this is not set, the message\u0026rsquo;s original routing key will be used.\nValue selected: ${service-name}-dlq\nWhy we need it: to route the messages to the correct queue. Here you can go with one queue for all services or one queue per service. We decided to go with one queue per microservice as each microservice has an owner team and they would be responsible for it.\nx-dead-letter-strategy Official definition\nValid values are at-most-once or at-least-once. It defaults to at-most-once. This setting is understood only by quorum queues. If at-least-once is set, Overflow behaviour must be set to reject-publish. Otherwise, dead letter strategy will fall back to at-most-once.\nValue selected: at-least-once Why we need it: The default value at-most-once can lose some messages, so we decided to go with at-least-once which can deliver duplicated messages but does not lose it.\nRabbitMQ Quorum definitions Just an example, below are the example definitions using Spring and also JavaScript.\nThe Spring example is based on Spring Boot 2.7.x and spring-boot-starter-amqp\n@Bean public Queue quorumQueue() { return QueueBuilder.durable(\u0026#34;queue-name\u0026#34;) .quorum() .withArgument(\u0026#34;x-overflow\u0026#34;, \u0026#34;reject-publish\u0026#34;) .withArgument(\u0026#34;x-message-ttl\u0026#34;, Duration.ofDays(7).toMillis()) .withArgument(\u0026#34;x-max-length-bytes\u0026#34;, 1_073_741_824) .withArgument(\u0026#34;x-delivery-limit\u0026#34;, 10) .withArgument(\u0026#34;x-dead-letter-exchange\u0026#34;, \u0026#34;mainDeadLetterExchange\u0026#34;) .withArgument(\u0026#34;x-dead-letter-strategy\u0026#34;, \u0026#34;at-least-once\u0026#34;) .withArgument(\u0026#34;x-dead-letter-routing-key\u0026#34;, \u0026#34;queue-name-dlq\u0026#34;) .build(); } The JavaScript example uses the library amqplib\nawait channel.assertQueue(\u0026#39;queue-name\u0026#39;, { overflow: \u0026#39;reject-publish\u0026#39;, messageTtl: 604800000, deadLetterExchange: \u0026#39;mainDeadLetterExchange\u0026#39;, deadLetterRoutingKey: \u0026#39;queue-name-dlq\u0026#39;, arguments: { \u0026#39;x-queue-type\u0026#39;: \u0026#39;quorum\u0026#39;, \u0026#39;x-dead-letter-strategy\u0026#39;: \u0026#39;at-least-once\u0026#39;, \u0026#39;x-delivery-limit\u0026#39;: 10, \u0026#39;x-max-length-bytes\u0026#39;: 1073741824, }, }) I hope these examples help you have a good RabbitMQ experience.\nFor more RabbitMQ tips, see RabbitMQ high availability and the importance of the prefetch count.\nHappy coding!\n","permalink":"https://luizvieira.me/rabbitmq-quorum-queues/","summary":"Classic queues are deprecated and are going to be replaced by Quorum queues, which are durable, replicated FIFO queues built with data safety as a top priority","title":"RabbitMQ Quorum queues definition arguments"},{"content":" I first heard of Marshall Goldsmith and the book The Earned Life in a podcast interview in The Knowledge Project (see Other resources) and liked a lot of his way of thinking. He mentioned a few books in the interview and when browsing I chose this one to give it a try.\nLet’s now see more about the book The Earned Life.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from The Earned Life - Lose Regret, Choose Fulfillment The book is good, some sections are better than others, but in general, it is a good read. It highlights the idea of living with purpose and measuring our life by the effort and actions that we take regardless of the outcome, as it can be affected by many variables.\nWhat is an Earned Life? The official definition by the book is:\nWe are living an earned life when the choices, risks, and effort we make in each moment align with an overarching purpose in our lives, regardless of the eventual outcome.\nI struggled a bit with the idea of the Earned Life because the purpose part makes it tricky. Some people have a very clear purpose in their life, like being a good parent, making a difference, etc. While I like to make a difference, I still struggle with what is the purpose of my life.\nThe \u0026ldquo;Earned\u0026rdquo; means that we have to strive for it, that the \u0026ldquo;Earned Life\u0026rdquo; is not given to us freely, we have to fight for it, the book lists three requirements of something truly earned:\n\u0026ldquo;We make our best choice supported by the facts and the clarity of our goals\u0026rdquo; \u0026ldquo;We accept the risk involved.\u0026rdquo; \u0026ldquo;We put out maximum effort.\u0026rdquo; I think the main message is that we have to be explicit and intentional about our lives, not just let it happen. But don\u0026rsquo;t expect a trophy at the end, the \u0026ldquo;reward of living an earned life is being engaged in the process of constantly earning such a life.\u0026rdquo;\nThe Every Breath Paradigm This paradigm comes from the Buddhism concept of impermanence, the notion that the emotions, thoughts, and material possessions we hold now do not last. They can vanish in an instant - as brief as the time we need to take our next breath.\nSo each new breath, you are a new you, not the same person that you were a minute before. Everything that you have right now is a gift from the previous you, and you can do anything with it. It also means that whatever the previous you earned, was their merit, not yours. So you have to earn again, you have to earn your life at every breath.\nThe power of not having choices This is not a new concept, I heard it a few times already, but it is a nice reminder that our brain has limited energy and every choice that we make takes a bit of it. Basic choices that don\u0026rsquo;t align with your goals use energy that could be used for something that is really important.\nI started a few years ago automating and simplifying my choices as much as possible, this way I can focus on things that really matter and not spend a lot of time and energy on things that don\u0026rsquo;t make a difference.\nAvoid regret, choose fulfillment Regret in the words of Kathryn Schulz is \u0026ldquo;the emotion we experience when we think that our present situation could be better or happier if we had done something different in the past.\u0026rdquo;\nAccording to the authors, regret is the polar opposite of fulfillment. The idea is to minimize regret, as it is not possible to eliminate it completely.\nThe Daily Questions The most useful and practical thing that I got from the book was the daily questions. The daily questions try to fix the problem that most of us suffer that we have well-meaning intentions for changes, but our execution is usually poor. As the author says. \u0026ldquo;We are superior planners and inferior doers.\u0026rdquo;\nWhat are the Daily Questions? They are a few questions that you pose to yourself when you want to change something in your life and you reply to them every day (that is where the daily part comes from). The most important part is that when answering them, you are not measuring the outcome, but the effort that you put toward it.\nAs the author says: \u0026ldquo;The key: Each question begins with \u0026ldquo;Did I do my best to ..\u0026rdquo; followed by a specific goal such as \u0026ldquo;Set clear goals?\u0026rdquo; and \u0026ldquo;Exercise?\u0026rdquo; and \u0026ldquo;Not waste energy on what you cannot change?\u0026rdquo;\u0026rdquo;\nA few examples are:\nDid I do my best to exercise? Did I do my best to be fully engaged? Did I do my best to find meaning? Did I do my best to be happy? You can choose whatever you want to focus on.\nWhen replying, you do it on a scale from 1 to 10 where one is the minimum effort and 10 is the maximum effort.\nThe power is that when you do this daily, you are reminded of your goals and can measure them. At the end of the week, you can average the daily values and will see how much you are working or not on achieving what is important for you.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;We are superior planners and inferior doers.\u0026rdquo;\n\u0026ldquo;Live your own life, not someone else\u0026rsquo;s version of it.\u0026rdquo;\n\u0026ldquo;The reward of living an earned life is being engaged in the process of constantly earning such a life.\u0026rdquo;\n\u0026ldquo;In creating a great life for yourself, accept the fact that long-term achievement requires short-term sacrifice. But don\u0026rsquo;t go overboard on delayed gratification. Stop to enjoy the journey. Life is a perpetual marshmallow test, but there\u0026rsquo;s no medal for accumulating the most uneaten marshmallows. You might as well be hoarding regrets.\u0026rdquo;\n\u0026ldquo;If you try your best, you have not failed, regardless of the result.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nThe Knowledge Project with Shane Parrish Podcast Episode #142 Marshall Goldsmith: The Essentials Of Leadership: \u0026ldquo;\u0026hellip;We discuss the surprising lessons he’s learned coaching some of the best CEOs in the world, where confidence comes from, common mistakes leaders make, why changing behavior is easier than changing perception, how to change others’ perceptions when you change your behavior, the three words that kill any conversation, the relationship between intensity and consistency, and so much more.\u0026rdquo; These are my learnings from the book The Earned Life - Lose Regret, Choose Fulfillment, written by Marshall Goldsmith and Mark Reiter. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-the-earned-life/","summary":"These are my learnings from the book The Earned Life - Lose Regret, Choose Fulfillment, written by Marshall Goldsmith and Mark Reiter","title":"Learnings from the book The Earned Life"},{"content":" I have been working with RabbitMQ for a few years now, but most of the time I just worked with the basic concepts, but recently I had to work on a RabbitMQ upgrade and also in converting our classical queues to quorum queues and I picked this book to review my knowledge and learn a few new things in order to do a better job on my tasks\nThe book explains well the basics and also shows some advanced concepts.\nThis post of Learning is from a technical book, so it may be a bit different than the other posts of the collection Learnings from books, as when I read technical books I focus more on the parts that I looking to learn and for my current situation.\nLearnings from The RabbitMQ in Depth The book has a lot of learnings, but to not be too long a post, I will share my 5 most important learnings from the book.\nOnly a reference of the message is added to the queue Rather than placing the actual message in a queue data structure, a reference to the message is included in the queue. When RabbitMQ is prepared to transmit the message, it utilizes this reference to assemble the serialized message and send it. This approach offers a significant optimization for messages distributed to multiple queues since maintaining only one message instance conserves physical memory when it\u0026rsquo;s dispatched to multiple destinations.\nHow does RabbitMQ rate limit the publisher Instead of employing a polite request to the publisher to halt, RabbitMQ ceases to accept low-level data via the TCP socket. This approach effectively shields RabbitMQ from being inundated by a single publisher.\nInternally, RabbitMQ employs a credit system to regulate when it will push back against a publisher. Upon establishing a new connection, the connection is allocated a predefined set of credits for its use. Subsequently, as each RPC command reaches RabbitMQ, a credit is subtracted. After processing the RPC request internally, the connection\u0026rsquo;s credit is reinstated. RabbitMQ evaluates a connection\u0026rsquo;s credit balance to determine whether it should read from the connection\u0026rsquo;s socket. If a connection runs out of credits, it is simply bypassed until it accumulates enough credits.\nRedelivered flag contains useful information When a message is requeued, it marks the message with a redelivered flag, indicating to the next consumer that it has been delivered before. If you\u0026rsquo;re unsure whether the issue lies with the message or another aspect of the consumer, checking the redelivered flag is a useful method to decide whether to reject the message for requeuing or discard it when encountering an error.\nRabbitMQ outsources a lot of the work to Erlang As both a programming language and a runtime system, Erlang emphasizes the use of lightweight processes that communicate through message passing, ensuring a high degree of concurrency without a shared state.\nWithin a RabbitMQ cluster, servers leverage Erlang\u0026rsquo;s inter-process communication (IPC) system. This approach alleviates the need to implement extensive clustering capabilities, a requirement in many other competing message broker systems.\nOne connection, multiple channels One AMQP connection has the capability to host multiple channels, facilitating numerous interactions between a client and server. In technical jargon, this is referred to as multiplexing, and it proves valuable for applications that are multithreaded or asynchronous, handling multiple tasks concurrently.\nThese are my 5 most important learnings from the book RabbitMQ in Depth written by Gavin M. Roy.\nHappy coding!\n","permalink":"https://luizvieira.me/learnings-book-rabbitmq-depth/","summary":"These are my 5 most important learnings from the book RabbitMQ in Depth written by Gavin M. Roy","title":"Learnings from the book RabbitMQ in Depth"},{"content":" I first heard about this book from the Head of Architecture at the current company, he was talking about how we can deliver more and better in a mentorship meeting and gave this book as a reference for a good book to read about the subject.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from the book Extreme Ownership The book is good, as the subtitle says (How U.S. Navy SEALs Lead and Win), it has a lot of military stories and references. Each chapter basically has a military example of a situation, the principle of that situation, and a business example of that principle applied.\nThis structure is nice if you want, you can just skip to the principle and see the business application if you are not interested in the military example, but you will probably lose some context that helps you understand the context better.\nBelow I list the main principles that I thought were interesting.\nPrinciple: Extreme Ownership This is the most important, as it has the name of the book also. Here, the idea is that all responsibility for the success or failures of a team or organization falls with the leader. That means that the leader must own everything. No one to blame, only the leaders themselves.\nThe principle is simple, but not easy. \u0026ldquo;Taking ownership for mistakes and failures is hard. But doing so is key to learning, to developing solutions, and, ultimately, to victory.\u0026rdquo;\nIf a subordinate is not doing what they are supposed to, it is the leader\u0026rsquo;s fault as the leader bears full responsibility for not explaining the strategic mission, training the subordinate, or giving enough resources for them to accomplish the job.\nThat is not easy, as the author points out \u0026ldquo;Total responsibility for failure is a difficult thing to accept, and taking ownership when things go wrong requires extraordinary humility and courage. But doing just that is an absolute necessity to learning, growing as a leader, and improving a team\u0026rsquo;s performance.\u0026rdquo;\nIf you don\u0026rsquo;t have a leader in your job title at work, don\u0026rsquo;t stop reading just now, the nice thing is that this principle applies not only to leaders but to everyone, even in your personal lives.\nYou will get opportunities to \u0026ldquo;lead\u0026rdquo; some initiatives, and taking the view that if something fails it is your fault, not others will help you think of ways of improving and doing better next time. If you default to blaming others, you will never improve as in your mind, you have nothing to improve. You can read more about this in my summary of the book Mistakes were made (but not by me).\nPrinciple: No bad Teams, Only Bad Leaders Good leaders don\u0026rsquo;t make excuses, they figure out a way to get it done and win. If your team is performing badly, it is the leader\u0026rsquo;s fault. The leader must make the mission clear, train, and provide resources, and even after, the team is still performing badly, the leader must make the difficult call of removing the worst-performing individuals.\nPrinciple: Believe If the leader does not believe in the mission, the leader will never be able to convince others to believe in it also. The leader must be a true believer in the mission. If we don\u0026rsquo;t believe in the mission, we are not going to take the required risks to make it work.\nSometimes to believe you must understand not only what must be done, but the why. If you do not believe in the mission or plan, keep asking why until you fully believe in it.\nPrinciple: Check the ego Assuming ownership for everything, mainly for the faults, is a difficult task as it hurts our ego. \u0026ldquo;Admitting mistakes, taking ownership, and developing a plan to overcome challenges are integral to any successful team. Ego can prevent a leader from conducting an honest, realistic assessment of his or her own performance and the performance of the team.\u0026rdquo;\nPrinciple: Simple In development, we have the KISS principle, and in leadership, we have to do the same, Keep it Simple. Simplicity is crucial for successful execution, when plans and orders are too complicated, people may not understand them.\nPrinciple: Prioritize and Execute When reading this I remember my manager, he always says that for a task to be done it has to have two things, be important and urgent. If it has only one of both, we shouldn\u0026rsquo;t do it.\nIt is easy to fail when we are overwhelmed and try to tackle multiple problems and simultaneous tasks, so, \u0026ldquo;leaders must determine the highest priority task and execute\u0026rdquo;.\nPrinciple: Decentralized Command Humans are not capable of managing teams of more than 6 to 10 people, so you have to decentralize the command. Also, the chain of command has to be clear for everyone and every level must follow the Believe principle above.\nPrinciple: Leading up the chain I have never thought about leading up the chain, we usually assume that leadership only comes from the top down.\nBut if your boss is not providing you with support or making decisions in a timely manner, don\u0026rsquo;t blame her or him, take full ownership. Analyze what you can do and what information you can provide to your superior in order for them to make the decision and support you.\nLeading up the chain is a lot harder than leading down. \u0026ldquo;Leading up the chain takes much more savvy and skill than leading down the chain. Leading up, the leader cannot fall back on his or her positional authority. Instead, the subordinate leader must use influence, experience, knowledge, communication, and maintain the highest professionalism.\u0026rdquo;\nIf you don\u0026rsquo;t understand why the decisions are being made, it is your responsibility to ask the chain up for information and clarifications. \u0026ldquo;if your leader is not giving the support you need, don\u0026rsquo;t blame him or her. Instead, reexamine what you can do to better clarify, educate, influence, or convince that person to give you what you need in order to win.\u0026rdquo;\nPrinciple: Decisiveness amid Uncertainty We will never have the complete picture or all the information that we need to make the decisions. But that should not block you from making the decision. \u0026ldquo;It is critical for leaders to act decisively amid uncertainty, to make the best decisions they can based on only the immediate information available.\u0026rdquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Leaders must own everything in their world. There is no one else to blame.\u0026rdquo;\n\u0026ldquo;One of the most important jobs of any leader is to support your own boss - your immediate leadership. In any chain of command, the leadership must always present a united front to the troops.\u0026rdquo;\n\u0026ldquo;Leadership isn\u0026rsquo;t one person leading a team. It is a group of leaders working together, up and down the chain of command, to lead. If you are on your own, I don\u0026rsquo;t care how good you are, you won\u0026rsquo;t be able to handle it.\u0026rdquo;\n\u0026ldquo;Relax, look around, make a call.\u0026rdquo;\n\u0026ldquo;In combat as in life, the outcome is never certain, the picture never clear. There are no guarantees of success. But in order to succeed, leaders must be comfortable under pressure, and act on logic, not emotion. This is a critical component to victory.\u0026rdquo;\nThese are my learnings from the book Extreme Ownership: How U.S. Navy SEALs Lead and Win by Jocko Willink and Leif Babin. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\n","permalink":"https://luizvieira.me/learnings-book-extreme-ownership/","summary":"These are my learnings from the book Extreme Ownership: How U.S. Navy SEALs Lead and Win by Jocko Willink and Leif Babin","title":"Learnings from the book Extreme Ownership"},{"content":" I first learned about the book Being Mortal when reading the Learnings from Let\u0026rsquo;s talk about death (over dinner). It was mentioned many times in that book and was on the recommendation list of the following reads.\nYou can think that the book talks about death (and it is true), but for me, it is more about life. Death is unavoidable and talking about it, makes us reflect on what are the more valuable things for us in our lives.\nAnd Being Mortal for me is that. It is a reminder that we have a limited time to live on this earth and it touches on complicated subjects, mainly regarding the last years of our lives and how we can have a better ending to our lives.\nLet’s now see more about the book Being Mortal.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Being Mortal The book is full of touching stories, it is hard not to get your eyes wet when reading the personal stories there. So, I recommend you read the book. I will not reproduce the stories here as that is not my goal, I will just share what I found were the most important topics and learnings.\nI think the message of the book is that we are mortals, and our biology is constrained. And even when medicine has helped us come a long way in extending life, death will come to us at the end, and many other things are important besides only extending life.\nmedicine\u0026rsquo;s goal is to extend life We are living longer and longer. In the past, surviving into old age was uncommon and we have medicine and science to thank for that. But the problem is that medicine\u0026rsquo;s goal is to fix, to always do something, but sometimes doing nothing is the best thing.\nAs the author said, \u0026ldquo;The simple view is that medicine exists to fight death and disease, and that is, of course, its most basic task. Death is the enemy. But the enemy has superior forces. Eventually, it wins.\u0026rdquo;\nThis kind of action bias is not exclusive to medicine of course, but it affects greatly people that have terminal diseases.\nWe sometimes discuss hopes instead which is easier than just taking into consideration the reality of the situation. And being able to discuss the real situation, may provide a happier end of life.\nwhat matters to us changes What we spend our time on depends on how much time we perceive to have for ourselves. We are young, we believe we have a lot of time so we prefer to spend more time meeting new people instead of, spending time with a sibling, for example. We also value the future more than the present.\nBut as we perceive our time coming to a close, we value doing the opposite, we value the present rather than the future and narrow our focus and prefer to spend time with family and close ones.\nBut interestingly, far from growing unhappier, people reported more positive emotions as they aged. They became less prone to anxiety, depression, and anger. They found living to be a more emotionally satisfying and stable experience as time passed, even as old age narrowed the lives they led.\nwhat is worth living for? We need to have a reason to live. We tend to assume and wish for safety in our old life, but only safety is not enough, we expect more than safety.\nWe want to be helpful, play a role, and make our own decisions. Being able to make our decisions and be in control in old age is the goal for most people.\nIt is not death that the very old tell me they fear. It is what happens short of death-losing their hearing, their memory, their best friends, and their way of life.\nThings change when we are very old and not independent anymore, or terminally ill. We have to know our bare minimum. What is the least that we have to have and still be worth living? What makes life worth living when we are old and frail and unable to care for ourselves?\nIs just being able to eat ice cream and watch TV a worthwhile life for you? Or just being conscious? Or just even be breathing?\nKnowing what is a worthwhile life for you will help you make the decision to undergo certain procedures or not, as their side effect can affect what YOU consider essential to be worth living.\neverything is trade-offs When we are terminally ill, each procedure has to be thought through with care and weigh the trade-off. Sometimes the best is to do nothing.\nAs noted in the book, \u0026ldquo;The fact that we may be shortening or worsening the time we have left hardly seems to register.\u0026rdquo;, we go from one treatment to another, until the very end.\nWhat we have to do is to question if the treatments have more chance of making our lives worse. Some problems cannot be fixed, so, undergoing certain procedures can make your life worse and even shorter.\nAs the example in the book: \u0026ldquo;He chose badly not because of all the dangers but because the operation didn\u0026rsquo;t stand a chance of giving him what he really wanted: his continence, his strength, the life he had previously known. He was pursuing little more than a fantasy at the risk of a prolonged and terrible death - which was precisely what he got.\u0026rdquo;\nThe biggest question is: \u0026ldquo;What are the trade-offs you are willing to make and not willing to make?\u0026rdquo;\nWe should be able to be the writer of our own stories, even when facing the end of life decisions, we need the freedom to shape our lives in ways consistent with our character and wishes.\nhospice maybe is a good option One of the concepts that I didn\u0026rsquo;t know so well before was hospice. Hospice is a place to live comfortably in the last few days of your life. A place to give people their best possible day, however, they might define it under the circumstance that they are in.\nAs well stated in the book, \u0026ldquo;The difference between standard medical care and hospice is not the difference between treating and doing nothing, she explained. The difference was in the priorities. In ordinary medicine, the goal is to extend life. We\u0026rsquo;ll sacrifice the quality of your existence now - by performing surgery, providing chemotherapy, and putting you in intensive care - for the chance of gaining time later. Hospice deploys nurses, doctors, chaplains, and social workers to help people with fatal illnesses have the fullest possible lives right now - much as nursing home reformers deploy staff to help people with severe disabilities.\u0026rdquo;\nletting go Letting go is the hardest part of mortality. Even people that have a family member in a terminal condition are unprepared for the final stages.\nBut people with serious illnesses have priorities besides simply prolonging their lives. \u0026ldquo;Spending one\u0026rsquo;s final days in an ICU because of terminal illness is for most people a kind of failure. You lie attached to a ventilator, your every organ shutting down, your mind teetering on delirium and permanently beyond realizing that you will never leave this borrowed, fluorescent place. The end comes with no chance for you to have said good-bye or \u0026lsquo;It\u0026rsquo;s okay\u0026rsquo; or \u0026lsquo;I\u0026rsquo;m sorry\u0026rsquo; or \u0026lsquo;I love you.\u0026rsquo;\u0026rdquo;\nThat is why it is important to know what is worth living for, and what trade-offs are you willing to go through are important.\nAs the book describes: \u0026ldquo;Our ultimate goal, after all, is not a good death but a good life to the very end. Sometimes we can offer a cure, sometimes only a salve, sometimes not even that. But whatever we can offer, our interventions, and the risks and sacrifices they entail, are justified only if they serve the larger aims of a person\u0026rsquo;s life. When we forget that, the suffering we inflict can be barbaric. When we remember it the good we do can be breathtaking.\u0026rdquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;Death, of course, is not a failure. Death is normal. Death may be the enemy, but it is also the natural order of things.\u0026rdquo; \u0026ldquo;The body\u0026rsquo;s decline creeps like a vine. Day to day, the changes can be imperceptible. You adapt. Then something happens that finally makes it clear that things are no longer the same.\u0026rdquo; \u0026ldquo;Discussing a fantasy was easier - less emotional, less explosive, less prone to misunderstanding - than discussing what was happening before my eyes.\u0026rdquo; \u0026ldquo;The trouble was that she expected more from life than safety.\u0026rdquo; \u0026ldquo;Hope is not a plan, but hope is our plan.\u0026rdquo; Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nOn Being with Krista Tippett Podcast Episode Atul Gawande — What Matters in the End The Knowledge Project with Shane Parrish Podcast Episode #42 Atul Gawande: The Path to Perpetual Progress WorkLife with Adam Grant Podcast Episode Surgeon Atul Gawande wants everyone to have a coach My blog post Learnings from the book Let's talk about death (over dinner) My blog post Learnings from the book The Five Invitations These are my learnings from the book Being Mortal: Medicine and What Matters in the End, written by Atul Gawande. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\n","permalink":"https://luizvieira.me/learnings-book-being-mortal/","summary":"These are my learnings from the book Being Mortal: Medicine and What Matters in the End, written by Atul Gawande","title":"Learnings from the book Being Mortal"},{"content":"The book Mastering Distributed Tracing: Analyzing Performance in Microservices and Complex Systems is the second about distributed tracing that I have read, but this is by far the best of the two.\nI first read Distributed Tracing in Practice but this one has much more practice than the other one. The author shows a bunch of practical use and code examples for various situations (and usually in three languages: Go, Java, and Python). So, if you feel like reading a book about distributed tracing, this one is the one that I would recommend.\nThis post of Learning is from a technical book, so it may be a bit different than the other posts of the collection Learnings from books, as when I read technical books I focus more on the parts that I looking to learn and for my current situation.\nThis book is very hands-on and practical, so if you are new and want to understand how to add tracing, propagate context, or any other thing related to distributed tracing, it will have information.\nThe book has Jaeger as the tracing backend and uses a lot of OpenTracing examples. It is good to understand, but I would say that today I would prefer OpenTelemetry as it is the junction of OpenTracing with OpenCensus.\nIf you are new to the whole distributed tracing world, maybe it is good to read my other post Observability Basics first.\nWriting a post about a second book on the same subject is a bit tricky, so I will try not to repeat much of what I wrote on Distributed Tracing in Practice and try to write what is new and good.\nLearnings from Mastering Distributed Tracing The book was written by the technical lead for the tracing team at Uber Technologies. Where Jaeger was born, so it makes sense to use Jaeger as the tracing backend.\nOne of the things that the author mentions that I completely agree with is that \u0026ldquo;building a tracing system is \u0026ldquo;the easy part\u0026rdquo;; getting it widely adopted in a large organization is a completely different challenge altogether\u0026rdquo;. I see that in many places. People have to change the way they think, from the whole local log mentality to a more distributed and complex system.\nThat is because building a distributed system is hard but debugging them is even harder as we have many parts and many more places for errors.\nObservability The book talks about a definition of observability that I like: \u0026ldquo;observability for a software system is its \u0026ldquo;capability to allow a human to ask and answer questions\u0026rdquo;. The more questions we can ask and answer about the system, the more observable it is.\u0026rdquo;\nIt is not that an observable system will tell you what is going on, but it allows you to dig deeper and ask many questions, so every time that you add spans or logs you can ask that question for yourself, will this help me answer any question or not?\nThe book also talks about the \u0026ldquo;three pillars of observability\u0026rdquo; (metrics, logs, and traces) and that traditional monitoring tools were designed for monolith systems, lacking the context needed to understand distributed systems.\nDistributed Tracing basics The basic concept of distributed tracing is simple: We add instrumentation into chosen points of the program\u0026rsquo;s code (tracepoints) and that produces profiling data when executed that will help us understand how that works (make it observable, as we said above)\nThis profiling data is collected in a central location, correlated to the specific execution context, ordered in the causality order, and combined into a trace that can be visualized or further analyzed.\nIn other words, for the same request, we collect many data points, group them, order them, and create a single view that will help us understand all the interactions for that given request.\nAs the author said, \u0026ldquo;the ability to collect and correlate profiling data for a given execution or request initiator, and identify causally-related activities, is arguably the most distinctive feature of distributed tracing, setting it apart from all other profiling and observability tools.\u0026rdquo;\nFor more on how it works, check the post Observability Basics\nRunning it in production No trace solution is complete until it runs in production, and that is the most challenging part. One of the things that I haven\u0026rsquo;t thought about before reading the book is the importance of considering the cost of the tracing in production, mainly the performance one as I was aware of the storage costs.\nWhen we gather monitoring data in production, we are always doing a compromise between how granular we want the monitoring data and the costs.\nThe costs are both in data storage, as well as in performance overhead of collecting the monitoring data. \u0026ldquo;The more data we collect, the better we hope to be able to diagnose the situation, should something go wrong, yet we don\u0026rsquo;t want to slow down the applications or pay exorbitant bills for storage.\u0026rdquo;\nWhen adding distributed tracing, in addition to the traditional logging level, you have to pay attention to the verbosity of the instrumentation as tracing data can easily exceed the volume of the actual business traffic sustained by an application.\nRegarding the performance, \u0026ldquo;Collecting all that data in memory, and sending it to the tracing backend, can have a real impact on the application\u0026rsquo;s latency and throughput.\u0026rdquo;\nAnd storage is also important, if you use an external service you will probably pay by usage (number of events sent) or if you use an in-house, you will probably need to be concerned with storage and performance of the analyzing tool.\nSampling is important Sampling comes to help with the reduction of these costs. We basically have two ways to sample: Head-based and Tail-based.\nHead-based consistent sampling also known as upfront sampling makes the sampling decision at the beginning of the trace. As the decision is made at the beginning, it is not aware of the whole trace. But as the trace spans many applications, the instrumentation knows that it can discard (doesn\u0026rsquo;t need to collect) the trace that is sampled, reducing the memory and also storage.\nTail-based sampling makes the sampling decision at the end of the trace, so you can analyze the whole trace to make the decision. This helps us make a more intelligent decision on what to keep and what to discard. The trade-off is that you will need to collect the whole trace, so you don\u0026rsquo;t have any reduction of application overhead (only save storage).\nOrganizational challenges When starting to implement distributed tracing in your company, start with the workflows that are most important to your business. As you will probably see the most value and also be able to showcase it to other engineers and management.\nSomeone needs to be in charge of actually deploying and maintaining tracing infrastructure so that the users can reap the benefits. If your company is large enough, maybe you can have a dedicated tracing team, otherwise, a team (platform, infrastructure) will have to be responsible for it.\nThe hardest part will be convincing and spreading the adoption of the libraries, framework or just changing the mentality from classic logging to a more distributed tracing. End-to-end has a clear value proposition but people just don\u0026rsquo;t know about it, so you will need to get the word out.\nIf possible, standardize on a small set of technologies, as it will be easier to transfer skillsets between teams, more efficient, and also easier to create libraries if you need.\nAlso, try to integrate the tracing tools into engineers\u0026rsquo; daily routines. This will help create a virtuous feedback loop where they start suggesting new features or even building their own analysis tools based on the tracing data.\nAnd lastly, look for an open-source solution (like OpenTelemetry). Instrumenting a code base is expensive, so you want to avoid vendor lock-in with vendor-specific libraries.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;In the microservices-ruled world, end-to-end tracing is no longer a \u0026ldquo;nice-to-have\u0026rdquo; feature, but \u0026ldquo;table stakes\u0026rdquo; for understanding modern cloud-native applications.\u0026rdquo;\n\u0026ldquo;As soon as we start building a distributed system, traditional monitoring tools begin struggling with providing observability for the whole system, because they were designed to observe a single component, such as a program, a server, or a network switch\u0026rdquo;\n\u0026ldquo;Collecting all that data in memory, and sending it to the tracing backend, can have a real impact on the application\u0026rsquo;s latency and throughput\u0026rdquo;\n\u0026ldquo;Sometimes, when organizations rush to adopt microservices and break up the existing monoliths, they end up with a \u0026ldquo;distributed monolith\u0026rdquo; characterized by a high number of microservices that are tightly interconnected and dependent on each other\u0026rdquo;\n\u0026ldquo;As you get serious about tracing your distributed architecture, you may start producing so much tracing data that the cost of bandwidth for sending all this data to a hosted solution may become a problem, especially if your company\u0026rsquo;s infrastructure operates in multiple data centers\u0026rdquo;\nThese are my learnings from the book Mastering Distributed Tracing: Analyzing performance in microservices and complex systems. If you want more context related to observability, check the posts with the tag Observability.\nHappy coding!\n","permalink":"https://luizvieira.me/learnings-book-mastering-distributed-tracing/","summary":"These are my learnings from the book Mastering Distributed Tracing: Analyzing Performance in Microservices and Complex Systems","title":"Learnings from the book Mastering Distributed Tracing"},{"content":" The book Why We Sleep: Unlocking the power of sleep and dreams came to my attention after listening to many podcast interviews with the author Matthew Walker.\nIn truth, you can get most of the content of the book just by listening to the interviews with the author in many podcasts or in Matthew Walker\u0026rsquo;s own podcast. I have added a link to all those in the Other resources section of this post. So, after reading this post, I would recommend checking out the podcasts linked at the end of this post.\nLet’s now see more about the book Why We Sleep\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Why We Sleep The book is good, it is written in a way that the reading is fluid and fun. I really enjoyed reading the book. It talks about many pieces of research that confirm the information provided by the author. You are gonna see many examples, that help us understand the information better.\nThe main message that I got from the book is the importance of sleep. The author shows what sleeping does to our body and our mind and also shows what bad sleep does to us.\nFor me, my main takeaway is that we should give ourselves between 7 to 9 hours of opportunity to sleep every night, with consistency, and try to go to bed without caffeine, alcohol, or exposure to lights.\nImportance of sleep According to the book, two-thirds of adults throughout all developed nations fail to obtain the recommended eight hours of nightly sleep. This means that more than half of adult society is sleep deprived. Even though \u0026ldquo;sleep is the single most effective thing we can do to reset our brain and body health each day\u0026rdquo;\nSleep makes you live longer, improves your memory, and makes you more creative. It makes you look more attractive and healthy. It keeps you slim and lowers food cravings. It protects you from cancer and dementia. It wards off colds and the flu. It lowers your risk of heart attacks and stroke, not to mention diabetes. Having enough sleep will help you feel happier, less depressed, and less anxious.\nThe risk of not sleeping enough There are many effects of not sleeping enough. Consistently sleeping less than six or seven hours a night can significantly harm your immune system and increase your risk of cancer by more than double. Inadequate sleep is also a significant lifestyle factor that can determine whether you are at risk of developing Alzheimer\u0026rsquo;s disease. Even a moderate reduction in sleep for just one week can disrupt your blood sugar levels to such an extent that you may be classified as pre-diabetic. Additionally, insufficient sleep raises the likelihood of your coronary arteries becoming blocked and brittle, putting you on a path toward cardiovascular disease, stroke, and congestive heart failure.\nSleeping little also has the propensity to make you fatter, as \u0026ldquo;too little sleep swells concentrations of a hormone that makes you feel hungry while suppressing a companion hormone that otherwise signals food satisfaction.\u0026rdquo;\nBut it is not only physical, the effect of not enough sleep, sleep disruption further contributes to all major psychiatric conditions, including depression, anxiety, and suicidality.\nCircadian rhythm and sleep pressure Every person has an internal clock that is called the Circadian Rhythm, this clock helps your body know when to be awake and when you want to be asleep. It is approximately one day, but not precisely one day. As our internal clocks are not exactly one day, the sunlight adjusts our internal clocks to precisely 24 hours.\nThis internal clock is different for each person, and around 40% of the population is morning type (wake up earlier), 30% are evening type (wake up later) and the rest fall between.\nBut circadian rhythm is not the only factor that determines when you want to sleep and when you want to be awake. The other one is \u0026ldquo;sleep pressure\u0026rdquo; which is a chemical called adenosine.\nAs the day progresses and you stay awake, the chemical \u0026ldquo;sleep pressure\u0026rdquo; in your body builds up, leading to increased feelings of drowsiness. The interplay between this pressure and other factors determines your level of alertness and focus during the day, as well as how easily you\u0026rsquo;ll fall asleep at night and the quality of your sleep.\nCaffeine and its effect on sleep After reading the book, I stopped drinking coffee after 12 PM. Caffeine works by blocking (occupying) the receptors of sleep pressure (adenosine). Sleep pressure builds up as you are awake, the more time you are awake, the more sleep pressure you have in your system. By blocking the receptors, you don’t feel the pressure so your body has more resistance to sleep.\nAs caffeine is hijacking and occupying these receptors, caffeine blocks the sleepiness signal normally communicated to the brain by adenosine. Tricking you into feeling alert and awake, despite the high levels of adenosine that would otherwise seduce you into sleep.\nOk, so we understand how it works, but what is the effect? As the author tells, “Sleep will not come easily or be smooth throughout the night as your brain continues its battle against the opposing force of caffeine. Most people do not realize how long it takes to overcome a single dose of caffeine, and therefore fail to make the link between the bad night of sleep we wake from in the morning and the cup of coffee we had ten hours earlier with dinner.\u0026quot;\nSo, not having caffeine in our body (or having as little as possible) will help us sleep faster and better.\nAre you getting enough sleep? To find out, the author cites two questions that can help you answer that:\n\u0026ldquo;After waking up in the morning, could you fall back asleep at ten or eleven a.m.? If the answer is \u0026ldquo;yes, you are likely not getting sufficient sleep quantity and/or quality\u0026rdquo;\n\u0026ldquo;Can you function optimally without caffeine before noon? If the answer is \u0026ldquo;no\u0026rdquo;, then you are most likely self-medicating your state of chronic sleep deprivation.\u0026rdquo;\nAlcohol and why it destroys your sleep Some people think of alcohol as a sleep aid, believing that alcohol helps them to fall asleep more easily, or even offers sounder sleep throughout the night. Both are untrue.\nAlcohol is a sedative, it \u0026ldquo;sedates you out of wakefulness, but it does not induce natural sleep. The electrical brainwave state you enter via alcohol is not that of natural sleep; rather, it is akin to a light form of anesthesia.\u0026rdquo;\nSo you will \u0026ldquo;sleep\u0026rdquo; but not get all the benefits of sleeping. Worse, it will make you worse, as alcohol fragments sleep, littering the night with brief awakenings making the sleep not restorative, and making you tired the next day.\nAlso, \u0026ldquo;alcohol is one of the most powerful suppressors of REM sleep that we know of\u0026rdquo;. So even if you drink a moderate quantity of alcohol in the afternoon or night, it will deprive you of your dream sleep.\nSo in summary, alcohol makes you feel more tired the next day, will prevent the solidification of memory, and will not allow you to handle your emotions on your REM sleep. There are more side effects than benefits.\nTypes of sleep We basically have two types of sleep REM (Rapid-eye Movement) and NREM (Not Rapid Eye Movement). When we sleep we cycle between the two many times during the night at around every ninety minutes.\nBut the ratio between the two types changes during the night. ​​During the initial half of the night, a significant portion of our ninety-minute sleep cycles is dedicated to the profound NREM sleep phase, while the REM sleep phase is limited. However, as we progress toward the second half of the night, there is a shift in this pattern, the majority of our sleep time is occupied by REM sleep, and the NREM sleep phase is either reduced or absent.\nREM REM sleep is intimately connected to dreaming. It is in this phase that you have most of the dreams (even if you don\u0026rsquo;t remember them). The ones that are hallucinogenic, motoric, emotional, and bizarre experiences with a rich narrative come from REM sleep.\n\u0026ldquo;REM sleep can therefore be considered as a state characterized by strong activation in visual, motor, emotional, and autobiographical memory regions of the brain, yet a relative deactivation in regions that control rational thought.\u0026rdquo;\nNREM Not REM (NREM) sleep is subdivided into 4 stages, stages 1 and 2 are light NREM and 3 and 4 are deep NREM.\nNREM is associated with the process of solidifying memories and also filtering the banal daily things that we don\u0026rsquo;t need to store from the important things that we have to remember.\nShould you nap? According to the book, we humans are beings of biphasic sleep. Meaning that instead of sleeping only a big bout of slumber at night, we should also take a nap of 60 to 90 minutes at the beginning of the afternoon.\n\u0026ldquo;the true pattern of biphasic sleep-for which there is anthropological, biological, and genetic evidence, and which remains measurable in all human beings to date - is one consisting of a longer bout of continuous sleep at night, followed by a shorter midafternoon nap.\u0026rdquo;\nHow and why we dream The book has an entire part about dreaming that is very interesting, but overall, the dream serves a few purposes.\nSleep, specifically REM sleep, is needed in order for us to heal emotional wounds. It serves as an emotional therapy. For example, if you had an emotional experience and after you dream about it, it will be easy for you to move forward with your life. It is not that you will forget the memory, but it will not trigger the same emotional charge as before, so REM sleep in a way helps you disassociate the memory from its emotional charge of it.\nDreaming also helps us decode our daily experiences, helping us in improving our learning and even the learning of physical tasks.\nAnother benefit is the enhancement of creativity and problem-solving.\nThe book also covers many other subjects, like insomnia, sleeping pills, etc that I didn\u0026rsquo;t have space to cover here, so I recommend reading the book or listening to the author\u0026rsquo;s podcast.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;the shorter you sleep, the shorter your lifespan\u0026rdquo;\n\u0026hellip; humans (and all other species) can never \u0026ldquo;sleep back\u0026rdquo; that which we have previously lost is one of the most important take-homes of this book,\n\u0026ldquo;Under-slept employees are not only less productive, less motivated, less creative, less happy, and lazier, but they are also more unethical. \u0026ldquo;\n\u0026ldquo;Sleep has proven itself time and again as a memory aid: both before learning. to prepare your brain for initially making new memories, and after learning, to cement those memories and prevent forgetting.\u0026rdquo;\n\u0026ldquo;If you are about to undergo an elective surgery, you should ask how much sleep your doctor has had and, if it is not to your liking, you may not want to proceed. No amount of years on the job helps a doctor \u0026ldquo;learn\u0026rdquo; how to overcome a lack of sleep and develop resilience.\u0026rdquo;\nOther resources (The Matt Walker Podcast): The author\u0026rsquo;s podcast where he talks a lot about the same content that there is on the book and adds new things also. If you don\u0026rsquo;t want to read the book, you can get similar content from the podcast. Dr. Matthew Walker: The Science \u0026amp; Practice of Perfecting Your Sleep: Interview with Matt Walker on Huberman Lab podcast. #210 – Matt Walker: Sleep: Interview with Matt Walker on Lex Fridman podcast. 654: Dr. Matthew Walker, All Things Sleep Continued: Interview with Matt Walker on The Tim Ferriss Show podcast. These are my learnings from the book Why We Sleep: Unlocking the Power of Sleep and Dreams, written by Matthew Walker. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-why-we-sleep/","summary":"These are my learnings from the book Why We Sleep: Unlocking the Power of Sleep and Dreams, written by Matthew Walker","title":"Learnings from the book Why We Sleep"},{"content":"I usually drank a lot of coffee, around 4 large coffees a day, two in the morning and two in the afternoon. But recently I stopped drinking coffee after 12 PM and in this post, I will explain why and try to convince you to do the same.\nI work as a Software Engineer and I spend the whole day sitting in front of the computer. And like most developers, I drink a lot of coffee. For me it was not even related to the need to drink coffee to be alert, I think it just became my routine and I needed to have something to drink.\nMaybe it was when I just committed a code and was waiting for the pipeline, or because I was in the trial and error mode trying to figure out a bug. But I always had a coffee. Even at the end of the day (like 6 PM) I was still drinking coffee.\nBut after reading the book Why We Sleep - Unlocking the power of sleep and dreams I became aware of the effects of caffeine on sleep and I decided to stop drinking coffee after 12 PM.\nCaffeine Half-Life According to Matthew Walker, caffeine half-life is between 5 and 7 hours, which means that after 5 to 7 hours, you still have 50% of the caffeine in your body. Or in other words, between 10 and 14 hours after you drink your coffee, you still have caffeine in it.\nSo if you drink your last coffee at around 6 PM, at 11 PM (maybe the time you go to sleep), you still have around half of the caffeine in your system. Of course, this depends on each person, some people are more caffeine tolerant and also clean it from the bloodstream faster.\nHow Caffeine Affects Sleep Ok, but what does caffeine do to the body? Let\u0026rsquo;s see below how caffeine works.\nCaffeine works by blocking (occupying) the receptors of sleep pressure (adenosine). Sleep pressure builds up as you are awake, the more time you are awake, the more sleep pressure you have in your system. By blocking the receptors, you don\u0026rsquo;t feel the pressure so your body has more resistance to sleep.\nOr in the words of the author, \u0026ldquo;Once caffeine occupies these receptors, however, it does not stimulate them like adenosine, making you sleepy. Rather, caffeine blocks and effectively inactivates the receptors, acting as a masking agent. It\u0026rsquo;s the equivalent of sticking your fingers in your ears to shut out a sound.\u0026rdquo;\nAs caffeine is hijacking and occupying these receptors, caffeine blocks the sleepiness signal normally communicated to the brain by adenosine. Tricking you into feeling alert and awake, despite the high levels of adenosine that would otherwise seduce you into sleep.\nOk, so we understand how it works, but what is the effect? As the author tells, \u0026ldquo;Sleep will not come easily or be smooth throughout the night as your brain continues its battle against the opposing force of caffeine. Most people do not realize how long it takes to overcome a single dose of caffeine, and therefore fail to make the link between the bad night of sleep we wake from in the morning and the cup of coffee we had ten hours earlier with dinner.\u0026rdquo;\nSo, not having caffeine in our body (or having as little as possible) will help us sleep faster and better.\nOther Sources of Caffeine The bad news is that caffeine is not only present in coffee, it is also present in certain teas, many energy drinks, foods such as dark chocolate and ice cream, as well as drugs such as weight-loss pills and pain relievers.\nSo watch out for other sources of caffeine that are making your sleep worse.\nIf you want to hear about caffeine in the author\u0026rsquo;s words, you can listen to these two episodes (#10: Sleep and Caffeine – Part 1 and #11: Sleep and Caffeine – Part 2) from the author\u0026rsquo;s podcast (The Matt Walker Podcast)\nI hope this will help you sleep faster and better.\nHappy sleeping!\nSpecial thanks to my wonderful wife May for making the beautiful post-it note that I have in front of my \u0026ldquo;home office\u0026rdquo; which helps me to forget about it.\n","permalink":"https://luizvieira.me/why-stop-drinking-coffee-after-12pm/","summary":"Recently I stopped drinking coffee after 12 PM due to the effects of caffeine on sleep. Understand how and why you should too","title":"Why did I stop drinking coffee after 12 PM and so should you"},{"content":" I don’t really remember how I found the book “How Will You Measure Your Life?”, not sure if I was navigating on Goodreads or VPL website, but I remember that it was not a recommendation. But as soon as I saw that Clayton M. Christensen was one of the authors I got interested in it as I read his other great book The Innovator’s Dilemma.\nThis book also came at a moment that I am reflecting more about the goals of life, what we want our legacy to be, and what really matters to us. It provided some theories and new ways of thinking while also consolidating some learnings.\nLet’s now see more about the book How Will You Measure Your Life?\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from How Will You Measure Your Life? The book in a way was born by the realization that the authors know people who despite having very good careers and accomplished a lot professionally were clearly unhappy, they didn’t really enjoy what they were doing. Also, they notice that most of their successful friends have had many divorces and unhappy relationships with spouses, children, and friends.\nWhile there are no easy answers to life\u0026rsquo;s challenges, the book proposes to help you by providing tools, what they call theories, that will help you make good choices according to the circumstances and specifics of your life.\nThe book is full of good examples and stories of each of these theories, they do a great job of connecting the stories with the message that they want you to get from the theory.\nThey use these stories to teach you how to think, so you can make the decision, and not have the answer from them, as they mentioned “But instead of telling him what to think, I taught him how to think. He then reached a bold decision about what to do, on his own.” when talking about a time they were helping Andrew Grove when he was CEO of Intel.\nWhile experiences and information can be good teachers, with the theories of the book, you can learn to be a good spouse before going through multiple marriages, and master parenthood before your last child has grown. “Solving the challenges in your life requires a deep understanding of what causes what to happen”\nThe book is divided into three parts, Finding Happiness in Your Career, Finding Happiness in Your Relationships, and Staying Out of Jail. I will also subdivide using this structure for better explanation.\nThe book heavily relies on business examples, even in the relationship parts. It brings in a way the business philosophy to our personal lives.\nFinding Happiness in Your Career For us to be able to find happiness in our careers, we need to understand what makes us tick, it is a critical step on the path to fulfillment. The starting point for our journey is a discussion of priorities.\nMoney is not all Incentives (like money) do not completely make the world go around, because when people love what they do, they usually don\u0026rsquo;t need incentives as they are always striving to do their best.\nSo you need a balance between hygiene factors (things like status, compensation, job security, work conditions, company policies, and supervisory practices) and motivators (things like challenging work, recognition, responsibility, and personal growth).\nYou can only find happiness in your career if you have both hygiene factors and motivators. Only hygiene factors (high pay for example) will not make you happy in the long term.\nSometimes the more important is the journey, the building of it, and how we feel about our own contribution, what we find satisfying, than the destination (or result) itself.\nHaving a strategy is essential Also, it is important to have a strategy to pursue your goals, the best \u0026ldquo;strategy almost always emerges from a combination of deliberate and unanticipated opportunities. What\u0026rsquo;s important is to get out there and try stuff until you learn where your talents, interests, and priorities begin to pay off. When you find out what really works for you, then it\u0026rsquo;s time to flip from an emergent strategy to a deliberate one.\u0026rdquo;\nBut having a strategy is not enough, you will have to dedicate resources to it, like your time, your energy, and your money. The real strategy is not the one that you plan, it is the one that you allocate the resources towards. We usually write a beautiful plan or strategy but do not allocate resources according to it. That is never going to work. \u0026ldquo;In other words, how you allocate your resources is where the rubber meets the road.\u0026rdquo;\n\u0026ldquo;A strategy - whether in companies or in life - is created through hundreds of everyday decisions about how you spend your time, energy, and money. With every moment of your time, every decision about how you spend your energy and your money, you are making a statement about what really matters to you. You can talk all you want about having a clear purpose and strategy for your life, but ultimately this means nothing if you are not investing the resources you have in a way that is consistent with your strategy. In the end, a strategy is nothing but good intentions unless it\u0026rsquo;s effectively implemented.\u0026rdquo;\nYou are only one Another important learning is that personal life affects work and work affects personal life. Coworkers are people. The way their work goes affects their families and the way their families go affects their work. Doing great things at work improves the personal life, as doing great things in the personal life also affects work.\nFinding Happiness in Your Relationships We have limited time and energy, and we have to make sure we allocate our time and energy according to our priorities. We also have to make sure our measures of success are aligned with what are our most important concerns. Thinking in the long term and avoiding the trap to focus on short-term gratifications. As the job is demanding and we get quicker feedback, we tend to spend most of our energy and time on the job. And doing that, our lives and relationships become shallow and erode with time.\nThe job to be done One nice concept described in the book is \u0026ldquo;the job to be done.\u0026rdquo; It is basically \u0026ldquo;the insight behind this way of thinking is that what causes us to buy a product or service is that we actually hire products to do jobs for us.\u0026rdquo;\n\u0026ldquo;Every successful product or service, either explicitly or implicitly, was structured around a job to be done. Addressing a job is the causal mechanism behind a purchase.\u0026rdquo;\nJust like a product or service is \u0026ldquo;hired\u0026rdquo; to fix a need or problem, in our personal life our partner also \u0026ldquo;hired\u0026rdquo; us for some job to be done. If we are able to find out what is this job to be done, and how can we do what our spouse \u0026ldquo;needs to be done\u0026rdquo; our relationship will improve. But understanding that is not an easy thing to do, \u0026ldquo;understanding the job requires the critical ingredients of intuition and empathy\u0026rdquo;. One of the hardest things is that after a while we start assuming what our spouse wants without really thinking if they want that. \u0026ldquo;We project what we want and assume that it\u0026rsquo;s also what our spouse wants.\u0026rdquo;\n\u0026ldquo;This may be the single hardest thing to get right in a marriage. Even with good intentions and deep love, we can fundamentally misunderstand each other. We get caught up in the day-to-day chores of our lives. Our communication ends up focusing only on who is doing what. We assume things.\u0026rdquo;\nBut understanding is not enough, we have to do the job. \u0026ldquo;You\u0026rsquo;ll have to devote your time and energy to the effort, be willing to suppress your own priorities and desires, and focus on doing what is required to make the other person happy\u0026rdquo;\nHow to raise good children The book goes to great lengths about children, and despite me, not having any, I think the insights are still important.\nAbout children, the book shows that even the interactions when the children are really young matter for their development, so for parents, if they are not focusing on the children from start, they will lose and the children will also. It sounds simple, but like any important investment, these relationships need consistent attention and care.\nOne of the insights is that most parents today when raising their children look to provide a great myriad of experiences for the children, like having them do piano, dancing, soccer, etc. While all these experiences are good, sometimes what they lack is the opportunity to have challenges that they can overcome and be ready for life.\nNo parent wants to see the child suffering, but \u0026ldquo;By sheltering children from the problems that arise in life, we have inadvertently denied this generation the ability to develop the processes and priorities it needs to succeed.\u0026rdquo;\nAs the authors mentioned, \u0026ldquo;I recognize that some of the greatest gifts I received from my parents stemmed not from what they did for me - but rather from what they didn\u0026rsquo;t do for me\u0026rdquo;. Allowing the children to go through the challenges by themselves will help them hone and develop the capabilities necessary to succeed throughout their lives.\n\u0026ldquo;Encourage them to stretch - to aim for lofty goals. If they don\u0026rsquo;t succeed, make sure you\u0026rsquo;re there to help them learn the right lesson: that when you aim to achieve great things, it is inevitable that sometimes you\u0026rsquo;re not going to make it. Urge them to pick themselves up, dust themselves off, and try again. Tell them that if they\u0026rsquo;re not occasionally failing, then they\u0026rsquo;re not aiming high enough\u0026rdquo;\nThe importance of an explicit family culture One of the best insights that I got from it is that we should be conscious and deliberately think about things in our relationships. Like every company has its culture (written or not), all families have a culture, it will happen independently. So it is better if we are deliberate about it and take control (or at least try to guide it) instead of leaving it to happen.\nThe right culture will help your children make the best decisions when they are not around. \u0026ldquo;This is what is so powerful about culture. It\u0026rsquo;s like an auto-pilot.\u0026rdquo;\nSo you have to be explicit about your family culture, a culture with a clear set of priorities for everyone to follow. Be clear about what you expect is good behavior and what is not. \u0026ldquo;Allowing your children to get away with lazy or disrespectful behavior a few times will begin the process of making it your family\u0026rsquo;s culture. So will telling them that you\u0026rsquo;re proud of them when they work hard to solve a problem.\u0026rdquo;\n\u0026ldquo;Make no mistake: a culture happens, whether you want it to or not. The only question is how hard you are going to try to influence it.\u0026rdquo;\nDedicate resources We tend to dedicate most of our energy and time to work and when we get home we have spent most of our energy sometimes we just want to rest and do nothing, but if you don\u0026rsquo;t dedicate the energy and resources to your family and relationships, they will fade away. As the authors say, \u0026ldquo;I genuinely believe that relationships with family and close friends are one of the greatest sources of happiness in life. It sounds simple, but like any important investment, these relationships need consistent attention and care\u0026rdquo;\nStaying Out of Jail The third and last section of the book is short and talks about living a life of integrity. The basic idea is that no one plans to go down the wrong path, but it happens, slowly step-by-step. One relatively small error that we don\u0026rsquo;t admit and cover-up, and then the spiral of self-delusion explained very well in the book Mistakes Were Made (but not by Me).\nSo, every time that you are presented with a small opportunity or make a small mistake, own it and don\u0026rsquo;t try to cover it. \u0026ldquo;The only way to avoid the consequences of uncomfortable moral concessions in your life is to never start making them in the first place. When the first step down that path presents itself, turn around and walk the other way.\u0026rdquo; Doing things 100% of the time is easier than 98% of the time\nEpilogue The book ends by reinforcing that we have to have a purpose in life. Clay explains what is his purpose and how it is based on the idea that a purpose has three parts: likeness, commitment, and metrics.\nThe likeness is what he wants the purpose to be, the pencil drawing that a painter does before applying the oil. A purpose also has to be useful, we need to commit the resources and energy to it. And finally, we need a way to measure if you are in the right way.\n\u0026ldquo;Understanding the three parts composing the purpose of my life - a likeness, a commitment, and a metric- is the most reliable way I know of to define for yourself what your purpose is, and to live it in your life every day.\u0026rdquo;\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;The point isn\u0026rsquo;t that money is the root cause of professional unhappiness. It\u0026rsquo;s not. The problems start occurring when it becomes the priority over all else when hygiene factors are satisfied but the quest remains only to make more money.\u0026rdquo;\n\u0026ldquo;In my experience, high-achievers focus a great deal on becoming the person they want to be at work - and far too little on the person they want to be at home.\u0026rdquo;\n\u0026quot;.. the time when it is most important to invest in building strong families and close friendships is when it appears, at the surface, as if it\u0026rsquo;s not necessary.\u0026quot;\n\u0026ldquo;People in their later years of life so often lament that they didn\u0026rsquo;t keep in better touch with friends and relatives who once mattered profoundly to them. Life just seemed to get in the way.\u0026rdquo;\n\u0026ldquo;the path to happiness is about finding someone who you want to make happy, someone whose happiness is worth devoting yourself to.\u0026rdquo;\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nHidden Brain Podcast Episode Happiness 2.0: Cultivating Your Purpose: Having a sense of purpose can be a buffer against the challenges we all face at various stages of life. Purpose can also boost our health and longevity.\nThese are my learnings from the book \u0026ldquo;How will you measure your life?\u0026rdquo;, written by psychologists Clayton M. Christensen, James Allworth \u0026amp; Karen Dillon. A special thanks to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-how-will-measure-your-life/","summary":"These are my learnings from the book How will you measure your life?, written by psychologists Clayton M.  Christensen, James Allworth \u0026amp; Karen Dillon","title":"Learnings from the book How will you measure your life?"},{"content":" The book Mistakes Were Made (but Not by Me): Why We Justify Foolish Beliefs, Bad Decisions, and Hurtful Acts, written by psychologists Carol Tavris and Elliot Aronson came to my attention quite recently, but it was recommended by one of the investors and persons that I most admire, Howard Marks. He mentioned that he read the book in one of his famous memos entitled The Illusion of Knowledge (text here, podcast here). He also mentioned it in the What’s Oaktree Reading? 2022 Year-End Book Recommendations.\nSo I decided to pick up a copy of the book at a local public library and give it a try.\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Mistakes Were Made (but Not by Me) The book is really good, it talks about self-justification (the need to justify our actions and decisions) and cognitive dissonance (we will see more later) in many daily situations. \u0026ldquo;As fallible human beings, all of us share the impulse to justify ourselves and avoid taking responsibility for actions that turn out to be harmful, immoral, or stupid.\u0026rdquo;\nOne of the main ideas of the book is that when we are confronted by evidence that we are wrong, we do not change our point of view or plan of action but justify our decisions or minimize the actions by blaming someone else. \u0026ldquo;Self-justification minimizes our mistakes and bad decisions; it also explains why everyone can recognize a hypocrite in action except the hypocrite.\u0026rdquo;\nOne important thing is that \u0026ldquo;Self-justification is not the same as lying or making excuses\u0026rdquo;. As when you lie, you know that it is a lie, but when you are self-justifying, you really believe what you are saying. \u0026ldquo;That is why self-justification is more powerful and dangerous than an explicit lie.\u0026rdquo;\nCognitive Dissonance Self-justification is driven by our cognitive dissonance. \u0026ldquo;Cognitive dissonance is a state of tension that occurs when a person holds two cognitions (ideas, attitudes, beliefs, opinions) that are psychologically inconsistent with each other, such as \u0026ldquo;Smoking is a dumb thing to do because it could kill me\u0026rdquo; and \u0026ldquo;I smoke two packs a day?\u0026rdquo;. Dissonance produces mental discomfort that ranges from minor pangs to deep anguish; people don\u0026rsquo;t rest easy until they find a way to reduce it.\u0026rdquo;\nSo, the brain\u0026rsquo;s main goal is to reduce the dissonance between these two conflicting thoughts and we do this in many ways, we can blame others, minimize the effects of what we did, or find any excuses that make us live with ourselves.\nThis happens when we make a decision. After we make it, we will find any reasons to support that decision. So we look for confirmation of our decision (confirmation bias). \u0026ldquo;So powerful is the need for consonance that when people are forced to look at disconfirming evidence, they will find a way to criticize, distort, or dismiss it so that they can maintain or even strengthen their existing belief.\u0026rdquo;\nThe greater the cost of a decision, either being time, money, effort, or even inconvenience, and the more irreversible the result and consequences, the greater the dissonance and the greater the need to reduce the dissonance by minimizing the bad things and overemphasizing the good things.\n\u0026ldquo;Therefore, when you are about to make a big purchase or an important decision - which car or computer to buy, whether to undergo plastic surgery, or whether to sign up for a costly self-help program - don\u0026rsquo;t ask someone who has just done it. That person will be highly motivated to convince you that it is the right thing to do.\u0026rdquo;\nOne interesting thing is that even a random choice, one that you did not feel so strongly about in the beginning will make you in a way convince yourself that you made the best decision, so you will probably feel stronger about the decision after making it than before.\nWith each step that we take, self-justification will make us believe in what we are doing and we can go even further to the next step, getting to extremes. A small difference, in the beginning, can put people in polar opposition after many small steps of self-justification.\nBut self-justification is not always bad, we make ourselves do the right thing because we are compelled by our self-image.\nBlind Spots, biases, and prejudice The dangerous thing about blind spots is that we have blind spots of our blind spots, so we think we don\u0026rsquo;t have any.\nPartially it is due to us thinking we see reality as it truly is, a phenomenon called naive realism. It is \u0026ldquo;the inescapable conviction that we perceive objects and events clearly, \u0026lsquo;as they really are.\u0026rsquo; We assume that other reasonable people see things the same way we do. If they disagree with us, they obviously aren\u0026rsquo;t seeing clearly. Naive realism creates a logical labyrinth because it presupposes two things: One, people who are open-minded and fair ought to agree with a reasonable opinion, and, two, any opinion I hold must be reasonable; if it weren\u0026rsquo;t, I wouldn\u0026rsquo;t hold it. Therefore, if I can just get my opponents to sit down here and listen to me explain how things really are, they will agree with me. And if they don\u0026rsquo;t, it must be because they are biased.\u0026rdquo;\nThat lets us think: I am reasonable, if people don\u0026rsquo;t agree with me it means that they are biased and not acting rationally.\nWe believe we are less biased because we know what is going on in our heads, and introspection tells us what we are thinking and feeling, but we can\u0026rsquo;t do the same with other people, we only see their actions.\nWe all have biases, prejudices, and blind spots. Like fishes are unaware of water, we are unaware of our biases, prejudices, and blind spots.\n\u0026ldquo;Just as we can identify hypocrisy in everyone but ourselves, just as it\u0026rsquo;s obvious that others can be influenced by money but not ourselves, so we can see prejudices in everyone but ourselves.\u0026rdquo;\nIs it really my memory? Memory is another important subject in the book. One important thing is that memory is not like a video recorder, where you see things as they really are. When we remember (retrieve memories), we are gathering the details that we remember to reconstruct them, so we may mix (unintentionally) much other information that was not part of what actually happened.\n\u0026ldquo;Self-justification causes individuals to distort or rewrite their memories to conform to their views of themselves, which is why they can \u0026ldquo;remember\u0026rdquo; saying things that they only thought about saying or intended to say at the time.\u0026rdquo;\nSo, most memories do not represent what really happened, they could be distorted, we could have forgotten something, and we can even confabulate (create erroneous or false memories) all in service of protecting our self-image and avoiding dissonance.\nAnd here we can link with traumatic events, the book talks a lot about the power of fake memories, where people can create a new memory that was \u0026ldquo;repressed\u0026rdquo; to justify why they are the way they are right now. Like if I am a good person and my current situation is screwed, it must be because I suffered some trauma.\nPeople who suffered trauma usually tend not to forget the trauma and we have to be careful as much of psychiatry can try to get \u0026ldquo;hidden memories\u0026rdquo; that are actually fake memories created to justify some other problem that they have in their life.\nSelf-justification in action The book also cites the self-justification effect in many areas of our daily life, from marriage to police and law, to psychotherapists, war, etc.\nUsually, most of the effect follows the basic self-justification pyramid mentioned in the book, where we start with a small and maybe insignificant decision, and step by step the need to justify will take us farther and farther away from the other side.\nThis always happens slowly, in a snowballing pattern of blame and self-justification where each person \u0026ldquo;focuses on what the other one is doing wrong while justifying his or her own preferences, attitudes, and ways of doing things\u0026rdquo;.\nAnd the need to \u0026ldquo;always be right\u0026rdquo; (because we are good people, so our decision must be good), leaves very little space for doubt, and \u0026ldquo;Doubt is not the enemy of justice; overconfidence is.\u0026rdquo;\nMinimizing the bad effects Not everything is lost, just being aware of self-justification and cognitive dissonance can help us make better decisions.\nAnother way is self-acceptance. \u0026ldquo;A richer understanding of how and why our minds work as they do is the first step toward breaking the self-justification habit. And that, in turn, requires us to be more mindful of our behavior and the reasons for our choices. It takes time, self-reflection, and willingness.\u0026rdquo;\nOne good practice is when critiquing someone, never point to what people are, but what people did. If we evoke what they are, they will take it as part of their personality and will self justify and the discussion will turn out to be just arguments, but no one will ever change but pointing out what they did, can allow them to disassociate and don\u0026rsquo;t fall in the self-justifying mechanism.\nAnd mainly, extend to others the same self-forgiving ways of thinking we extend to ourselves. Forgive each other\u0026rsquo;s faults and focus on their good side.\nFavorite quotes These are my 5 favorite quotes from the book.\n\u0026ldquo;As fallible human beings, all of us share the impulse to justify ourselves and avoid taking responsibility for actions that turn out to be harmful, immoral, or stupid.\u0026rdquo;\n\u0026ldquo;Memories create our stories, but our stories also create our memories. Once we have a narrative, we shape our memories to fit into it.\u0026rdquo;\n\u0026ldquo;If good guys justify the bad things they do, bad guys persuade themselves they are the good guys.\u0026rdquo;\n\u0026ldquo;False memories allow people to forgive themselves and justify their mistakes, but sometimes at a high price: an inability to take responsibility for their lives\u0026rdquo;\n\u0026ldquo;Every marriage is a story, and like all stories, it is subject to its participants\u0026rsquo; distorted perceptions and memories that preserve the narrative as each side sees it.\nOther resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nHidden Brain Podcast Episode When You Need It To Be True WorkLife with Adam Grant Podcast Episode The psychology of self-persuasion with Elliot Aronson These are my learnings from the book Mistakes Were Made (but Not by Me): Why We Justify Foolish Beliefs, Bad Decisions, and Hurtful Acts, written by psychologists Carol Tavris and Elliot Aronson. A special thanks to Howard Marks who recommended it to me and to Vancouver Public Library (VPL) for allowing access to the book for free.\nCheers.\n","permalink":"https://luizvieira.me/learnings-book-mistakes-were-made-but-not-by-me/","summary":"These are my learnings from the book Mistakes Were Made (but Not by Me) by Carol Tavris and Elliot Aronson","title":"Learnings from the book Mistakes were made (but not by me)"},{"content":" At work, I am involved with Observability and in order to improve my knowledge I went looking for books to learn more about observability, telemetry, and everything related to it. It was in this search that I found the book Distributed Tracing in Practice: Instrumenting, Analyzing, and Debugging Microservices.\nThis is the first post of Learning from a more technical book, so it may be a bit different than the other posts (check the Learnings from Books Series), as when I read I focus more on the parts that I am looking to learn and just skim through the parts that I am not interested in.\nThe book is good and has very useful information, if you are new or at the beginning of your journey to better understand tracing, it may be worth it for you.\nIf you are new to the whole distributed tracing world, maybe it is good to read my other post Observability Basics first.\nLearnings from Distributed Tracing in Practice As the industry moved to the microservice to achieve some independence during development and deployment (CI/CD) when the service runs in production, they are interdependent, when one slows down, others that depend on it will slow down also.\n\u0026ldquo;Distributed architectures give clear benefits, especially with scalability, reliability, and maintainability. The biggest drawback, however, is that distributed architectures break traditional methods of profiling, debugging, and monitoring.\u0026rdquo;\nAs everything is connected and interdependent we cannot rely only on logs and metrics about a specific microservice, and distributed tracing is part of the solution. \u0026ldquo;Without tracing data, we are reduced to guess-and-check across seas of disorganized logging data and metrics dashboards\u0026rdquo;.\nThe book defines Distributed Tracing as \u0026ldquo;Distributed tracing [\u0026hellip;] is a type of correlated logging that helps you gain visibility into the operation of a distributed software system for use cases such as performance profiling, debugging in production, and root cause analysis of failures or other incidents. It gives you the ability to understand exactly what a particular individual service is doing as part of the whole, enabling you to ask and answer questions about the performance of your services and your distributed system as a whole\u0026rdquo;.\nThe keyword here is understanding. Distributed tracing enables us to understand the whole request and as the software scales in-depth, logs and metrics alone are not enough to quickly identify the problems that happen on production.\nIt does that by providing \u0026ldquo;context that spans the life of a request and can be used to understand the interactions and shape of your architecture\u0026rdquo;.\nYou get the most value with these spans when you annotate with metadata (known as attributes or tags) and events (also referred to as logs) that will help you understand the current inner state of the application.\nThe book also talks about the different ways that you can add instrumentation, that agent-based, and library-based instrumentation. And the importance that you should also add manual instrumentation for important things.\nThe book also talks about the importance of using an open-source and common standard, like OpenTelemetry, to avoid vendor lock-in with the telemetry provider. The book also cites another example, but I believe OpenTelemetry is the most important.\nOne important point made by the authors is that while we have to add information and trace the majority of the operations of your system, we also have to pay attention to the trade-off. Adding spans, logs and other telemetry has a cost of memory, processing, network, data, etc. So be mindful that instrumentation is not free, the ability to be able to understand the system comes with a cost. So adding span can add latency, reduce throughput and increase your infrastructure costs.\nWhen you reach a high volume, you could consider sampling your spans because not all spans have equal value. With that, you make sure that you get the value of trace and the return on your investments.\nTips on how to instrument better your application Below are some practical tips that you can use when instrumenting your application.\nThe book indicates that for serverless and microservices, a good option is to start with a white box instrumentation first. The white box is where you have access to the code source.\nOne good practice is to create attributes (or tags) for important things. Everything that you think can help you understand the behavior of the system in production. Tags are the main way that you can increase the information on the span. \u0026ldquo;tags will allow you to slice and dice that information to better understand the why of your query\u0026rdquo;.\nIn general, don’t try to trace extremely long operations, distributed tracing works best when the entire trace operation takes a few seconds or a few minutes.\nWhen defining the span names, they should describe actions, not resources. Also, think about aggregation when you name the span. Which name will help you aggregate many calls to discover a pattern?\nFor longer or loosely related operations, you can add links that declare the relationship between the traces.\nSpan has status, use this to help classify it and able to understand the system, like the error status for example.\nAlso, \u0026ldquo;named and tagged spans can significantly reduce the amount of logging statements required by your code. When in doubt, make a new span rather than a new logging statement\u0026rdquo;\nAnd lastly, a good rule is that your service should emit as many spans as logical operations it performs.\nThe book also talks about metrics, shows some code examples, talks about the history of tracing, talks about context propagation, Zipkin, and many many other things that I cannot cover here, so if you are interested in digging deeper, you can pick up a copy of the book Distributed Tracing in Practice.\nHappy coding!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-distributed-tracing-practice/","summary":"These are my learnings from the book Distributed Tracing in Practice: Instrumenting, Analyzing, and Debugging Microservices","title":"Learnings from the book Distributed Tracing in Practice"},{"content":"Observability can sometimes feel like a buzzword, but either a buzzword or not, it is a very important subject when we talk about software, more importantly distributed systems.\nWhat is observability But what is the definition of Observability? The book Observability Engineering defines it as:\n\u0026ldquo;Put simply, our definition of “observability” for software systems is a measure of how well you can understand and explain any state your system can get into, no matter how novel or bizarre.\u0026rdquo;\nAnother definition that I like is present in the book Distributed Tracing in Practice:\n\u0026ldquo;Engineers at organizations like Google and Twitter originally promoted observability as a method not just for monitoring their production systems but for being able to understand the behavior of those systems using a relatively small number of signals.\u0026rdquo;\nAnd OpenTelemetry defines it as:\n\u0026lsquo;Observability lets us understand a system from the outside, by letting us ask questions about that system without knowing its inner workings. Furthermore, allows us to easily troubleshoot and handle novel problems (i.e. “unknown unknowns”), and helps us answer the question, “Why is this happening?”\u0026rsquo;\nWhat these definitions have in common is that an observable system is one in which we can understand the current state of the system and its behavior by looking at some signals (which we are going to talk about later). Here the keyword is to understand. Another point that both books above make is we should not need seasoned software engineers that are in a company for a long time to understand the system. A new developer with curiosity and access to the tools should be able to understand it.\nFor us to make an observable system, it must emit signals (telemetry) during the code execution, so we can use these signals to construct a view of the current state of the system.\nSignals for observability An observable system emits telemetry, signals about its behavior. These signals are usually in the form of Logs, Metrics, and Traces.\nLogs Logs are the eldest and most common, it is basically a message with a timestamp.\nI, [2021-02-23T13:26:23.505892 #22473] INFO -- : [6459ffe1-ea53-4044-aaa3-bf902868f730] Started GET \u0026quot;/\u0026quot; for ::1 at 2021-02-23 13:26:23 -0800\nMore advanced uses of logs are structured logs, like JSON with keys and values, where you can have not only a message but multiple fields.\n{\u0026#34;@timestamp\u0026#34;:\u0026#34;2023-01-21T13:24:26.130Z\u0026#34;,\u0026#34;@version\u0026#34;:\u0026#34;1\u0026#34;,\u0026#34;message\u0026#34;:\u0026#34;could not retrieve default encryption key\u0026#34;,\u0026#34;logger_name\u0026#34;:\u0026#34;com.sample.Logger\u0026#34;,\u0026#34;thread_name\u0026#34;:\u0026#34;scheduled-task-4\u0026#34;,\u0026#34;level\u0026#34;:\u0026#34;WARN\u0026#34;,\u0026#34;level_value\u0026#34;:30000,\u0026#34;app_name\u0026#34;:\u0026#34;service-name\u0026#34;,\u0026#34;pid\u0026#34;:\u0026#34;1\u0026#34;,\u0026#34;name\u0026#34;:\u0026#34;log\u0026#34;,\u0026#34;trace\u0026#34;:{\u0026#34;traceId\u0026#34;:\u0026#34;f1fa37d4caf3eb03\u0026#34;,\u0026#34;spanId\u0026#34;:\u0026#34;70f609dc209e8e61\u0026#34;,\u0026#34;trace_id\u0026#34;:\u0026#34;f1fa37d4caf3eb03\u0026#34;,\u0026#34;parent_id\u0026#34;:\u0026#34;70f609dc209e8e61\u0026#34;}} Despite structured logs being a lot better, they still lack a lot of contextual information, for example where we called from, etc. Logs become more powerful when they have associated Spans, which we will take a look at later.\nMetrics Metrics are another type of signal, according to OpenTelemetry, \u0026ldquo;Metrics are aggregations over a period of time of numeric data about your infrastructure or application. Examples include system error rate, CPU utilization, and request rate for a given service.\u0026rdquo;\nKnowing for example the memory utilization of a service, for example, can help us understand if the system is in a degraded state.\nSpans A Span represents a unit of work or operation. It usually has a name, timestamp (time started), and also duration. It can (and should) have many other key/value attributes, usually called dimensions. You should add here any dimension that can help you understand better a state or problems in the system.\nSpan example from OpenTelemetry\nTraces Traces, also known as Distributed Traces, are made of one or more spans. They track the entire operation (an HTTP request for example) through multiple services or applications. The main goal is to break down what happens within a request as it flows through a distributed system and with that make the whole debugging and understanding of the system easier.\nDistribute Tracing example from OpenTelemetry\nTraces are essential for a distributed system, as it has all the context and tracks the entire flow of a request through the system.\nAll these three \u0026ldquo;pillars\u0026rdquo; together make your system more observable and help you better debug the harder unknown unknowns.\nHow to start Implementation of how to do this for your system will vary greatly based on the language, framework, etc. If you use a framework like Spring, you can use Spring Sleuth which helps you to transfer the context between microservices and also comes with some traces out of the box.\nYou can also use the OpenTelemetry libraries and SDKs. At the current moment, I haven\u0026rsquo;t tried any other specific libraries, as I personally have only worked with Spring Sleuth and Zipkin.\nI will share more as I learn along.\nHappy coding!\n","permalink":"https://luizvieira.me/observability-basics/","summary":"Learn what is Observability and the basic signals that allow a system to be observable","title":"Observability Basics"},{"content":" I first heard of the book Let\u0026rsquo;s Talk About Death (Over Dinner) by Michael Hebb in a podcast episode of Rule Breaker Investing hosted by David Gardner. I listened to the episode but was skeptical about the book.\nAfter hearing Michael Hebb\u0026rsquo;s presence in other episodes and thinking about it, I decided to pick up a copy of the book at a local public library and give it a try.\nI was surprised. The book made me think about things that I have never thought about before and in this post, I share some of my learnings from the book Let\u0026rsquo;s Talk About Death (Over Dinner).\nThis post is part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view. But, as reviews, these learnings can say more about me than the book itself, so I trust that you the smart reader will take it with a grain of salt.\nLearnings from Let\u0026rsquo;s talk about death (over dinner) The main message that I got from the book is that we have to talk more about death, it is part of life (the final chapter, but still part). We are a society that is obsessed with self-improvement related to life. We try to improve everything but don\u0026rsquo;t try to improve our lives in the context of death and that is why the book tries to open the gates to more discussions related to it.\nThe book is based on many conversations that the author had during dinner conversations in the project Lets have dinner and talk about death.\nDinner My first take is not related to death itself, but to dinner. We usually try to make the guests\u0026rsquo; only duty to enjoy dinner, but as the author said, \u0026quot;\u0026hellip; humans are tribal creatures; we derive our value from what we contribute. So when people ask, as they unerringly do, \u0026ldquo;What can I do to help?\u0026rdquo; I always have an answer.\u0026quot;\nWhen hosting dinner, it is an excellent idea to let people help, as they will derive more value from the experience. When we have someone at home, let them help.\nDeath About death, it \u0026ldquo;has many shades: it is the loss of a loved one; the reckoning with that fact that we are all mortal and the sweetness and tragedy that gives life; and it is also the little deaths, the things in us that must die in order for us to grow and become our authentic selves\u0026rdquo;\nBut it also has a logistical side, talking about death can help us understand how our loved ones would like to be honored when they die. How they want the funeral service to be, how they want to speak, what song, and who they want to be singing it.\nBy knowing how to honor our loved ones, we can reduce a lot of the logistical worries and focus our energy on mourning. \u0026ldquo;Talking is the best way to leave everyone prepared and unburned them for making decisions in an emotional state and with your wishes of the way you want.\u0026rdquo;\nThe book also talks about the end of life care and the importance of having directives on how you wish to live your last days/months/year and it also talks about the topic of medically ending the life.\n\u0026ldquo;The studies are clear: open conversation with your family, doctors, and caregivers about your end-of-life wishes results in better care, less suffering, and a longer life. Conversations about death have even proved to make us funnier and more willing to laugh.\u0026rdquo;\nMore than half of the book has examples of prompts that are used in dinner conversations full of personal stories about each prompt. It gives you some idea of what you can use if you plan to talk about it with your family. Like \u0026ldquo;What does a good death look like?\u0026rdquo;, \u0026ldquo;Would you ever consider doctor-assisted suicide?\u0026rdquo; \u0026ldquo;Why don\u0026rsquo;t we talk about death?\u0026rdquo; \u0026ldquo;What do you want to be done with the body?\u0026rdquo; and many others.\nBe prepared for an intersection of grief, humor, joy, pain, loss, personal history, and the desire to connect deeply with other humans that emerges at these dinners.\n\u0026ldquo;Every conversation about death is unique, as is every human heart. DNA, epigenetics, childhood, culture, trauma, ego, self-esteem, hurt, joy, pain. All these factors knit the heart into endless variations.\u0026rdquo;\nThe book makes me think about a lot of stuff that I have never thought about, like making a will, how I want my funeral to be, etc. But most important of all, it enabled my first conversation about death with my wife (not over dinner, but over whiskey) and it was good to get to know more about her and her wishes.\nIt also made us think about planning to host a dinner and talk about death with my parents and my wife\u0026rsquo;s parents. We know nothing about how they want to be honored when they die.\nFavorite quotes To finish, I would like to share three quotes from the book.\n\u0026ldquo;We\u0026rsquo;re all going to die,\u0026rdquo; she [Jamaica] said thoughtfully. \u0026ldquo;We can either accept it or make it a shit show for everyone around us.\u0026rdquo; \u0026ldquo;Everything we say about death is actually about life!\u0026rsquo; by Kyoko Mori. \u0026ldquo;When your fear touches someone\u0026rsquo;s pain, it becomes pity, when your love touches someone\u0026rsquo;s pain, it becomes compassion.\u0026rdquo; by Stephen Levine. Other resources This section is extra and here I complement the post with content from other sources that resonate with the book.\nMy blog post Learnings from the book Being Mortal My blog post Learnings from the book The Five Invitations These are my learnings from the book Let\u0026rsquo;s Talk About Death (Over Dinner) by Michael Hebb. A special thanks to David Gardner who recommended it to me and to Vancouver Public Library (VPL) for allowing access to the book for free.\nHappy reading!\nLiked this post? Check out other posts part of the series Learnings from books where my goal is to share what I learned from the book that I read. It is a mixture of review and summary with a bit of my opinion and point of view ","permalink":"https://luizvieira.me/learnings-book-lets-talk-about-death-over-dinner/","summary":"These are my learnings from the book Let\u0026rsquo;s talk about death (over dinner) by Michael Hebb","title":"Learnings from the book Let's talk about death (over dinner)"},{"content":"I have been reading a considerable amount of books lately and with that, I have been learning a lot of new things and getting to know about how the world and we work.\nWhile for the most part, I keep some learnings from the books (and the highlights in some cases) the human mind can\u0026rsquo;t store everything and after a while, I cannot remember a lot of details about the book or even explain the book to someone.\nSo, in order for me to retain the knowledge taken from the books, and even get more out of the books, I started to create a note from each book called Learnings from X (that being the book name) and they are grouped in this Learnings from books series.\nThe initial intent was to document for me the things that I learned and liked about the books. The idea is not to create a summary, review, or anything. It is what I learned and what resonated with me at the time that I read the book.\nLike any book review, which tells more about the reader than the book itself, these Learnings from books can tell more about me and my knowledge (and even more about my lack of it) than the books themselves.\nMy goal in publishing these lessons is just for you to have another perspective. I don\u0026rsquo;t want or expect you to have the same takes from the books or agree with me. It is just one more view of it. So as with everything, take it with a grain of salt.\nCheck here all Learnings from Books posts.\nI hope you get something out of it.\nHappy reading!\nPhoto by Ed Robertson\n","permalink":"https://luizvieira.me/learnings-from-books-series/","summary":"This Learning from Books series documents the things that I learned and liked about the books that I read","title":"The 'Learnings from books' series"},{"content":"I have been studying the market a lot in the last few years, mainly between 2018 and 2020. I have read a lot of books (check the library here) and also listened to a lot of podcasts during these years.\nI learned a lot about companies investing, market stocks, psychology, and a lot of other subjects, and since 2015, when I started to invest in stocks (in Brazil initially) I have been picking my own stocks.\nI have matured a lot in those years, I learned the power of diversification, learned to have a long time horizon, learned to be patient, and keep investing at all times. As I like to say: contribution, patience, and discipline are key.\nThe resulting portfolio after these 7 years of picking stocks, these are the 30 biggest positions, as the portfolio has 75 stocks.\nTop 30 larges positions\nThe ETF BMO MSCI All Country World High-Quality Index ETF (ZGQ) was a recent addition. You can read the post Why we decided to add ETF to our portfolio: Hedging ourselves where I talked about the reasoning for adding it and also describe it a little.\nIn comparing my returns with ACWI and S\u0026amp;P 500, I am a bit behind. But that is not the only reason that made me change our portfolio to indexes. The image below shows my returns compared to ACWI.\nHistorical Returns\nAll the studies that I did in these last years were kind of a hobby, as I work as a Software Engineer so I don\u0026rsquo;t spend all my time studying companies.\nSince the middle of 2021, I have reduced significantly the time that I spent reading about investing and companies as I am focusing more on professional readings and courses, that ultimately affect my income and our investing capital.\nAlso, we are traveling and enjoying more life, so on the weekends and free time that I have I am doing other things not related to investing.\nWith this reduced time and my not-so-good performance until now, we decided to index all our portfolios. Actually, we have been buying ZGQ on our TFSA since we moved to Canada but now we decided to expand and have another ETF.\nZGQ is a great ETF in our opinion, but the cost is very high, so, we decided that for our taxable accounts, we are going to go with VOO, which is an ETF for the S\u0026amp;P 500 and has a fee of only 0.03%.\nBasically, we are going to max out the TFSA with ZGQ and all the rest of the money goes to VOO. We also have an RRSP that is a fund by Manulife (which is the company that my employer has the RRSP with).\nWhy VOO? VOO is the ticker for Vanguard S\u0026amp;P 500 ETF. As the name clearly indicates, it follows the S\u0026amp;P 500. It has an expense ratio of only 0.03% and is one of the lowest-fee ETFs. So the low fee was one of the positive points.\nI was also considering one with more global exposure, like iShares MSCI ACWI ETF (ACWI), but I ended up sticking with the US only. Most US companies are global so they themselves have exposure to other global economies.\nI know that Ray Dalio\u0026rsquo;s point in \u0026ldquo;Principles for Dealing with the Changing World Order\u0026rdquo; has warned that China is approaching the US and may take in the future the World Order, but I still believe that the US (and mainly the dollar) are dominant and can continue to be for a while.\nI also know that some other people in the FIRE movement like VTSAX (or its counterpart ETF VTI). I took it into consideration, but as the difference between them is very small (as the 500 biggest companies account for most of the weight in VTI) I decided to stick with the top 500 only.\nFinal goal The final goal with this is to spend a lot less time studying investing and companies and spend this time focusing on studying work-related stuff or living life.\nAlso, this will reduce the risk of me being a bad stock picker and with that losing or having a bad return that will affect our retirement.\nAlso, this will simplify a lot my investment control.\nAs always, only time will tell if my decision was the right one or not, but I think we are moving in a better direction than before.\nLater, we also added cash to the portfolio.\nHappy investing!\n","permalink":"https://luizvieira.me/why-we-decided-index-portfolio/","summary":"We decided to stop stock picking and index all our portfolio and in this post, we talk about the reasons and which ETFs we chose","title":"Why we decided to index all our portfolio"},{"content":"One good thing about microservices is that they are loosely coupled, you can easily make changes to one and deploy it without affecting other services. Being loosely coupled also means that each microservice will have its own database (or schema).\nWith each service having its own data, we sometimes need to always rely on other services for information, like configuration, core information, etc. Usually, we get this information by issuing HTTP requests, while they can be usually quicker, they are definitely slower than having data locally, they introduce more uncertainty as HTTP requests can go wrong, and also depending on the number of the request, they can start to become a problem.\nOne possible solution to this is caching the information. We can cache the information close to the caller for like a period of time (say one hour) and this could reduce a lot the number of HTTP calls to another service. Or we can cache the information after we fetched from the database and reduce the number of queries.\nIn one real case scenario, we reduced the call from one service to another from 2.2 million calls in a week to 47 thousand just by caching the information in the caller for one hour.\nThe most common and widespread caching pattern is the Cache-Aside which is described by the image below.\nfrom A Hitchhiker’s Guide to Caching Patterns\nIn this approach, we first try to get the information in the cache, if it is not there, we perform the real call and cache the result. The next call with the same key (inside the TTL) will find the key and fetch the value from the cache instead of performing the real call.\nCache types The two most common types of caching that I know of are the in-memory cache (eg. Hazelcast) and remote data structure server (eg. Redis). In-memory cache, as the name says, stores the data in random-access memory (RAM), and remote data structure stores the data in a separate service via HTTP (or other protocols).\nCaching period The caching period will depend on how much your business case can tolerate stale data. If that information rarely changes (like settings), we can go for a longer period, if it changes more frequently, start by trying a shorter period.\nExamples of time to live (TTL) can be for example one minute, one hour, one day, or even without expiration.\nOne approach is to have a different TTL for each method, according to the business need.\nYou can also have a way to evict the cache when the information changes, by updating the cache values.\nError handling Errors are going to happen, that is for sure. Even if you have a 0,01% error rate, they are going to happen. So you have to have a way to handle it. The cache service may be offline, the communication can break, the service can get out of memory, etc.\nOne approach is to have a short timeout (like 500ms or one second), and if anything goes wrong when trying to fetch the data from the cache, you can perform the call to the real method/endpoint. With this approach, you get the best of the cache and reduce the chances that it will break your system.\nHappy coding!\n","permalink":"https://luizvieira.me/cache-overview/","summary":"Caching frequently used information is a very good approach to speed up your microservice. In this post we show a brief overview about caching","title":"Cache in a microservice environment: A short overview"},{"content":"For a company to be able to deliver a good user experience and also be very productive we need that the people that write and maintain our software have a good experience. That\u0026rsquo;s where the platform team (the team that I work on) can help.\nIn our case, the platform team is focused on delivering the basic (core) services and also tools and best practices to all other development teams that focus on the business logic.\nAs platform engineering we help in the following way:\nEnabling teams The platform team\u0026rsquo;s mission is to \u0026ldquo;Serve and Support Developer\u0026rsquo;s Magic\u0026rdquo;, in other words, we are here to help to take the roadblocks out of the road and make the developer\u0026rsquo;s experience better to allow them to do their magic (delivering the best user experience). Like AWS, the platform team provides Managed Services to the rest of the engineering teams.\nA central goal of the Platform Team is to improve the Developer Experience. Developers are a special class of users, in that they use development tools and processes to add quality and value to our products, including delivering better customer and user experiences.\nSo, our goal is to create and maintain a self-service set of tools and processes that allows the developers to do their job. And this set of tools and processes is the platform.\nAs Sam Newman said in his book Building Microservices, 2nd Edition.\n\u0026ldquo;A platform that can implement common functionality, such as the ability to handle desired state management for microservices, log aggregation, and inter-microservice authorization and authentication, can deliver huge improvements in productivity and enable teams to take on more responsibility without also having to drastically increase the amount of work they do. In fact, a platform should give teams more bandwidth to focus on delivering features.\u0026rdquo;\nFor example, by having a set of tools and processes to help in the development process, the business team don\u0026rsquo;t need to worry about the basic \u0026ldquo;plumbing\u0026rdquo; and can focus the entire energy on developing features to make the user experience better.\nSome examples of tools that we maintain are the development pipelines (where the code runs to make sure it is working properly), databases and queue services, authorization services, logging, monitoring, alerting services, tools for fast software development, and many others.\nFocus on the developer As every software company has its end-user, the platform team also has their user, they are all the other developers of the company.\nWe as the platform team need to be actively going out to find out what problems and needs the developers are facing and working with them to help them get these problems fixed. And we also need to be taking a product development approach to how you build out the platform focusing on the developers as our clients.\nWe use many channels to get this feedback and to have clear communication. We have for example dedicated channels on the internal communication app, we also have a JIRA project set up for that and we encourage transparency and open communication from the developers.\nBuilding for resilience Nature tends to be resilient to crisis in a way that human-created things usually aren’t. Your laptop won’t fix itself when it breaks, but your finger will. This requires slack and flexibility. So, we have to purposely add resilience to the systems that we develop.\nWe do this in many different ways, one of these ways is having multiple instances of service in a redundant way so if one of them for some reason fails, we still have other instances that will handle the job without the interruption of the functionality for the customer.\nWe do this with all our own services and also with other tools that we use. Multiple layers of redundancy help us to deliver business continuity to all our customers.\nWe also have active monitoring and alerting services, so if anything happens on our system, we receive alerts and information on what is happening so we can act on it. This helps us to have a better understanding of the problem and its causes.\nSummary In summary, by focusing on the developer experience, the platform team helps increase delivery speed and efficiency at scale so that the teams can focus on the business requirements and solutions.\nHappy coding.\nPhoto by Ryan Quintal\n","permalink":"https://luizvieira.me/platform-team/","summary":"Our main goal as the platform team is to help improve the developer experience and help the company to deliver more","title":"Platform Team: What It Does and How It Helps a Company Grow"},{"content":"Thanksgiving is a major holiday in Canada, and since we’re living here now, we decided to embrace the culture and make a traditional Thanksgiving dinner for the first time.\nWe knew the turkey was the star of the meal, but we had no idea how to cook it or what sides to prepare. So, we turned to the internet and found plenty of traditional recipes to choose from.\nSince it was just the two of us, we kept the menu simple but still ended up with five homemade dishes, plus two store-bought items. We made turkey, gravy, mashed potatoes, stuffing (or dressing), and green beans. And we picked up some cranberry sauce and a pumpkin pie ready-to-eat.\nThe decorations were all thanks to Mayara, with a very Canadian theme: small pumpkins and lots of maple leaves.\nThanksgiving Dinner Let’s go over each of the dishes and the recipes we used.\nOur Thanksgiving dinner table\nTurkey The most important dish and also the most challenging one to make. This was our first time doing it so we tried to follow the recipes and adjust a bit to our taste.\nThe turkey was the most important (and intimidating) dish. Since it was our first time making it, we stuck to the recipes but adjusted them to our taste.\nWe started the day before by brining the turkey. The brine included apple cider, water, rosemary, garlic, salt, brown sugar, and orange. We followed this recipe and let the turkey sit in the fridge for about 24 hours.\nBefore cooking it, we stuffed some vegetables and fruits with seasoning, but we ended up not eating that as we had many other options.\nOn the day of cooking, we stuffed the turkey with vegetables and fruits for extra flavor but didn’t actually eat the stuffing as we had plenty of other food. For the turkey itself, we followed this recipe, preheating the oven to 175°C, pouring chicken broth over the turkey, and wrapping it in aluminum foil. We cooked it for 2 hours and 30 minutes, then removed the foil to let it brown nicely in the oven before letting it rest for 10 minutes.\nThe result? Surprisingly good for our first attempt! The turkey looked great, and the taste was amazing.\nUpdate from our second Thanksgiving: I used the same turkey recipe this year, but I ran into a timing issue. Even after 3 hours in the oven, the turkey was still a bit undercooked. I’ve since learned that the cooking time should be about 30 minutes per kilogram. Since our turkey was larger this time, it needed closer to 4 hours in the oven to cook through properly. Probably it is better to have a meat thermometer next time.\nGravy This was also our first time making gravy, and we tried out new-to-us spices like thyme and sage. We followed this recipe using butter, flour, turkey drippings, chicken broth, salt, thyme, and sage. It turned out to be one of the easier dishes to make: just follow the steps and you’re done!\nMashed potatoes Mashed potatoes are pretty straightforward, and this recipe was no different. We used potatoes, butter, salt, milk, and a bit of sour cream, which made a big difference in flavor. We based ours on this recipe.\nStuffing (or dressing) We took a shortcut with the stuffing by using a pre-made bread base, which saved us some time. We just mixed in the vegetables and baked it in a pie shell, making it a sort of stuffing pie. Our inspiration came from this recipe.\nGreen beans This was a simple yet delicious dish: green beans wrapped in bacon and cooked until the bacon was crispy. Quick and easy.\nCranberry sauce and pumpkin pie These two were store-bought, so no effort required, but they added the final touches to our Thanksgiving meal.\nIn the end, I’d say our first Thanksgiving dinner was a success. The flavors were quite different from what we’re used to, but we really enjoyed it.\nHappy Thanksgiving!\n","permalink":"https://luizvieira.me/thanksgiving-dinner/","summary":"Our first Thanksgiving was a delicious adventure! From cooking a turkey to embracing new traditions, we made a feast that made the holiday truly special","title":"Our First Thanksgiving in Canada: Tradition and Flavors"},{"content":"We added one ETF to our portfolio that had only stocks and this has become one of the largest positions already. In this post, we will get to the reasoning behind this ETF inclusion in the portfolio.\nUntil now we had only stocks in our portfolio, all the holdings were individual stocks that we picked for the long term (the only term). We did not have any ETF or mutual fund. But that\u0026rsquo;s changed.\nWhy we decided to add ETF to our portfolio? A few reasons were taken into consideration when deciding to add the ETF to our portfolio.\nProtection against myself I am an individual investor that invests as a hobby and as a way to save for the future. But I don\u0026rsquo;t spend my whole day studying the market. My time is dedicated more to my work (as a Software Engineer).\nAnd if even the professionals that spend the whole day on the market most of them will lose to index, I certainly can do so.\nSo having an ETF will be a hedge against my decision, a way to protect my portfolio from myself. Protect me from my mistakes that can cause bad results in the future.\nSimplify my portfolio a little bit One other reason is that I am looking to simplify my portfolio a little bit. I have a lot of stocks and that made the management a bit complex.\nIn the past, I dedicated a bit more time to it, but now I changed a bit my goals and want to spend less time and energy studying companies and investments. So adding an index helps me simplify my portfolio and there is less need to follow and study as the index does its job in filtering and recycling companies from its portfolio.\nEnjoy the tax-free account Not that it was required to have an ETF in the tax-free account, but I wanted to have very few transactions and less complexity on my tax-free account. So I decided to only have the ETF on the tax-free account. This way I just buy and never sell (until I retire or the plans change).\nI plan to max out our tax-free account with the ETF which will probably make it one of the largest holdings.\nWhat ETF did I choose? After deciding to add an ETF, the next step was to choose the ETF that I wanted to add. This step took a long time and a lot of thought to it. I tried to select the best for me according to my views and what I believe.\nThe index had to be according to Our Investing Philosophy, which has a great focus on quality companies. So this excluded very risky and also sector ETFs.\nAnother requirement was that it should be as global as possible. We know that most ETFs have a huge concentration in U.S stocks, but we wanted at least some exposure to other countries. So this ruled out country-specific ETFs.\nWe analyzed a few options and ended up choosing one ETF that follows the MSCI All Country World High Quality Index. And as our tax-free account is in Canada (it is a TFSA account), the ETF is BMO MSCI All Country World High Quality Index ETF (ZGQ).\nThis is the definition from the ETF website.\n\u0026ldquo;MSCI All Country World High Quality Index (“Index”) is based on the MSCI All Country World Index, its parent index, which includes large and mid-cap stocks from global markets including 23 Developed Market (DM) and 24 Emerging Markets (EM) countries. The Index aims to capture the performance of quality growth stocks by identifying stocks with high-quality scores based on three main fundamental variables: high return on equity (ROE), stable year-over-year earnings growth, and low financial leverage. All securities eligible for inclusion in the Index are weighted by the product of their market cap weight in the parent index and their quality score. Issuer weights are capped at 5%. The Index is rebalanced semi-annually.\u0026rdquo;\nSo, it has the quality focus that we look for and also has global exposure. The index has high exposure (around 70%) from U.S companies, but that is because the U.S market is the biggest in market cap.\nThis is the current holding breakdown on the day of this writing.\nZGQ Holding Breakdown at time of this writing\nAnd these are the top 10 current positions of the ZGQ ETF.\nZGQ top 10 Holdings at time of this writing\nOne important thing here is that we have some overlap with the individual stocks that I have in my portfolio. Of the top 10 holdings, I have 7 in my portfolio. This overlap does not concern me.\nOne thing that I did not like about the ZGQ ETF is the costs. It is very expensive for an ETF, 0.51%. What made me buy is that this cost seems to be worth comparing to ACWI ETF.\nZGQ vs ACWI on the last 5 year\nOf course, this is not a recommendation, it is just my reasoning behind my choice.\nHappy investing!\n","permalink":"https://luizvieira.me/etf-added-portfolio/","summary":"Until recently we had only individual stocks on the portfolio and recently added one ETF. Check out the main reasons why we added an ETF and which one we added","title":"Why We Added an ETF to Our Portfolio: Hedging Ourselves"},{"content":"Every couple handles money differently, and sometimes it can even cause tension in a relationship. In this post, we’re going to share how we manage our finances as a couple. Hopefully, some of these ideas can help you in your relationship too.\nFirst off, there’s no “right” or “wrong” way to manage money in a relationship. Every couple has their own way of doing things, and what works for one might not work for another. This is just how we do it, and while it may not be perfect for everyone, it could serve as a helpful conversation starter for you and your partner. The goal is to find what works best for your relationship.\nFor many couples, money can be a major source of stress, but we believe most of these issues can be avoided with open communication and clear expectations between partners.\nThe problem is, money often becomes a topic people avoid because it can lead to uncomfortable or tough conversations. But avoiding the issue usually only makes things worse in the long run.\nWe’ve found that clear communication and agreed-upon guidelines about money have improved our relationship by greatly reducing any potential conflicts. That leaves us free to focus on the parts of our relationship that matter more to us.\nOver the past 12+ years together, including 5 years of marriage, having open communication and a system in place has helped us avoid arguments or issues about money.\nHow we manage money as a couple When we first got together, we kept our finances separate. Each of us had our own paycheck, and we split common expenses. We also had individual investment accounts, contributing to our financial growth separately.\nThis worked well for a few years, but as our lives and goals evolved, we decided to reevaluate and change the way we handle our money as a couple.\nWhen your life circumstances change, it makes sense to adjust your financial approach as well. Our current system grew out of our changing needs and goals, and it was designed to simplify things.\nHere’s a quick overview of our system:\nIf you want to see how this system works in practice over time, I also wrote about The Monthly Wrapping Up, which is our recurring monthly review.\nThe flowchart below shows how we manage the money we earn, from the moment we receive our paychecks to its final destinations. It might look complicated, but it’s actually quite simple once you break it down.\nComplete couple\u0026rsquo;s money flow\nTo keep things straightforward, we’ve divided this flow into four levels:\nLevel 1 All of our income, from paychecks or other sources, is combined into one pool. Each of us contributes what we’ve earned into the same \u0026ldquo;funnel.\u0026rdquo;\nLevel 1 of the couple\u0026rsquo;s money flow\nLevel 2 The next step involves three outputs: investments, travel, and the continuation of the flow to the next levels.\nInvestments are our top priority, and we aim to invest 40-50% of our total income. This percentage only changes if there’s a significant shift in our income. For example, if one of us stops working, we might adjust the percentage to 40%. Otherwise, it remains a fixed portion. Finding the right balance for your own financial situation will depend on your priorities, fixed costs, and flexibility. It’s important to be ready to adjust these figures as circumstances change.\nTravel is also something we’ve prioritized by assigning it a fixed percentage of our income. Since we want to travel as much as possible before settling down, it makes sense for us to allocate a portion of our money toward this goal early in the process.\nThe third output sends the rest of the money on to the following stages.\nLevel 2 of the couple\u0026rsquo;s money flow\nLevel 3 This is where we cover all of our fixed expenses, like rent, utilities, internet, transportation, and more. Think of this part like a bucket: we use it to pay our fixed expenses, and whatever is left over flows to the next level.\nOne thing we’ve worked on over the years is keeping our fixed expenses low. That allows us to allocate more to higher-priority items like investments and travel. We consider ourselves to be minimalists in this regard.\nLevel 3 of the couple\u0026rsquo;s money flow\nLevel 4 In this final level, any money left after covering our fixed expenses is split equally between us. It doesn’t matter how much each of us contributed at the start, the remaining amount is divided 50/50.\nThis gives us the freedom to spend on whatever we want (whether it’s clothes, dining out, or personal hobbies) without feeling judged. Having some personal spending money helps maintain our individuality within the relationship.\nLevel 4 of the couple\u0026rsquo;s money flow\nThat’s basically how we handle money as a couple. It does require discipline and organization, but managing finances well takes effort. Without that, money issues can easily lead to conflict in a relationship.\nThe benefits of our approach Here are some benefits we’ve experienced by managing our money this way:\n1. We prioritize what matters most Each couple has different goals. For us, investing comes first, as it gives us more freedom in the future. We also value travel and have set it as a priority early on in our money flow.\n2. We feel like we’re working as a team When we had separate investment accounts, it sometimes felt like we weren’t fully working together. Sharing one account and working toward the same goals has strengthened our sense of partnership.\n3. It simplifies things Managing two investment accounts with similar portfolios was redundant. Combining them into one has made things simpler.\n4. Clear expectations for new money If one of us gets a raise or an unexpected windfall, we know exactly where that money will go in our system. This avoids any confusion or disputes about how to handle extra income.\n5. Freedom to spend without judgment In the end, each of us has a portion of money to spend on whatever we like. This helps us maintain our individuality and spend on what’s important to us, whether it’s gym memberships or electronics, for example.\nA practical example To make things clearer, let’s walk through a practical example using some rough numbers.\nAt the end of the month, after receiving our paychecks, we total our revenue. For simplicity, let’s assume one partner earns $2,000 and the other earns $3,000, making a total of $5,000.\nExample of a Level 1 of the couple\u0026rsquo;s money flow\nNow we’re at Level 2.\nWe first allocate 30% ($1,500) to investments. Next, 5% ($250) is set aside for travel. The remaining 65% ($3,250) moves on to the next level.\nExample of a Level 2 of the couple\u0026rsquo;s money flow\nAt Level 3, we subtract our fixed expenses (let’s say they total $2,250). This leaves $1,000 to move to the final level.\nExample of a Level 3 of the couple\u0026rsquo;s money flow\nFinally, at Level 4, we split the remaining $1,000 between us, with each person getting $500 to spend however they like.\nExample of a Level 4 of the couple\u0026rsquo;s money flow\nThis flow has worked well for us, and we hope it gives you a useful framework for managing money in your relationship. It’s all about finding what works best for you and your partner, and having open conversations about your priorities and goals.\nHappy budgeting!\n","permalink":"https://luizvieira.me/how-we-manage-money-as-a-couple/","summary":"Discover how we manage money as a couple with a clear, step-by-step system that prioritizes communication, shared goals, and financial simplicity","title":"How We Manage Money as a Couple: A Practical Approach"},{"content":"We were seeing some weird long queries with more than 10 seconds (sometimes more than 30 seconds) happening on our Postgres database. Looking at logs and traces, we could establish no evident reason for that as they happened randomly and without any specific cause.\nWhat we knew was that it was happening in one table only (until it happened in another one a few months later). It was happening only on CREATE and UPDATE (we do not do deletes on this table). The table was reasonably big (more than 2.5 million rows).\nMost of the requests were around 35 ms, but for some reason, we had some with long requests that took more than 10 seconds or even 35 seconds.\nLong queries happening randomly\nLooking in Honeycomb, the time spent was during the query itself, all the code for the endpoint and the connection to the database was fine.\nTrace of a random long query\nWe were thinking that it could be caused by some kind of bad data that we had on the database, but we could not point out the root cause.\nAfter a while of trying things out, no root cause was found.\nIt was then that we found this question UPDATE on big table in PostgreSQL randomly takes too long on StackExchange.\nThe reply by jjanes put us on the right track, here is the reply from StackExchange.\njjanes reply on StackExchange\nWe checked our table for GIN indexes, and yes, we had 5 of them, which gave us a glimpse of hope in finding the root cause of the problem and also fixing it.\nHow fastupdate in GIN works As jjanes very well explained in his response in StackExchange, \u0026ldquo;GIN indexes have a \u0026quot;fastupdate\u0026quot; mechanism where new data gets written to a specific section in a linear fashion. Once that exceeds some set size (gin_pending_list_limit, which is set globally but can be overridden per index) the next process which happens along to write to the index gets assigned the task of consolidating those entries into the main part of the index, which can lead to long freezes for that process.\u0026rdquo;\nThe image below from the Postgres documentation illustrates the basic structure of this pending list.\nGIN index structure from Postgres documentation\nSo basically, on new edits (INSERT, UPDATE, DELETE) on the table data, the index changes are written to the pending list (each index has its own) and when it reaches the size (4MB as the default) it has to flush this temporary data to the main index structure. This flushing to the main index causes that specific query to take a long time.\nIt can appear random because it will depend on how many GIN indexes you have, how your data is distributed, and other factors.\nIf this long wait for the consolidation of the index is a problem for your use case, you have a few options to fix this.\nHow to fix the long queries with GIN index Dropping unused indexes The first and most reasonable thing to do is to check if the indexes are really used. It is common to have indexes that are never used or can be replaced by other simpler indexes. So if you do not use it, dropping will fix the problem (for this table/index).\nDisable the fastupdate mechanism If you cannot delete the indexes, one thing that you can do is disable the fastupdate mechanism. Not sure how you can do it globally, but for doing to a specific index you can drop the index and recreate it with fastupdate=off like the following example.\nCREATE INDEX IF NOT EXISTS search_table_inx ON your_table USING gin ((your_jsob_field-\u0026gt;\u0026gt;\u0026#39;your_mapping\u0026#39;) gin_trgm_ops) WITH (fastupdate = off); This will remove the random long queries but will increase slightly all the inserts/updates for each change in the index, as it will have to persist to the main index (we will not have the pending list anymore)\nJust be careful with this approach, because it can take a bit of time to recreate it. If you use Flyway migrations and Kubernetes, your pod can be killed for taking a long time during the migration.\nAlso, CREATE INDEX will lock the table (only writes). For not locking, you can add the CONCURRENTLY keyword like CREATE INDEX CONCURRENTLY. But bear in mind that when using the CONCURRENTLY keyword, the table will not be locked but the table will be scanned twice. So your time to apply the create index will increase.\nchanging gin_pending_list_limit size Another option that you have is to decrease the size of the gin_pending_list_limit database parameter. The default value at our DB was 4MB and the minimum you can set is 64KB. Decreasing the pending list size will make the updates to the main index more frequent, making your long queries a bit shorter. How shorter is unknown, you will have to try it out and see if it fits your needs.\ncreate a script to clean the pending list on schedule Another option in theory (I am not sure if it will work because I did not try this, so it requires testing) is to increase a lot the pending list and call the select gin_clean_pending_list(...) in a separate script.\nWhat we did to fix it To solve our problem, we did a bit of most of the options above.\nThe first thing we did was to analyze and check if the indexes were really being used. With a bit of refactoring, we were able to remove 3 of the 5 indexes that we had.\nFor the 2 remaining indexes, we chose to go with disabling the fastupdate for them.\nBut we also decreased the gin_pending_list_limit to the minimum (64kb) to avoid this happening for the other GIN indexes that we have in our services. We did not have to analyze all the database indexes so we decided that reducing the gin_pending_list_limit was a good solution.\nI hope that this helps you in developing better experiences for your users avoiding GIN index long queries.\nHappy coding!\nA big thanks to jjanes as his answer pointed to the right direction and helped us solve the problem.\n","permalink":"https://luizvieira.me/postgresql-gin-index-long-queries/","summary":"We were seeing random queries taking as much as 35 seconds on our Postgres DB. The cause was GIN index feature that you have to get to know","title":"PostgreSQL GIN Index: Long Random Queries on Data Updates"},{"content":"Lately life has felt more balanced.\nWork is still intense, but I am protecting my energy better and trying to keep a more sustainable pace. Vancouver summer helps a lot, so I am spending more time outside whenever I can.\nHere is what I’ve been up to lately:\nHobbies Photography is still my favorite hobby right now.\nOn weekends, my wife and I are trying to do more small outdoor trips, even when we do not have a big plan. We went back to places like Minnekhada and Buntzen Lake, and I am trying to keep this simple rhythm consistent.\nTravel The two most recent trips were Hawaii and Alaska.\nHawaii was our Easter long weekend escape, and I really loved seeing the volcanic landscape for the first time. I wrote about it in Hawaii Big Island: Volcanoes, Beaches, and a 3-Day Escape.\nIn June, we did a longer Alaska trip focused on wildlife and nature. It was one of my favorite trips so far, especially for photography and marine wildlife. I shared the full notes in Alaska in June: Wildlife, Ice, and Long Summer Days.\nWe also took a day trip to Bowen Island, where we were able to spot a humpback whale.\nI also wrote about one of my favorite food experiences from my last Brazil trip in Six Hours by the Fire for Costela Fogo de Chão in Brazil.\nSelf-Improvement I am keeping this simple right now: better sleep, better consistency, less over-optimization.\nWhen work gets too heavy, I usually try to fix the basics first instead of adding more tools and routines.\nHealth I am back to a regular gym rhythm after a short break.\nRunning is still paused for now. I might bring it back later, but I am not forcing it.\nReading Still slower than I would like.\nI started a few books but did not make a lot of progress. Most of the slowdown is just energy management after intense work periods.\nRight now I am reading Fuzz: When Nature Breaks the Law. I picked it because I wanted light non-fiction where I could still learn something without feeling like I was doing heavy study.\nAfter a full day of work, reading can be hard, so choosing an easier read has been helping me keep the habit going.\nEven with less reading, I published The Podcasts That Made Me Smarter, Healthier, and Happier in 2025, which captures some of what I have been learning in audio format.\nProfessional The microservice rewrite is now in a much better place, and seeing it run reliably in production has been very rewarding.\nThis was one of those projects that looked straightforward from far away, but had many details and tradeoffs once we got deep into it.\nI also wrote a few posts related to things I was working on, including Improving MongoDB Observability with Spring Data and IntelliJ AI Chat Window Is Better Than the Copilot Plugin.\nI published two reflections on AI and work dynamics: Is Agentic AI Like a Drug? and Why Async Agentic AI Does Not Mean Free Productivity.\nAnd on a more personal note, I shared Four Years at FISPAN: A Coffee Table Book and Colleagues\u0026rsquo; Messages.\nThat is all for now. I will keep this page updated as things change.\nCheers,\nLuiz\n(This is a now page, and if you have your own website, you should make one, too.)\n","permalink":"https://luizvieira.me/now/","summary":"The Now page is where you can find the latest updates on what I am doing.","title":"What I am doing now"},{"content":"I recently started to watch Ted Lasso (I know, I am a little late to the game - pun intended) and besides being a very funny show, it also brings a lot of lessons on leadership and how to better work with people as a team.\nBefore starting the post, just a heads up: This post is full of spoilers.\nJust a bit of background of the show. AFC Richmond, a soccer team in England is going through a bad moment, and the new management, Rebecca, hires an American football coach that knows nothing about soccer. The thing is that the new management secretly wants the team to fail as the team was the love of her ex-husband. You can watch the trailer here.\nAs I said, it is a very good and funny show (despite not getting most of his jokes\u0026rsquo; references). I really laugh with the participation of the ussie guy. Not a selfie, an \u0026ldquo;ussie\u0026rdquo;.\nYou should watch the show, it is delicious, but let\u0026rsquo;s go to the lessons. Many of them we know, but sometimes, in our daily activities, we just forget. And this show was a good reminder of many of them.\nKnow people by name Dale Carnegie said in his book How to Win Friends and Influence People, in 1936, “A person\u0026rsquo;s name is to that person the sweetest and most important sound in any language.”\nThis is very evident in one episode, where Ted asked the kit manager, what was his name. He said: \u0026ldquo;Me? No one ever asks my name\u0026rdquo;. And some scenes later, Ted calls Nathan (the kit manager\u0026rsquo;s name) and he says: \u0026ldquo;You remember my name\u0026rdquo;\nEveryone is part of a team In the second episode, Ted is trying to get to know Rebecca a bit more, and when she was trying to avoid him, he said: \u0026ldquo;Everybody in this building, part of the team\u0026rdquo; and he brings the management present in many of the team\u0026rsquo;s wins and losses, making people bond and connecting.\nBe optimistic (BELIEVE) This may be the clearest lesson, as Ted hangs a sign written BELIEVE above his office door. In many parts of the show, Ted reiterated the idea of believing that they will win, believing in themselves.\nDon\u0026rsquo;t internalize bad feedback There was a lot of resistance when accepting Ted as a coach, as he did not know anything about soccer. But in the second episode, he had a \u0026ldquo;suggestion box\u0026rdquo; and asked everyone to write a note of what was making the team \u0026ldquo;hot and bothered\u0026rdquo;.\nSurprisingly, he got many replies, but all of them (except one) were calling him bad names or telling him to go home. But he just read it and did not care about all the bad ones, only the one \u0026ldquo;shower pressure is rubbish\u0026rdquo; that mattered.\nLet people take action In one of the episodes, Roy went to Ted to complain that Jamie and other players were harassing Nathan, but, as evident by Ted\u0026rsquo;s reaction, he already knew. Roy asked if he was going to take care of it, and Ted said no. In not doing anything, he let Roy have an inner battle and in the end, act. In not doing, he makes Roy become a better version.\nGive opportunity The team was doing badly, and Nathan had some thoughts about the team and left a note to Ted. Ted read and liked the ideas, but said he was not going to say it to the team. He said that Nathan would be the one doing it, that whoever created it needed to say it. This was very nice on Ted\u0026rsquo;s part, as we have many managers or bosses that want always to be in front, and be elevated. But a good manager, makes the team grow.\nResources are people Sometimes we forget that a company is made of people. We sometimes think of resources and forget that behind every one of the resources, there is a person with dreams and fears, with life. That is very evident in one of the episodes where they celebrate the birthday of one of the team members.\nRespect Once he went to a restaurant, one that was owned by the father-in-law of the driver that picked him up at the airport when he arrived in Richmond (Ollie), they ordered food and it was very hot, but he ate everything out of respect, not to shame Ollie in front of his father-in-law and he thought that leaving food uneaten was not going to be good for Ollie\u0026rsquo;s image with his father-in-law\nBe patient It took a lot of time for Ted\u0026rsquo;s approaches to start delivering results, and he was very patient. He was slowly moving the pieces and making changes in behavior, relationship, and other things around the team and that was almost unnoticeable for the ones that were with him.\nHave a goldfish memory According to Ted, goldfish are the animals that have the shortest memory. So we should sometimes have the memory of a goldfish, most importantly in the moment of suffering and failure. Meaning that we should forget and move on. We sometimes feel sad, feel destroyed, but we should forget and just focus on what is ahead.\nThese were the main lessons that I got from Ted Lasso\u0026rsquo;s TV show. There are many other small ones, but I just wanted to share the best ones and not spoil the entire TV show for you.\nI hope that some of these lessons help you.\nHappy living!\n","permalink":"https://luizvieira.me/lessons-from-ted-lasso-tv-show/","summary":"Ted Lasso is a great TV show and I learned a lot from it. This is a collection of the main leadership lessons that I took from the show","title":"Leadership lessons from Ted Lasso TV show"},{"content":"I recently finished reading the book Principles for Dealing with the Changing World Order: Why Nations Succeed and Fail by Ray Dalio and I want to share with you some takeaways that I got from the book.\nThe book is excellent, it brings information about some things that we take for granted and opens our eyes to how the world power changes and has changed in the past.\nLet\u0026rsquo;s go to the takeaways and at the end, I list some additional resources if you want to get to know more.\n25 takeaways from Ray Dalio\u0026rsquo;s book Principles for Dealing with the Changing World Order only learning from one’s own experiences is not adequate because many of the most important lessons don’t come in one’s lifetime. The really big boom periods and the really big bust periods are surprising unless one has studied the patterns of history over many generations. no system of government, no economic system, no currency, and no empire lasts forever, yet almost everyone is surprised and ruined when they fail, or in other words, All empires decline, and new ones rise to replace them. when wealth and values gaps are large and there is an economic downturn, it is likely that there will be a lot of conflict about how to divide the pie. the most important three cycles are a) the long-term debt and capital markets cycle, b) the internal order and disorder cycle, and c) the external order and disorder cycle humanity’s capacity to invent solutions to its problems and to identify how to make things better has proven to be far more powerful than all of its problems combined. averages don’t matter as much as the number of people who are suffering and their power and to be successful the system has to produce prosperity for most people, especially the large middle class. the formula for success has been a system in which well-educated people, operating civilly with each other, come up with innovations, receive funding through capital markets, and own the means by which their innovations are turned into the production and allocation of resources, allowing them to be rewarded by profit-making. while the inherited assets and liabilities of a country are very important, the way people are with themselves and others is the most important determinant. human capital is the most sustainable capital because inherited assets that are drawn down eventually disappear, whereas human capital can exist forever. self-interest, especially self-survival, is the most powerful motivator for most people, organizations, and governments. those who favor long-term well-being over short-term well-being tend to do better. in all countries throughout time, though to varying degrees, people are sorted into “classes,” either because they choose to be with people like themselves or because others assign them to a class. to be successful one must earn an amount that is at least equal to the amount one spends. having a reserve currency is great while it lasts because it gives a country exceptional borrowing and spending power and significant power over who else in the world gets the money and credit needed to buy and sell internationally. history has shown that ￼we shouldn’t rely on governments to protect us financially. On the contrary, we should expect most governments to abuse their privileged positions as the creators and users of money and credit for the same reasons that you might commit those abuses if you were in their shoes. the two things about war that one can be most confident in are 1) that it won’t go as planned and 2) that it will be far worse than imagined. the financial strength to outspend one’s rivals is one of the most important strengths a country can have and in war one’s ability to withstand pain is even more important than one’s ability to inflict pain. all markets are primarily driven by just four determinants: growth, inflation, risk premiums, and discount rates. the three biggest risks most investors face are that their portfolios won’t provide the returns needed to meet their spending needs, that their portfolios will face ruin, and that a large share of their wealth will be taken away (e.g., through high taxes). Americans are impulsive and tactical; they fight for what they want in the present. Most Chinese are strategic; they plan for how they can get what they want in the future. i’ve observed that while the Chinese are more interested in asking questions and learning, Americans are more interested in telling you what they think. during periods of great crisis, more autocratic and less democratic leadership tends to be preferred. dealing with the future is all about 1) perceiving and adapting to what is happening, even if it can’t be anticipated; 2) coming up with probabilities for what might happen; and 3) knowing enough about what might happen to protect oneself against the unacceptable, even if one can’t do that perfectly in the markets and in life, to be successful one should bet on the upside that comes from a) evolution that leads to productivity improvements, but not so aggressively that b) cycles and bumps along the way knock you out of the game. In other words, betting on things being better—e.g., real earnings being greater—is pretty much a sure bet. But betting too much on that so that a bump along the way can ruin you is bad. That’s why having quality indicators helps a lot. put deferred gratification ahead of immediate gratification so you will be better off in the future. I started out planning to list only 10 takeaways, but there were a lot of takeaways that I liked, I changed it to 25 takeaways.\nIf you are interested in the topic, besides reading the book Principles for Dealing with the Changing World Order you can watch some videos and also listen to some podcasts that Ray Dalio participated in.\nA great resource is the website companion Economic Principles which puts together many research papers and other PDFs, videos, and audios. I also liked the video ​​How The Economic Machine Works by Ray Dalio and Principles for Dealing with the Changing World Order by Ray Dalio. If you, like me, like podcasts, he was interviewed in Lex Fridman Podcast\u0026rsquo;s #251 – Ray Dalio: Money, Power, and the Collapse of Empires, Masters in Business\u0026rsquo; Ray Dalio on the Key to Success: Failing Well (Podcast) and We Study Billionaires\u0026rsquo; TIP410: The Changing World Order W/ Ray Dalio\nHappy investing!\n","permalink":"https://luizvieira.me/25-takeaways-ray-dalio-book-principles-dealing-changing-world-order/","summary":"In this book, Ray Dalio shows what history can teach us about the changes in world power and how we can use that information to plan for the future","title":"25 Takeaways from Ray Dalio's Changing World Order"},{"content":"We recently moved to Canada and because of that our lives started almost from scratch and we had to do a lot of things in the first couple of months. Some friends and coworkers helped with tips and some information, but we lacked a list that had most things so we had to figure things out slowly and painfully.\nBecause of that, we decided to create this guide. This guide is based on our experience and some things may not apply to your case. Use it as an informational guide and always check things as they can be changed at the time of your reading.\nAlso, this guide has some provincial-specific things, in our case British Columbia. It may differ in other provinces.\nLet\u0026rsquo;s go to the topics. The order is by the sequence that we did them.\nPhone number One of the first things we did here was to get a phone number from Canada. It helped in the communication with people from here and also many other forms and documents require a phone number.\nThey have many mobile phone providers here, like Telus, Fido, Rogers, and Bell.\nWe decided to go with a phone that had a data plan and were a bit torn between Telus (that is supposed to have better coverage in Canada) and Fido (that is cheaper). We ended up with Fido as we got also a promotional value.\nWe got 10GB of data for 40 in the first line and 10 GB for 45 in the second line. We had the two numbers in the same account.\nIf you decide to go with Fido, you can use my referral code and we both receive one month of service free.\nTell the attendant that we were referred by a friend and you have a referral link. Use this link\nSIN number You need this number if you are going to work. Social Insurance Number is your identification for tax purposes, so you\u0026rsquo;ll need to open a bank account, for the job, etc. To get it you need to go to a Service Canada Centre. Look for one that does not seem busy and go early. We stayed in a line for almost five hours to do ours.\nBC ID (British Columbia) BC ID is the simplest form of identity that you can use in British Columbia (Other provinces may have different names). When you get the BC ID you can stop carrying your passport around.\nFor doing a BC ID, go to an ICBC Drivers License Office. It costs around 36 dollars and they will send you to a mail address that you provide in two weeks. We did not have a permanent address at the time, so we gave a friend\u0026rsquo;s number and after we found a place to live, we just changed the address.\nBank account and Credit card As I was used to using fintech in Brazil, my first option was to try to open a bank account in fintech here in Canada also. I tried to open an account in Tangerine and also EQ Bank. The thing is that both of them required a piece of local ID (they did not accept my Brazilian Passport) and I tried to open an account before my BC ID arrived.\nAs we were in a hurry to open a bank account, we ended up opening the Account in Scotiabank. Depending on the type of account that you choose, you can get your fee rebate if you leave a certain amount of money.\nOther traditional bank options are TD Bank, BMO,\nI also made a credit card with Scotiabank that has up to 4% cashback. After I received the BC ID, I was able to verify my account in Tangerine, but my credit card was denied, probably because I did not have a credit score.\nSo in summary, as we did not have a credit score here, we were denied the credit card from fintech but the traditional banks approved the credit card and allowed us to open an account with our country\u0026rsquo;s passport (we had also the SIN number, phone number and work permit with a pay stub to prove income)\nCompass card If you are living in Vancouver, the way to move around using public transportation is to have a Compass Card. In that, you have the option to buy a Daily pass, Monthly, or Store a value on the card. You should make the calculation if the Monthly pass is really needed for you. We use the store value option, we added a value and also enabled the auto-reload, so when it gets below 5, it adds a value chosen by us. This way, we pay only for the trips that we take and as we did not go to the office every day, it is worth it for us.\nRenting an apartment Renting an apartment was challenging. Here in Vancouver, it is sometimes harder to rent an apartment than to find a job. We have written a post \u0026lsquo;5 Tips to Help You Rent an apartment in Vancouver\u0026rsquo; in our other blog Pieces of the World.\nBC Hydro The process of getting electrical energy in our apartment was very easy. We just opened an account on the website of the energy provider (BC Hydro in our case) and said which was our moving day. After that, it started to count the consumption to our account. They did not need to do anything at the apartment, just in the account.\nHome Internet There are many internet providers here also and they may change for each province. Here the main two are Shaw and Telus. Analyzing the different plans and options we ended up getting Telus. The main difference is that Telus has the same Upload and Download speed, while Shaw has a lower upload speed.\nIf you decide to go with Telus, you can use my referral link and get $50 off on your first bill. Click here to use it.\nDriver\u0026rsquo;s Licence BC You can drive up to 90 days here with your country\u0026rsquo;s driver\u0026rsquo;s license. After that, you have to get your provincial driver\u0026rsquo;s license. If your country of origin has a reciprocal agreement, you can convert your driver\u0026rsquo;s license very quickly, if it does not, you will have to make the knowledge test and also the road test.\nFor BC, you can check the requirements on the ICBC website. But basically, you will have to do a knowledge test that has 50 questions and you have to have 40 correct and after do a road test.\nFor the knowledge test, you can download an app and practice the questions and also read the manual.\nWe hope that this guide helps the process of moving to Canada be more smooth.\nIf you still need to take the language test, I shared some CELPIP speaking tips. We also wrote about our first Thanksgiving in Canada.\nIf you are looking for places to travel, check our travel Youtube Channel Pieces of the World.\nHappy living!\n","permalink":"https://luizvieira.me/new-to-canada-guide/","summary":"We recently moved to Canada and because of that our lives started almost from scratch and we had to do a lot of things in the first couple of months","title":"New to Canada Guide: Guide for a more smooth experience"},{"content":"RabbitMQ is a very popular and one of the most widely deployed open-source message brokers. And when taking it to production, one of the main concerns is how to have high availability of the queues and exchanges. In this post, I will draft some strategies for making your RabbitMQ highly available.\nRabbitMQ approaches the issue of high availability by replicating data, the same as storage solutions like databases and other infrastructures when data integrity and service continuity are of primary importance.\nThe main objective is not only to avoid the possibility of data loss but also to reduce downtime due to both scheduled maintenance and system malfunctions.\nIt is also important to think about HA when using cloud environments, like, Amazon Web Services (AWS), it is highly recommended to distribute the application in clusters between availability zone to have a more reliable set up.\nLet\u0026rsquo;s talk about some approaches that can help your RabbitMQ to have higher availability.\nClustering A RabbitMQ cluster creates a seamless view of RabbitMQ across two or more servers. The clustering built into RabbitMQ was designed with two goals in mind: allowing consumers and producers to keep running in the event one RabbitMQ node dies, and linearly scaling messaging throughput by adding more nodes.\nThe clustering mechanism replicates all the data and states across all the nodes for reliability and scalability. In a RabbitMQ cluster, a runtime state containing exchanges, queues, bindings, users, virtual hosts, and policies is available to every node.\nBecause of this shared runtime state, every node in a cluster can bind, publish, or delete an exchange that was created when connected to the first node. The general structure of the clusters would be changed dynamically, according to the addition or removal of any clusters from the systems. Furthermore, RabbitMQ tolerates the failure of each node.\nDespite the advantages of using RabbitMQ’s built-in clustering, it has limitations and downsides. One is that clusters are designed for low-latency environments. You should never create RabbitMQ clusters across a WAN or internet connection. State synchronization and cross-node message delivery demand low-latency communication that can only be achieved on a LAN.\nAnother important issue to consider with RabbitMQ clusters is cluster size. The work and overhead of maintaining the shared state of a cluster is directly proportionate to the number of nodes in the cluster. So with each new node addition, your overall cluster becomes more complex and with more overhead to manage.\nNode types When you add a node to your cluster, you should choose one of the Node types that affect the storage place; these are disk nodes or RAM nodes. If you choose a RAM node, RabbitMQ stores its state in memory. However, if an administrator chooses to store its state in a disk, then RabbitMQ stores its state on both, memory and disk.\nClassic queues mirroring RabbitMQ clusters don\u0026rsquo;t mirror queues by default. The queues are stored in the broker nodes connected to the clients that created them. Whenever such a node fails, all the queues and the messages stored within it aren\u0026rsquo;t available.\nIf you have defined the queues as durable and the messages as persistent, it\u0026rsquo;s possible to restore the node without losing data but this is not sufficient if you need to handle the death of one component without interruption of the service.\nThe ha-policies help to solve this problem by mirroring a queue across all the nodes in the cluster. Replicating messages on more than two nodes improves the system availability minimally, but if the cluster grows because of the higher load, it will negatively impact the application\u0026rsquo;s performance.\nA few policies that you can take a look at:\nha-mode ha-mode defines to which members of the cluster it will mirror, I usually use all.\nha-sync-mode ha-sync-mode mode defines how the nodes synchronize when they join the cluster.\nThe default option is manual meaning that there will be no synchronization until you say so (by pressing the button in Management UI for example) and because of that it will not receive existing messages, it will only receive new messages. At some point, when the old messages are consumed, the new node will be fully synchronized with the lead node.\nAnd automatic means that the node will sync everything when joining the cluster.\nThe most important thing to consider here is that synchronization is a blocking operation, meaning that while the node is syncing with a queue, that queue will be blocked in all nodes and will not receive or allow the consumption of messages. Or in other words, \u0026ldquo;while a queue is being synchronized, all other queue operations will be blocked.\u0026rdquo;\nDepending on many factors, like the size of the queue, the syncing operation can take minutes, hours, or days. And while synching, you basically cannot use the queue. So you may lose messages if your publishers are not using publishing confirms.\nLeaving the value in manual means that the queue will not enter the syncing state so it will not be blocked, but you run the risk of losing data in the unfortunate event of all the other nodes that have old messages die.\nYou will have to balance and check for each queue, which is the less bad scenario, running the risk of having a queue blocked for a long time or being at the risk of not having the queue synched for a time while the consumers consume old messages not present in the new node.\nCheck here for more info on synchronization.\nha-sync-batch-size You can use the ha-sync-batch-size policy to define the size of the synchronization payload. It should not be so small (like 1) because that can make your synchronization take a lot of time and not a too large payload, as to have network problems. The RabbitMQ docs advise taking the average message size, network throughput between RabbitMQ nodes, and net_ticktime value into consideration when defining the batch size. Read more here.\nqueue-mode As the docs state, \u0026ldquo;By default, queues keep an in-memory cache of messages that is filled up as messages are published into RabbitMQ. The idea of this cache is to be able to deliver messages to consumers as fast as possible. Note that persistent messages can be written to disk as they enter the broker and kept in RAM at the same time.\u0026rdquo;\nBecause of that, they introduce the lazy queues, \u0026ldquo;Lazy queues attempt to move messages to disk as early as practically possible. This means significantly fewer messages are kept in RAM in the majority of cases under normal operation. This comes at a cost of increased disk I/O.\u0026rdquo;\nSo, the lazy put the messages to disk as early as possible and default according to internal RabbitMQ rules that take memory and other resources into account. The risk here that I have witnessed is that when we are synchronizing a large number of messages, if we have the default value, we hit many times the high memory watermark and the syncing failed a few times (tested syncing a queue that had a size in bytes larger than the memory available). To be able to sync, we had to set it to lazy.\nlazy seems to be a safer alternative, as it stores to disk, if all nodes fail at the same time, we will not lose the message when it comes back as it was saved to disk. But you should take care as it can increase your disk usage in normal operations.\nTo read more about lazy queues, check this page of the docs.\nQuorum queues Implemented on version 3.8, the quorum queue is a modern queue type for RabbitMQ implementing a durable, replicated FIFO queue. It is preferred when we need replication between queues.\nThe quorum queue type is an alternative to durable mirrored queues purpose-built for a set of use cases where data safety is a top priority. I have not explored this queue type yet, but it is supposed to be a better version for high availability data.\nFederation Federation in a simple way means the transmission of messages between brokers. It is one of the powerful ways of handling lots of messages while using multiple RabbitMQ servers. The main goal of Federation is to transmit messages between brokers without the need for clustering. This is better indicated when you want a less coupled, WAN-friendly, and scalable solution.\nThe idea is that when you have a higher latency, and geographic distance, you should consider doing federation instead of clustering. Federation works in an asynchronous fashion. If you are using AWS for example, when using different Availability Zones, you should prefer federation instead of clustering.\nThe federation plugin does not come enabled automatically, but you can enable it.\nRead more about federation here.\nPublish Confirms and consumer acknowledgments Having high availability for the messages that exist in RabbitMQ is awesome, but you can not reach HA if the message never reached the broker.\nFor that, you should also check if you are using publish confirms. Publish Confirms help the sender make sure that the message was received and safe there. Without confirmation, the sender can believe that message is in the broker but for some reason, it never reached the broker.\nAlso, due to some error in the consumer, it can lose the messages and the broker can discard the message thinking everything went well in the consumer. For this, you should understand how your code acknowledges the message. Take a look at consumer acknowledgments\nI hope this piece helps you make your RabbitMQ more available.\nHappy coding!\nReferences RabbitMQ Docs RabbitMQ Cookbook by Gabriele Santomaggio and Sigismondo Boschi RabbitMQ in Depth by Gavin M. Roy Mastering RabbitMQ by Emrah Ayanoglu, Yusuf Aytaş, and Dotan Nahum ","permalink":"https://luizvieira.me/rabbitmq-high-availability/","summary":"When taking RabbitMQ to production, one of the main concerns is how to have high availability of the queues and exchanges","title":"RabbitMQ High Availability: Tips for a Better Broker"},{"content":"Preparing for a job can be difficult because we have to focus on many things and it is easier to get lost. But being prepared is the best approach to help you land the perfect job you are looking for. I myself went through this process of looking for a job and I want to share with you a preparation guide that helped me get the software engineering job that I was looking for.\nI will try to touch on the most important aspects of the process.\nDifferent companies have different procedures and processes and requirements. Usually, small companies that are not very known have simpler and easier processes and larger companies like Amazon and Microsoft have more difficult and complex processes.\nDefine what companies you are looking for A good first step is to list some companies you desire to work for. When you have the list, you can look for information in the interview process. Some companies have a well-defined process that is available for you to see before applying. This can help you be prepared for it.\nLook at the current open positions Another thing that is helpful is to look at the company\u0026rsquo;s open positions, there you can find what they are looking for and the technical requirements. With the position\u0026rsquo;s technical requirements, you can now compare what skills you have and study for those you do not have or need enhancement.\nPractice your coding skills This is more common in big companies. They may ask you to perform a coding challenge that asks you to solve some problems. Some ask for sorting algorithms and other types of algorithms.\nIt is good to have some practice, some resources are helpful:\nHackerRank HackerRank is the main one, at least the main one that I used. They have a lot of preparation resources, algorithms, data structures, mathematics, artificial intelligence, C, C++, Java, Python, Ruby, SQL, Databases, Linux Shell, etc. The main one that I did was the Interview Preparation Kit\nHackerEarth: Has Interview Preparation Tests HackerEarth is also a nice place to prepare. They have the Interview preparations programs. Another really nice thing that they have is a mock assessment of coding tests by some companies, like Adobe, Google, Amazon, and Facebook. It is very helpful.\nLeetCode Another great resource is LeetCode. It has preparations and specific questions for interviews\nOthers With the three above you probably are covered, but you can also try Exercism and AlgoExpert\nBrand statement One good tip is to think of yourself as a brand, as you are providing a service for the company that will hire you. Think in this way, I found it useful to create a Brand statement about myself. The points below can help guide you in brand statement creation.\nWhat are you best at (Value) Whom you serve (Audience) How you do it uniquely (Unique Selling Point) What are the 3 things you do that add value? What 3 words would people use to describe you? Brag file Another thing that is good is to collect some information about situations where your boss or coworker compliments your job. This can help you in the interview when they ask related questions or can help you identify your strengths and weaknesses.\nInterview questions I am not an expert in interviews but I collected some interview questions that you can practice or at least think of a response to.\nThere are usually two types of interviews, competency-based interviews, and strength-based Interviews. The table below summarizes the differences.\nTypes of interview questions\nStrength-based Interviews Questions What are you good at? What do you enjoy doing in your spare time? When are you at your best? Tell me something you are particularly proud of What do you find is always left until the last minute or left undone on your to-do list? What would you say is your biggest weakness? What qualities would you bring to the team? When would your friends and family say you were at your happiest? Tell me an activity or task that comes easily to you. What were your favorite subjects at school? What activities give you an energy buzz? What part of your job do you enjoy the least? What do you say is your best day? Situational-Based Interviews Questions Here a good tip is to follow the STAR model. STAR Stands for Situation, Task, Action, and Result. The image below summarizes it.\nStar Model (I don\u0026rsquo;t recall the source)\nYou should spend most of your time in the action part, where you made the difference.\nWhat is your biggest weakness? What is your biggest achievement? Why do you want to work for us? What type of employee are you going to be? How are you going to add value to my business? Can you give me an example of when you have worked on a team? Can you describe a challenging project/activity that you have planned and taken through to conclusion? What (if anything) would you do differently next time? Describe a situation where you have implemented a change Tell me about a time when you have influenced someone else Tell me a time when you have had to persuade other people to do something they did not want to do What\u0026rsquo;s important to you in company culture? This is the preparation guide for interviews and job seeking for software engineers based on my experience looking for jobs. I hope that it helps you.\nGood luck!\n","permalink":"https://luizvieira.me/interview-preparation-guide-software-engineering/","summary":"I have compiled the list of resources and questions that will help prepare for the interview and in the process of looking for a Software Engineering Job","title":"Software Engineering Interview Preparation Guide"},{"content":"Porter\u0026rsquo;s 5 forces is a model that helps to identify and analyze 5 competitive forces that are linked to the company\u0026rsquo;s profitability.\nThe tool was created by Harvard Business School professor Michael Porter to analyze an industry\u0026rsquo;s attractiveness and likely profitability. Since its publication in 1979, it has become one of the most popular and highly regarded business strategy tools.\nPorter acknowledged that organizations are likely to watch their rivals closely, but he encouraged them to look beyond their competitors\u0026rsquo; actions and examine what other factors could impact the business environment. He identified five forces that make up the competitive environment that can hurt your profitability.\nPorter\u0026rsquo;s 5 forces help explain why different industries are able to maintain different levels of profitability.\nWe as investors can use this model to compare different stocks and identify which has the greatest competitive advantages and which has the best chance of a brighter future.\nIndustry competition Analyze the number and strength of your competitors. How many rivals do you have? Who are they and how does the quality of their products and services compare to yours?\nWhere rivalry is intense, companies can attract customers with aggressive price cuts and high-impact marketing campaigns. Also, in markets with many rivals, your suppliers and buyers may go elsewhere if they feel they are not getting a good deal from you.\nOn the other hand, where competitive rivalry is minimal and no one else does what you do, you are likely to have tremendous strength and healthy profits.\nSuppliers\u0026rsquo; bargaining power It is determined by how easily your suppliers raise their prices. How many potential vendors do you have? How unique is the product or service they provide and how expensive would it be to switch from one supplier to another?\nThe more you choose, the easier it will be to switch to a cheaper alternative. But the fewer suppliers there are and the more you need their help, the stronger your position and ability to charge more. This can affect your profit.\nBuyers\u0026rsquo; bargaining power Here, you wonder how easy it is for buyers to lower their prices. How many buyers are there and how big are their orders? How much would it cost them to switch from their products and services to those of a rival? Are your buyers strong enough to dictate terms to you?\nWhen you deal with just a few more experienced clients, they have more power, but their power increases if you have a lot of clients.\nThe threat of substitute products This refers to how likely your customers are to find a different way of doing what you do. For example, if you provide a unique software product that automates an important process, people can replace you by running the process manually or by outsourcing it. An easy and cheap replacement to make can weaken your position and threaten your profitability.\nThe threat of new entrants Your position can be affected by people\u0026rsquo;s ability to enter your market. So, think about how easily this can be done. How easy is it to get a foothold in your industry or market? How much would it cost and how rigid is your sector?\nIf you need little money and effort to enter your market and compete effectively, or if you have little protection for key technologies, rivals can quickly enter your market and weaken your position. If you have strong and durable barriers to entry, you can preserve a favorable position and take advantage of it.\nHappy investing!\n","permalink":"https://luizvieira.me/porters-five-forces/","summary":"Porter\u0026rsquo;s 5 forces is a model that helps to identify and analyze 5 competitive forces that are linked to the company\u0026rsquo;s profitability.","title":"Porter's 5 Forces: Find Stocks with Competitive Advantages"},{"content":"I watched a documentary where an unknown investor named Anthony Deden was interviewed by Grant Williams and explores Tony\u0026rsquo;s philosophy. The documentary touched on subjects that I have been pondering in my mind. And in this post, I bring a simple subject, but of great relevance: What is your investment horizon?\nWhat Is an Investment Horizon? Your investment horizon is basically how long you intend to invest, and how long you will have your capital invested.\nFor example, it could be for 6 months, a year, 10 years, 50 years, 2 generations, etc.\nIt is very important to know what your investment horizon is as your allocation decisions will change depending on your investment horizon.\nFor example, if you are going to invest for a 6-month horizon, variable income would not be the best option, since in the short term the possible variations could make you withdraw a smaller amount.\nMy Investment Horizon I had with me that my investment horizon would be my generation. I would like to be invested for the rest of my life and as I don\u0026rsquo;t have children, I still didn\u0026rsquo;t think about an investment horizon of more than one generation. Maybe rethink that horizon now.\nOne thing that is important when making investment decisions is to remember your investment horizon. Because this will help you make a better decision that is more suited to your investment horizon.\nI confess that I haven\u0026rsquo;t always done this, and I have as my homework to try to do in all my decisions.\nI encourage you to reflect: What is your investment horizon?\nYou don\u0026rsquo;t have to answer me that, you just have to answer yourself. I believe that this reflection will help you to make more appropriate decisions.\nHappy investing!\nPhoto by Laib Khaled\n","permalink":"https://luizvieira.me/investment-horizon/","summary":"Knowing your investment horizon  will help you make a better decision that is more suited to you and your goals","title":"What Is Your Investment Horizon and Why It Matters"},{"content":"I\u0026rsquo;m reading the letters to Berkshire Hathaway shareholders and in the 1989 letter, Warren Buffett brings a consolidation of the mistakes in the first 25 years of investing.\nThe same letter tells how his relationship with Coca-Cola began.\nIn the letters, Warren Buffett is very honest about his mistakes. He comments a lot about the mistakes made and about the damage caused by these decisions. I think this is one of his strengths, his honesty, and humility in saying that he makes mistakes, like all of us investors.\nBelow is a summary of Warren Buffett\u0026rsquo;s mistakes in the first 25 years of investing.\nWarren Buffett\u0026rsquo;s mistake #1 According to Buffett, his first mistake was buying control of Berkshire, which, for those who don\u0026rsquo;t know, was a textile manufacturing company.\n“Although I knew their business – textile manufacturing – was unpromising, I was drawn to buy because the price seemed cheap.”\nHere Buffett cites that if you buy a stock priced low enough, you can usually make a decent profit even though the long-term performance might be terrible, but you need to be ready to offload the stock as soon as you see a rally in price. “I call this the “cigarette butt” approach to investing. A cigarette butt found on the street that has only one puff may still not offer much smoke, but “bargain shopping” will make that puff profitable”.\nWith this Buffett concludes that “it is far better to buy a wonderful company at a fair price than a fair company at a wonderful price”\nWarren Buffett\u0026rsquo;s mistake #2 The second mistake Buffett reports is that he has had too many examples of creating bad companies with good management. He cites that \u0026ldquo;Good jockeys will do well on good horses, but not on broken-down nags.\u0026rdquo;\nSo, some companies failed not because of the management, but because they had bad economic characteristics. \u0026ldquo;The same managers employed in a business with good economic characteristics would have achieved fine records. But they were never going to make any progress while running in quicksand.”\nBuffett adds, “when a management with a reputation for brilliance tackles a business with a reputation for bad economics, it is the reputation of the business that remains intact.”\nWarren Buffett\u0026rsquo;s mistake #3 The third mistake cited by Buffett was trying to solve difficult business problems. “After 25 years of buying and supervising a great variety of businesses, Charlie and I have not learned how to solve difficult business problems. What we have learned is to avoid them. To the extent we have been successful, it is because we concentrated on identifying one-foot hurdles that we could step over rather than because we acquired any ability to clear seven-footers”\nBuffett adds: “The finding may seem unfair, but in both business and investments it is usually far more profitable to simply stick with the easy and obvious than it is to resolve the difficult.”\nWarren Buffett\u0026rsquo;s mistake #4 Buffett\u0026rsquo;s most surprising finding in his first 25 years of investing was that decent, smart managers don\u0026rsquo;t always make rational decisions.\n“My most surprising discovery: the overwhelming importance in business of an unseen force that we might call \u0026rsquo;the institutional imperative\u0026rsquo;. [\u0026hellip;] I thought then that decent, intelligent, and experienced managers would automatically make rational business decisions. But I learned over time that isn\u0026rsquo;t so. Instead, rationality frequently wilts when the institutional imperative comes into play.”\nTo give some examples, he cites 4 of them: (1) As if governed by Newton\u0026rsquo;s First Law of Motion, an institution will resist any change in its current direction; (2) Just as work expands to fill available time, corporate projects or acquisitions will materialize to soak up available funds; (3) Any business craving of the leader, however foolish, will be quickly supported by detailed rate-of-return and strategic studies prepared by his troops; and (4) The behavior of peer companies, whether they are expanding, acquiring, setting executive compensation or whatever, will be mindlessly imitated.”\nHe complements: “After making some expensive mistakes because I ignored the power of the imperative, I have tried to organize and manage Berkshire in ways that minimize its influence. Furthermore, Charlie and I have attempted to concentrate our investments in companies that appear alert to the problem.”\nWarren Buffett\u0026rsquo;s mistake #5 The 5th mistake mentioned is related to the people to do business with. Avoid doing a good deal with a bad person.\n“After some other mistakes, I learned to go into business only with people whom I like, trust, and admire. As I noted before, this policy of itself will not ensure success.\u0026rdquo;\n\u0026ldquo;However, an owner - or investor - can accomplish wonders if he manages to associate himself with such people in businesses that possess decent economic characteristics. Conversely, we do not wish to join with managers who lack admirable qualities, no matter how attractive the prospects of their business are. We\u0026rsquo;ve never succeeded in making a good deal with a bad person.”\nWarren Buffett\u0026rsquo;s mistake #6 He also cites that mistakes that he made are not always from commission but some were from omission.\n“Some of my worst mistakes were not publicly visible. These were stock and business purchases whose virtues I understood and yet didn\u0026rsquo;t make. It\u0026rsquo;s no sin to miss a great opportunity outside one\u0026rsquo;s area of competence. But I have passed on a couple of really big purchases that were served up to me on a platter and that I was fully capable of understanding. For Berkshire\u0026rsquo;s shareholders, myself included, the cost of this thumb-sucking has been huge.”\nWarren Buffett\u0026rsquo;s mistake #7 In the last error listed in his letter, Buffett ends by saying that his conservatism may seem like a mistake, but it wasn\u0026rsquo;t.\n“Our consistently-conservative financial policies may appear to have been a mistake, but in my view were not. In retrospect, it is clear that significantly higher, though still conventional, leverage ratios at Berkshire would have produced considerably better returns on equity than the 23.8% we have actually averaged.\u0026rdquo;\n\u0026ldquo;We might have seen only a 1% chance that some shock factor, external or internal, would cause a conventional debt ratio to produce a result falling somewhere between temporary anguish and default. We wouldn\u0026rsquo;t have liked those 99:1 odds - and never will.\u0026rdquo;\n\u0026ldquo;A small chance of distress or disgrace cannot, in our view, be offset by a large chance of extra returns. If your actions are sensible, you are certain to get good results; in most such cases, leverage just moves things along faster. Charlie and I have never been in a big hurry: We enjoy the process far more than the proceeds - though we have learned to live with those also.”\nI hope that learning from Warren Buffett\u0026rsquo;s mistakes can help us become better investors.\nFor more of his lessons, see 10 important pieces of investment advice from Warren Buffett.\nHappy investing!\nPhoto: Rick Wilking/Reuters\n","permalink":"https://luizvieira.me/warren-buffett-mistakes/","summary":"Learning from Warren Buffett\u0026rsquo;s mistakes can make us better investors. Here is a list of his errors in the first 25 years of Berkshire Hathaway","title":"Warren Buffett's Mistakes in His First 25 Years at Berkshire"},{"content":"As I\u0026rsquo;ve mentioned a few times here on this blog, I have been reading Warren Buffett\u0026rsquo;s letters written to Berkshire Hathaway shareholders starting with the 1977 letter. In the 1989 letter, Warren Buffett tells a little about his relationship with Coca-Cola and how everything started.\nThe same letter also lists his mistakes in the first 25 years.\nBuffett is known for drinking 5 Cokes a day and still does. In addition to being an active consumer, Buffett bought Coca-Cola stock in 1988.\nIn the 1989 letter, he tells a little about the story of how his relationship with Coca-Cola began.\nHe begins his story by even making fun of himself, saying, “This Coca-Cola investment provides yet another example of the incredible speed with which its president responds to investment opportunities, no matter how obscure or well-disguised they may be.”\nThat\u0026rsquo;s because Buffett says he drank his first Coke in 1935 or 1936 and only in 1988 did he buy shares in the company.\nIn 1936, Buffett began buying Cokes at a price of six Cokes for 25 cents on the dollar for Buffett \u0026amp; Son, the family grocery store, to sell in the neighborhood for 5 cents each.\nBuffett says that, in this period, the extraordinary attractiveness of the consumer and commercial possibilities of the product was already observed.\nhow it all began with Coca-Cola “I continued to observe these qualities for the next 52 years as Coca-Cola covered the world. During this period, however, I carefully avoided buying even a single stock, instead of allocating large portions of my net worth to railroad companies, windmill manufacturers, jewelry producers, textile companies, commercial stamp issuers, and the like. (If you think I\u0026rsquo;m doing it, I can provide the names.) It wasn\u0026rsquo;t until the summer of 1988 that my brain finally made contact with my eyes.”\n“What I realized was clear and fascinating. After being a bit adrift in the 1970s, Coca-Cola in 1981 became a new company with Roberto Goizueta moving to CEO. Roberto, along with Don Keough, once my neighbor across the street in Omaha, rethought and focused company policies and energetically executed them. What was already the most ubiquitous product in the world has gained new momentum, with overseas sales virtually exploding.”\n“Of course, we should have started buying Coke much earlier, right after Roberto and Don started running things. In fact, if I had thought about it, I would have convinced my grandfather to sell the grocery store in 1936 and put all the money in Coca-Cola stock. I learned my lesson: my response time to the next glaringly attractive idea will be reduced to less than 50 years.”\nThis is the story of how the relationship between Warren Buffett and Coca-Cola began.\nThis can teach us that we often see a product or service that has potential, but we don\u0026rsquo;t think about being a part of it by buying stock in the company.\nEven Warren Buffett, who is known as the greatest investor, can take more than 50 years to see an opportunity that was in front of him almost every day.\nI hope you enjoyed the story.\nHappy investing!\nPhoto by Rick Wilking/Reuters\n","permalink":"https://luizvieira.me/warren-buffett-coca-cola/","summary":"Warren Buffett history tells a very important lesson, this lesson can help investors not to miss great companies","title":"Warren Buffett and Coca-Cola: How It Began in 1988"},{"content":"You may have seen someone react abruptly to situations where you thought they would react in an entirely different way. But you may be suffering from the cognitive bias of the hot-cold empathy gap\nWhat is the Hot-Cold Empathy Gap? It is difficult for humans to predict how they will behave in the future, in a different emotional state than they are currently.\nA hot-cold empathy gap is a cognitive bias in which people underestimate the influences of visceral impulses on their own attitudes, preferences, and behaviors.\nThe bottom line is that when we are in a calm and comfortable state, it is difficult to predict how we will be in a stressful situation and therefore difficult to predict how we will behave.\nHot-cold empathy gaps can be analyzed according to their direction:\nHot-to-cold People under the influence of visceral factors (warm state) do not fully understand how much their behavior and preferences are being driven by their current state; rather, they think that these short-term goals reflect their general, long-term preferences.\nCold-to-hot People in a cold state have difficulty imagining themselves in hot states, thus minimizing the motivational force of visceral impulses. This leads to unpreparedness when visceral forces inevitably arise.\nWhat is the importance of investments? As you can see, it is difficult to predict our behavior when we are in another state.\nWe think that when we see a crisis with big drops, we will behave calmly and we will “just buy”.\nBut unfortunately, it will not be so for most of us. Many will sell, due to being in a state of high emotion.\nBeing aware of the existence of this behavioral bias will help you to know that emotions can impair your logical and rational judgment.\nIn times of heat, the best choice is often to do nothing. Waiting for you to get cold to endorse decisions in a more rational way.\nSo stay calm and wait for your hot side to cool down before making any long-term decisions.\nHappy investing!\nPhoto by Gilberte Dimicolis on Flickr\n","permalink":"https://luizvieira.me/hot-cold-empathy-gap/","summary":"Find out what is the hot-cold empathy gap and learn what the effects are on you and the importance of being aware of it when investing.","title":"Hot-Cold Empathy Gap: How This Bias Affects Investing"},{"content":"Terms and Conditions The following terms and conditions govern all use of the luizvieira.me website, including all content, services, and products available on or through the site, collectively referred to as the \u0026ldquo;Website.\u0026rdquo; The Website is owned and operated by Luiz Vieira (“Luiz Vieira”) and is offered subject to your acceptance of all terms, conditions, and policies (including Luiz Vieira’s Privacy Policy) published by Luiz Vieira (collectively, the “Agreement”).\nPlease read this Agreement carefully before accessing or using the Website. By accessing or using any part of the site, you agree to be bound by these terms and conditions. If you do not agree to all terms and conditions of this Agreement, you may not access the Website or use any services. Access is limited to individuals who are at least 13 years old.\n1. Responsibility of Contributors If you operate a blog, comment on a blog, post material, post links, or otherwise make content available through the Website, you are fully responsible for the content of, and any harm resulting from, that content. By making content available, you represent and warrant that:\nThe content does not infringe on any third-party intellectual property rights, including copyrights, patents, trademarks, or trade secrets. You have permission from your employer to post the content, if applicable, or have waived any relevant rights. You have complied with all third-party licenses related to the content. The content does not contain viruses, malware, or harmful content. The content is not spam, misleading, or intended to deceive others. The content is not defamatory, does not incite violence, and does not violate privacy rights. The content is not advertised through unsolicited promotional methods. The content is accurately labeled and described, especially if it contains computer code. Luiz Vieira reserves the right to refuse or remove any content that violates Luiz Vieira’s policies or is deemed objectionable.\n2. Responsibility of Website Visitors Luiz Vieira does not review all material posted on the Website and cannot be responsible for its content, use, or effects. By operating the Website, Luiz Vieira does not represent or imply endorsement of the material posted. Visitors are responsible for taking precautions to protect themselves and their computer systems from harmful or destructive content.\n3. Content Posted on Other Websites Luiz Vieira has not reviewed all content made available through websites linking to or from luizvieira.me and is not responsible for their content or use. Luiz Vieira does not endorse these external websites. Visitors are responsible for taking precautions to protect themselves from harmful content on third-party websites.\n4. Copyright Infringement and DMCA Policy Luiz Vieira respects others’ intellectual property rights. If you believe material on luizvieira.me violates your copyright, you may notify Luiz Vieira according to the Digital Millennium Copyright Act (DMCA). Luiz Vieira may, at its discretion, remove or disable access to infringing content and may terminate the accounts of repeat infringers.\n5. Corrections, Suggestions, and Complaints Comments, suggestions, and complaints about errors on the Website can be submitted via email at legal [at] luizvieira (dot) me.\n6. Intellectual Property This Agreement does not transfer any Luiz Vieira or third-party intellectual property to you. All trademarks, service marks, graphics, and logos used in connection with luizvieira.me are Luiz Vieira’s or third parties\u0026rsquo; property. You are granted no right or license to use any trademarks. By posting content, you grant Luiz Vieira a worldwide, non-exclusive license to use, modify, and distribute the content.\n7. Changes Luiz Vieira reserves the right to modify or replace any part of this Agreement at its discretion. Continued use of the Website following changes constitutes acceptance of those changes. New features or services are also subject to this Agreement.\n8. Termination Luiz Vieira may terminate access to the Website at any time, with or without notice. Upon termination, all provisions of this Agreement that should survive termination shall continue to apply.\n9. Disclaimer of Warranties The Website is provided “as is.” Luiz Vieira disclaims all warranties, express or implied, including merchantability, fitness for a particular purpose, and non-infringement. Luiz Vieira makes no warranty that the Website will be error-free or uninterrupted.\n10. Limitation of Liability In no event shall Luiz Vieira be liable for any indirect, incidental, or consequential damages, or any loss of data, profits, or interruption of business arising from this Agreement. Luiz Vieira’s liability shall not exceed the amount paid for services under this Agreement in the prior twelve months, subject to applicable law.\n11. General Representation and Warranty You represent and warrant that your use of the Website will comply with Luiz Vieira’s Privacy Policy, this Agreement, and applicable laws and regulations.\n12. Indemnification You agree to indemnify and hold harmless Luiz Vieira, its contractors, and its licensors from any claims or expenses arising from your use of the Website, including any breach of this Agreement.\n13. Miscellaneous This Agreement constitutes the entire agreement between Luiz Vieira and you concerning the subject matter hereof. Any access to or use of the Website will be governed by the laws of British Columbia, Canada. Disputes arising from this Agreement will be resolved in the province of British Columbia. The Agreement is binding upon the parties, their successors, and permitted assigns.\nFor any questions or concerns, please contact Luiz Vieira at legal [at] luizvieira (dot) me.\n","permalink":"https://luizvieira.me/terms-of-service/","summary":"\u003ch2 id=\"terms-and-conditions\"\u003eTerms and Conditions\u003c/h2\u003e\n\u003cp\u003eThe following terms and conditions govern all use of the \u003ca href=\"https://luizvieira.me\" target=\"_blank\"\u003eluizvieira.me\u003c/a\u003e website, including all content, services, and products available on or through the site, collectively referred to as the \u0026ldquo;Website.\u0026rdquo; The Website is owned and operated by Luiz Vieira (“Luiz Vieira”) and is offered subject to your acceptance of all terms, conditions, and policies (including Luiz Vieira’s Privacy Policy) published by Luiz Vieira (collectively, the “Agreement”).\u003c/p\u003e\n\u003cp\u003ePlease read this Agreement carefully before accessing or using the Website. By accessing or using any part of the site, you agree to be bound by these terms and conditions. If you do not agree to all terms and conditions of this Agreement, you may not access the Website or use any services. Access is limited to individuals who are at least 13 years old.\u003c/p\u003e","title":"Terms of Service"},{"content":"This website (the “Blog”) is created and authored by Luiz Vieira (the “Content Creator”) and is provided solely for informational and entertainment purposes. The opinions shared on the Blog are those of the Content Creator and, occasionally, guest contributors. They should not be considered as an official description of services provided by Luiz Vieira.\nThe information provided here is intended for general educational purposes within the financial industry. It is not personalized advice or specific recommendations for any individual, nor does it constitute guidance on any security or investment product. Opinions expressed on the Blog are subject to change at any time without notice.\nNothing on this Blog should be taken as investment advice, performance data, or a recommendation for any specific security, investment product, transaction, or strategy. As we do not know your unique financial situation, objectives, or needs, any opinions or information shared on this Blog are solely informational. We strongly recommend consulting a licensed professional for personalized financial advice.\nComparisons with indices, if mentioned, refer to unmanaged indices that cannot be directly invested in. All securities involve risk, and past performance does not guarantee future results.\nThe Blog may contain links to other articles or information that we find interesting. These are shared for informational purposes only and do not constitute endorsements from us or any associated parties.\nWe enjoy sharing book reviews, some of which may link to Amazon. These links are not affiliated, and we receive no compensation for purchases made through them.\nFor more details, please see our Privacy Policy\nContact Us For any questions or concerns regarding your privacy, please contact us at legal [at] luizvieira (dot) me.\nLuiz Vieira\n","permalink":"https://luizvieira.me/disclaimer/","summary":"Check the disclaimers of my blog","title":"Disclaimer"},{"content":"While studying for the CELPIP-G test, I made some notes of each task that help me to prepare for the test. These are the tips that I can give you.\nThe P for each question means Preparation Time and the S means Speaking Time.\nTASK 1. Giving advice - P: 30s S: 90s Speak directly to the person What matters in your response is how well you support your advice with clear and persuading reasons Give advice, not orders At least one advantage and one disadvantage, the best is two of each TASK 2. Talk about a personal experience - P: 30s S: 60s Usually in the past tense Quickly decide what to talk about and spend the rest of the time thinking about events of the party Use descriptive language Tell a good story Try to conclude the sentence before the time ends Task 3, Describing a scene - P: 30s S: 60s Use the 5 Ws to help (who/what/where/when/why) Do not attempt to describe all the things in the picture Use a lot of prepositions of place (next to/behind/between/etc) Be as descriptive as possible to tell a story or pass feelings. Give details of what is happening Imagine the other person cannot see the picture Task 4: Making predictions - P: 30s S: 60s Use future tense Use reasons for the prediction and tell a story Choose the things that you can better explain the prediction. Use details Relate to something else in the picture Use precise vocabulary Task 5A: Comparing and persuading - P: 60s (No speaking) use the 60s to choose one. Jot down the reasons why you choose this (it will be good for convincing) Task 5B: Comparing and persuading - P: 60s S: 60s look for differences choose at least 3 ways your fridge is better try to not repeat the information in the boxes Remember that you are trying to persuade your family member. finish with an affirmative opinion TASK 6: Dealing with a difficult situation - P: 60s S: 60s Effectively justify the decision Give strong reasons for your decision Be careful as you don’t want to make the person upset or angry Use logic and show how the arguments are related Use a firm, yet polite and well-mannered speaking style and tone of voice Task 7: Express opinions - P: 30s S: 90s State the opinion and support it with logical reasoning Choose quick, list reasons Start with the option you choose and explain why that Start with phrases that clearly state the reason Task 8: Describing an unusual situation - P: 30s S: 60s Think about the details you describe Take note of the situation described in the prompt List the details Think of words that describe precisely what you see or think of simpler words that can explain the same thing. Remember that the person on the other side cannot see the image that you are seeing. These are some tips that helped me. But in truth, in the test time, it is difficult to remember everything, so the best way is to practice them a lot before. Also, consult other materials that can help you, like their preparation materials and the sample tests.\nIf you are moving to Canada, you may also find our New to Canada guide useful.\nGood luck with it!\nPhoto by Ben Mullins on Unsplash\n","permalink":"https://luizvieira.me/celpip-speaking-tips/","summary":"While studying for the CELPIP-G test, I made some notes of each task that help me to prepare for the test. These are the tips that I can give you.","title":"CELPIP-G Speaking Tips"},{"content":"I read the book The Most Important Thing by Howard Marks and in this post, I will list the 20 most important things that were cited in the book. The book is excellent, I really enjoyed reading it.\nAs the author himself says, the book is much more a book on investor mindset than a book on how to select assets. Howard Marks says that there is not ONE thing more important when it comes to investing, but he lists 20 things that are the most important things in his opinion.\nBut who is Howard Marks?\nHoward Marks Howard Marks is the co-founder and co-chairman of Oaktree Capital Management, a Los Angeles-based distressed debt investor.\nMarks started his career at Citibank, where he started a portfolio of high-yield bonds after meeting with the king of junk bonds, Michael Milken.\nHe became an asset manager at TCW, where he met Oaktree co-founder Bruce Karsh. The duo left with four colleagues in 1995 to found their own store.\nIn September 2019, Brookfield Asset Management acquired 61% of Oaktree for an estimated $4.9 billion in cash and stock. Marks now sits on Brookfield\u0026rsquo;s board.\nHe and Karsh still lead Oaktree, which continues to operate independently of Brookfield. His stake in the company is now around 8%.\nThe Most Important Thing book by Howard Marks In this case, the 20 most important things. I will list below the 20 most important things in the author\u0026rsquo;s view with a brief comment. I recommend reading the book, it is an excellent book.\n1. The most important thing is… Second Level Thinking According to the author, first-level thinking is simplistic and superficial, and almost anyone can do it (a bad sign for anything that involves an attempt at superiority). First-level thinkers look for simple formulas and easy answers. Second-tier thinkers know that investment success is the antithesis of simplicity. That\u0026rsquo;s not to say you don\u0026rsquo;t find many people who try their hardest to look simple.\n2. The most important thing is… Understand the efficiency of the market (and its limitations) The author states that the market is efficient in terms of speed of information analysis, but not in terms of being right. He agrees that investors are working hard to analyze information and its impacts, but that consensus is not necessarily correct.\n3. The most important thing is… Value For the investment to be reliably successful, an accurate estimate of intrinsic value is the indispensable starting point. Without it, any hope of consistent success as an investor is just that: hope.\n4. The most important thing is… The relationship between price and value Of all the possible routes to investment profit, buying cheap is clearly the most reliable. Even so, it is not certain that it works. You could be wrong about the current value. Or events may arise that reduce the value.\nTrying to buy below value isn\u0026rsquo;t foolproof, but it\u0026rsquo;s the best chance we have.\n5. The most important thing is… Understanding the risk Investing consists of exactly one thing: dealing with the future. And since none of us can know the future with certainty, the risk is inevitable. So dealing with risk is essential – I think the essential – element of investing.\n6. The most important thing is… Recognize the risk A key element in creating risk is the belief that risk is low, perhaps even disappears altogether.\nThis belief drives up prices and leads to embracing risky stocks despite low prospective returns.\nAs with the opportunities to make money, the degree of risk present in the market derives from the behavior of participants, not from securities, strategies, and institutions.\nPeople vastly overestimate their ability to recognize risks and underestimate what it takes to avoid them; thus, they unknowingly accept risks and, in so doing, contribute to their creation.\n7. The most important thing is… Risk Control Whatever few prizes are presented for risk control, they are never delivered in good times. The reason is that the risk is secret, invisible. The risk – the possibility of loss – is not observable. What is observable is loss, and loss usually happens only when risk collides with negative events.\n8. The most important thing is… Be aware of cycles According to the author, it is essential to remember that almost everything is cyclical. There\u0026rsquo;s little I\u0026rsquo;m sure of, but these things are true: Cycles always prevail eventually. Nothing goes in one direction forever. Trees don\u0026rsquo;t grow into the sky. Few things go to zero. And there is little that is as dangerous to the health of investors as the insistence on extrapolating today\u0026rsquo;s events into the future.\n9. The most important thing is… Pendulum Awareness When things are going well and prices are high, investors rush to buy, forgetting all prudence. So when there is chaos and assets are at risk, they lose all willingness to take risks and rush to sell. And it will always be so.\n10. The most important thing is… Fighting negative influences Inefficiencies – incorrect pricing, misperceptions, mistakes made by others – offer potential opportunities for superior performance. Exploiting them is, in fact, the only path to consistent performance. To differentiate yourself from others, you need to be on the right side of these mistakes.\n11. The most important thing is… Being Contrary The author cites that it\u0026rsquo;s important that you don\u0026rsquo;t follow the herd, don\u0026rsquo;t be a trend follower. But that will be difficult for you as an investor.\n12. The most important thing is… Finding bargains The author cites that our objective should not be to find good assets, but good purchases. So it\u0026rsquo;s not what you buy, but how much you pay for it.\n13. The most important thing is… Patient Opportunity In this chapter, the author says that sometimes the best thing to do is nothing. That is, waiting for bargains to appear is often the best strategy.\n14. The most important thing is… Knowing what you don\u0026rsquo;t know In this chapter, the author says that we have to accept that predicting the future with consistency is for few (maybe no one), and knowing this makes you focus on things you have control over.\n15. The most important thing is… Having a sense of where we are According to the author, the market is cyclical and we cannot predict the future, what we have to do is know where we are in the cycle. This will help us make better decisions regarding the allocation of our assets.\n16. The most important thing is… Appreciate the role of luck According to the author, luck is an important factor and the investor should appreciate and know that some investments do not make him a genius, but they were just strokes of luck.\n17. The most important thing is… Investing defensively The author argues that we should not always try to win the market, but not try to lose. He says that in bull markets, it\u0026rsquo;s a good strategy to just follow the market, and actually win in bear markets.\n18. The most important thing is… Avoiding pitfalls The author believes that most mistakes are primarily analytical/intellectual or psychological and emotional and so we must understand what are the traps that make us make mistakes.\n19. The most important thing is… Generate value The author mentions that no matter how difficult it is to generate value, it should be our goal if we choose to select stocks.\n20. The most important thing is… Putting it all together In this final chapter, the author summarizes the previous chapters in a simplified way.\nconcluding I really liked the book, it brings several important points that we sometimes neglect when investing.\nI recommend reading for everyone.\nHappy investing!\nPhoto by Peter Murphy\n","permalink":"https://luizvieira.me/20-most-important-things-howard-marks/","summary":"Check out the 20 most important things to the average investor by Howard Marks in his famous book The Most Important Things","title":"The 20 Most Important Things by Howard Marks"},{"content":"Privacy Policy Your privacy is important to us. It is Luiz Vieira’s policy to respect your privacy and comply with applicable laws and regulations regarding any personal information we may collect about you, including across our website, luizvieira.me, and any other sites we own and operate.\nThis policy is effective as of 7 May 2022 and was last updated on 7 May 2022.\nInformation We Collect We collect information that you knowingly and actively provide when using or participating in any of our services and promotions, as well as any data automatically sent by your devices when accessing our products and services.\nLog Data When you visit our website, our servers may automatically log standard data provided by your web browser, such as your device’s Internet Protocol (IP) address, browser type and version, the pages you visit, the time and date of your visit, the time spent on each page, and other details about your visit. While this information may not personally identify you by itself, it could potentially be combined with other data to identify individuals.\nCollection and Use of Information We may collect personal information when you:\nAccess our content via a mobile device or web browser Contact us through email, social media, or similar technologies Mention us on social media We may collect, hold, use, and disclose information for the following purposes, and personal information will not be further processed in ways incompatible with these purposes. Additionally, we may combine information collected with general information or research data received from other trusted sources.\nSecurity of Your Personal Information We take commercially reasonable steps to protect your personal information from loss, theft, and unauthorized access, disclosure, copying, use, or modification. However, no method of electronic transmission or storage is 100% secure, and we cannot guarantee absolute data security. You are responsible for selecting secure passwords and for maintaining the security of your own information.\nHow Long We Keep Your Personal Information We retain personal information only as long as necessary for the purposes outlined in this policy, unless required by law, accounting, or other legal obligations. When no longer needed, personal information is deleted or anonymized.\nChildren’s Privacy We do not direct our products or services to children under 13 and do not knowingly collect personal information from them.\nDisclosure of Personal Information to Third Parties We may disclose personal information to:\nAffiliates, subsidiaries, or parent companies Third-party service providers for services like data storage, hosting, and analytics Employees, contractors, and related entities Agents, business partners, and sponsors of competitions or promotions Courts, tribunals, regulatory authorities, and law enforcement as required by law Other third parties assisting us in providing information, products, services, or direct marketing International Transfers of Personal Information Your personal information may be stored and processed in locations where we or our partners maintain facilities. These locations may not have the same data protection laws as your home country. We will handle such transfers in compliance with applicable law and with safeguards in place per this privacy policy.\nYour Rights and Controlling Your Personal Information You retain the right to withhold personal information, understanding that it may affect your experience on our website. We will not discriminate against you for exercising your rights over your personal information. You may request details of any personal information we hold about you.\nIf you believe we hold inaccurate or outdated information, please contact us, and we will make the necessary corrections. You may also unsubscribe from our communications at any time.\nIn the event of a data protection law breach, you can file a complaint with us. We will investigate and respond promptly. You also have the right to contact a regulatory body regarding your complaint.\nUse of Cookies We use cookies to collect information about you and your activity on our site. Cookies help us understand how you use our site, allowing us to serve content based on your preferences. For more information, refer to our [Cookie Policy].\nLimits of Our Policy Our website may link to external sites not operated by us. We have no control over the content and policies of those sites and cannot assume responsibility for their privacy practices.\nChanges to This Policy We may update this policy to reflect changes in our business practices, acceptable practices, or regulatory requirements. Changes will be posted at the same link where you access this privacy policy. Where required by law, we will seek your permission or provide you the opportunity to opt in or opt out of any new uses of your personal information.\nContact Us For any questions or concerns regarding your privacy, please contact us at:\nEmail: legal [at] luizvieira (dot) me\nLuiz Vieira\n","permalink":"https://luizvieira.me/privacy-policy/","summary":"\u003ch2 id=\"privacy-policy\"\u003ePrivacy Policy\u003c/h2\u003e\n\u003cp\u003eYour privacy is important to us. It is Luiz Vieira’s policy to respect your privacy and comply with applicable laws and regulations regarding any personal information we may collect about you, including across our website, luizvieira.me, and any other sites we own and operate.\u003c/p\u003e\n\u003cp\u003eThis policy is effective as of 7 May 2022 and was last updated on 7 May 2022.\u003c/p\u003e\n\u003ch3 id=\"information-we-collect\"\u003eInformation We Collect\u003c/h3\u003e\n\u003cp\u003eWe collect information that you knowingly and actively provide when using or participating in any of our services and promotions, as well as any data automatically sent by your devices when accessing our products and services.\u003c/p\u003e","title":"Privacy Policy"},{"content":"Before understanding what a Service Level Objective (SLO) is and how to do those, we first need to understand what a Service Level Indicator (SLI) is.\nAccording to Google Site Reliability Engineering Book, \u0026ldquo;SLI is a service level indicator —a carefully defined quantitative measure of some aspect of the level of service that is provided\u0026rdquo;\nSo basically, SLI is the measure, what we are measuring. And with the SLI, we can create an SLO.\nAn SLO is a service level objective: a target value or range of values for a service level that is measured by an SLI. Usually, a structure for SLOs is something like SLI ≤ target, or lower bound ≤ SLI ≤ upper bound. One example of an SLO could be for an API to have an average latency of less than 100 milliseconds.\nBut how do we know which is the right objective for each of the SLIs that we want to monitor? We tech people should not handle this burden alone, choosing targets (SLOs) is not a purely technical activity because of the product and business implications, which should be reflected in both the SLIs and SLOs that are selected.\nSo, the best solution is to have the engineering team and the product team together to better decide which are the SLIs and SLOs that the product will have because sometimes it will be necessary to have some tradeoff between speed of delivery and quality.\nThis image from Atlassian is a good summary.\nSLA vs SLOs vs SLIs\nAs the precursor of the SRE, Google\u0026rsquo;s team learned a few lessons that can help make the discussion between the engineers and product more productive.\nDon’t pick a target based on current performance The natural way is to look at the system in the current state to base the SLOs. But \u0026ldquo;while understanding the merits and limits of a system is essential, adopting values without reflection may lock you into supporting a system that requires heroic efforts to meet its targets, and that cannot be improved without significant redesign.\u0026rdquo;\nKeep it simple Do not overcomplicate things, as \u0026ldquo;complicated aggregations in SLIs can obscure changes to system performance, and are also harder to reason about.\u0026rdquo;\nAvoid absolutes Nothing is absolute, \u0026ldquo;while it’s tempting to ask for a system that can scale its load \u0026ldquo;infinitely\u0026rdquo; without any latency increase and that is \u0026ldquo;always\u0026rdquo; available, this requirement is unrealistic.\u0026rdquo;\nTo get close to these absolutes, you will probably take a long time to design and build and of course, it will be expensive to operate. This brings a lot of costs and time that your users will never notice or require. The idea is to deliver the best for your users, not more.\nHave as few SLOs as possible Less is more, \u0026ldquo;choose just enough SLOs to provide good coverage of your system’s attributes. Defend the SLOs you pick: if you can’t ever win a conversation about priorities by quoting a particular SLO, it’s probably not worth having that SLO\u0026rdquo;\nPerfection can wait Perfect is the enemy of good. It is better to define SLO and you can always refine the definitions and targets over time as you learn about a system’s behavior and your users. \u0026ldquo;It’s better to start with a loose target that you tighten than to choose an overly strict target that has to be relaxed when you discover it’s unattainable.\u0026rdquo;\nService Level Objectives (SLOs) are a very good way to prioritize the work of Site Reliability Engineers (SREs) and developers because they measure and reflect what users care about. \u0026ldquo;A good SLO is a helpful, legitimate forcing function for a development team. But a poorly thought-out SLO can result in wasted work if a team uses heroic efforts to meet an overly aggressive SLO, or a bad product if the SLO is too lax. SLOs are a massive lever: use them wisely.\u0026rdquo;\nHappy coding!\nSources: This post was mainly based on the free book Site Reliability Engineering\n","permalink":"https://luizvieira.me/choosing-service-level-objectives-slo/","summary":"Learn from the mistakes and experience of Google\u0026rsquo;s team how to choose the Service Level Objectives (SLOs) for your services","title":"Choosing Service Level Objectives (SLOs): Google's Lessons"},{"content":"Peter Lynch argues in the book “One Up On Wall Street” that individual investors have several advantages over professional investors. Selecting unknown stocks is one of them, and to improve our chances of success using these advantages, check out the 13 attributes of a perfect company by Peter Lynch.\nSome of the advantages of individual investors are related to knowing companies before analysts. To select companies, Peter lists 13 important attributes of a perfect company.\n13 Attributes of a Perfect Company by Peter Lynch According to the author, \u0026ldquo;the \u0026lsquo;any idiot can run this business\u0026rsquo; aspect is a characteristic of the perfect company, the kind of action I dreamed of. You will never find the perfect company, but if you could imagine it, you would know how to recognize favorable attributes”, of which the 13 most important are listed below.\n(1) This sounds boring – or rather: ridiculous “The perfect action would have to be associated with the perfect company, the perfect company would have to be engaged in a perfectly simple business, and that perfectly simple business would have a perfectly boring name. The more tedious, the better.”\nThe author cites examples such as Automatic Data Processing, Bob Evans Farms, and Pep Boys – Manny, Moe, and Jack which have tedious names. He comments that these are the companies you\u0026rsquo;ll never hear about at a barbecue, as the names are ridiculous. The author mentions that companies that have beautiful names are more likely to be in the news.\n“If you find an opportunity early enough, you\u0026rsquo;ll probably get a few dollars off the price just because of the weirdness or vulgarity of the name, which is why I\u0026rsquo;m always on the lookout for a Pep Boys – Manny, Moe, and Jack.”\n(2) “The company does something boring “I get even more excited when a company with a boring name also does something boring”\nIf a company with excellent earnings and a strong balance sheet also engages in tedious activities, that gives you plenty of time to buy the stock at a discount because of the general market\u0026rsquo;s lack of interest in it. The author cites companies such as Crown, Cork, and Seal, which manufactures cans and bottle caps.\nThis unpopularity for doing something boring according to the author is a good thing, given that you can get it for good prices.\n(3) The company does something unpleasant “Better than just being boring is a company action that is boring and unpleasant at the same time. Something that makes people dismissive, feel nauseous, or distance themselves as a sign of displeasure is ideal.”\nThe author cites Safety-Kleen, a company that visits gas stations and offers them equipment to clean greased car parts, and Clear Shield, which makes plastic forks and straws, as examples. The idea again is that companies that do nasty things are unlikely to appear on investment funds\u0026rsquo; shopping lists and so will not be very popular.\n(4) The company is the result of a spin-off “Spin-offs of divisions or parts of a company into separate and independent entities often result in tremendously profitable investments”\nAccording to the author, spin-off companies usually have good financial balance sheets and are well prepared to be successful as independent entities.\n“Spun-off companies are often misunderstood and receive little attention from Wall Street. Investors receive shares in newly created companies as government bonds or dividends for holding shares in the parent company, and institutions tend to regard them as insignificant, extraordinary additional contributions or found money. These are favorable signs for the shares of spun-off companies.”\n(5) Financial institutions do not own and analysts do not follow them “If you find a stock that has little or no ownership in the hands of institutions, you have found a possible winner. Find a company that has never been visited by any analyst or that no analyst would admit to having visited and you have a doubly winning stock.”\nThe author comments that he likes companies that were once popular and are no longer, and that is why they are no longer covered by analysts.\n(6) Rumors multiply: the company is involved with toxic waste and/or the mafia “It\u0026rsquo;s hard to imagine a more profitable industry than waste management. If there\u0026rsquo;s anything that disturbs people more than wrappings made of animal matter, grease, and used oil, it\u0026rsquo;s waste and toxic waste dumps.”\nThe example cited by the author was Waste Management, Inc. which rose more than 100 times.\n(7) There is something disheartening about this The author cites the example of Service Corporation International (SCI) which deals with death, that is, performs burials.\nFor being a very discouraging sector, the author considers good the opportunity when there are good companies in this sector.\n(8) It is a non-growth sector of activity “Many people prefer to invest in a high-growth sector where there is a lot of turmoil. It\u0026rsquo;s not my case. I prefer to invest in an industry with slow growth, like plastic knives and forks, but only in case, I can\u0026rsquo;t find a non-growth industry like funerals. This is where the big winners are generated.”\nThe author says to avoid sectors with high growth due to high competition and the great publicity that companies attract because they are in a growth sector.\n(9) The company has a niche \u0026ldquo;I would rather own shares in a local quarry than own shares in Twentieth Century-Fox, as one studio competes with another studio while the quarry has a niche.\u0026rdquo;\nCertainly, having a quarry is much safer than having a jewelry business. If you\u0026rsquo;re already in the jewelry business, you\u0026rsquo;re in competition with other jewelers across the city, state, and even abroad, as travelers can purchase them anywhere and bring them home. But if you own the only quarry in Brooklyn, you have a virtual monopoly, plus you have the added protection of the unpopularity of the quarrying industry.\nThe closest rival, which has more than two tons, will not deliver its products to your region because the transport costs will eat up all your profits.\nIn the case of quarries, you could raise prices to a point just below the level needed for the owner of the nearest quarry to start thinking about competing with you.\n(10) People must continue to buy the product \u0026ldquo;I\u0026rsquo;d rather invest in a company that makes medicines, soft drinks, shavers, or cigarettes than invest in a company that makes toys.\u0026rdquo;\nAccording to the author, the toy sector needs to innovate frequently to be able to sell, since shavers and cigarettes are items that demand frequent consumption by consumers.\n(11) The company uses technology “Instead of investing in computer companies that struggle to survive in an infinite price war, why not invest in a company that benefits from the price war”\nThe author cites the example of ADT, which uses computers for payroll processing that benefits from the computer price war.\n(12) People who are part of the company buy its shares “There is no better clue regarding the likely success of a stock than the members of the company itself putting their own money into the business.”\nThe author cites that better than the CEO buying shares, it is the employees of the lower echelons.\n“When managers in a company own their stock, shareholder compensation becomes a priority, whereas when managers simply receive their salaries at the end of the month, raising salaries becomes the priority.”\n(13) The company is buying back shares “Buying back shares is the best and simplest way for a company to reward its investors. If a company has confidence in its own future, then why shouldn\u0026rsquo;t it invest in itself, just like its shareholders?\nSummary These were the 13 attributes of a perfect company by Peter Lynch, in a nutshell, Lynch prefers good companies that fulfill basic needs and are unknown. This, according to him, brings a huge advantage to the individual investor.\nLynch in his fund, Fidelity Magellan had up to 1,400 shares in his fund, almost 4 times more shares than we have on our stock exchange.\nHappy investing!\nImage Source: Boston Herald/Getty Images\n","permalink":"https://luizvieira.me/peter-lynch-13-attributes-perfect-company/","summary":"Discover the 13 attributes of a perfect company by Peter Lynch and understand why he considers them important when selecting stocks that will yield good results","title":"13 Attributes of a Perfect Company by Peter Lynch"},{"content":"The best way to describe what is the sunk cost fallacy is with an example.\nLet\u0026rsquo;s assume the following situation: You have two stocks in your portfolio, one that went down 10% and one that went up 5%. Which one would you put more money in? Will you, with the idea that we have to buy low and sell high, choose to invest in a stock that has fallen 10%? If you do that, you may be suffering from the sunk cost fallacy.\nBut what is the sunk cost fallacy? The decision to invest additional funds in a losing account when better investments are available is known as the sunk-cost fallacy. The main idea is that you already have a cost (the 10% loss) and that influences your decision.\nA rational decision-maker is only interested in the future consequences of current investments and not what happened in the past. As Seth Godin says, the past is a gift from your old self to your current self, you (the current self) can do what you want with that gift, even throw it in the trash.\nAnother bias that affects investors is the hot-cold empathy gap.\nLet\u0026rsquo;s use a different example, imagine a company that has already spent 50 million dollars on a project. The project is now behind schedule and the prognosis for its final payoff is less favorable than in the initial planning stage.\nAn additional investment of 60 million is required to give the project a chance to succeed. An alternative proposal would be to invest the same amount in a new project that at the moment appears likely to bring a greater return.\nWhat will the company do? It\u0026rsquo;s not uncommon for a company afflicted with sunk costs to go around throwing even more money out the window, rather than accepting the costly failure.\nAnother example: there will be a concert by a musical band in the city. Your friend won the ticket but you had to pay $ 100.00 for the same ticket. You were going to the show together in the same car and unfortunately, the car breaks down halfway.\nWho would be more willing to do whatever it takes to get to the show? Probably you, because you have sunk costs (spent and therefore you tend to want to “make that money worth”).\nWe have to always be aware in our decisions, whether in investments or not, about sunk costs. We have to look to the future and (try to) forget what happened in the past (sunken cost) and look only for the future.\nThe sunk cost in companies The increasing commitment to efforts doomed to failure is a mistake from the company\u0026rsquo;s perspective, but not necessarily from the perspective of the executive who is the “owner” of the project that is about to sink.\nCanceling the project will leave a permanent stain on the executive\u0026rsquo;s résumé, and his personal interests may be better served if he continues to gamble with the organization\u0026rsquo;s resources in the hope of recouping the original investment—or at least in an attempt to postpone the day of reckoning.\nIn the presence of sunk costs, the manager\u0026rsquo;s incentives become misaligned with the goals of the company and its shareholders, a familiar type of what is known as an agency or representation problem.\nBoards of directors are well aware of these conflicts and often replace a CEO who is hampered by old decisions and is reluctant to cut costs. Board members do not necessarily believe that the new CEO is more competent than the previous one.\nWhat they do know is that this new person does not bring with them the same mental accounts and is thus better able to ignore the sunk costs of previous investments in evaluating present opportunities.\nAnd finally “The sunk cost fallacy keeps people too long in bad jobs, unhappy marriages, and unpromising projects.”\nHappy investing!\nThis post was based on the book Thinking, Fast and Slow by Daniel Kahneman.\n","permalink":"https://luizvieira.me/sunk-cost-fallacy/","summary":"Do you know what the sunk cost fallacy is? Do you know what its influence on decisions is? In this post I bring what is the influence on investments","title":"Sunk Cost Fallacy: Bad Jobs, Unhappy Marriages and More"},{"content":"Morgan Housel, the author of the book Psychology of Money, recorded a podcast with one of my favorite shows, Rule Breaker Investing, talking about his 5 best quotes. As a fan of both Morgan Housel and David Gardner (co-founder of The Motley Fool and host of Rule Breaker Investing ), this post will bring these 5 quotes to you.\nFor those who follow this blog, you know that I already talked about Rule Breaker Investing in the article 6 principles of a Rule Breaker portfolio (Innovative and disruptive) and in the 6 tips on how to invest according to Rule Breaker Investing and I also follow almost all The Motley Fool podcasts.\nA bit about Morgan Housel: He is the writer of Psychology of Money: Timeless Lessons in Fortune, Greed, and Happiness, one of the best-selling finance and investment books. He also worked for The Motley Fool and today he writes on the Collaborative Fund\u0026rsquo;s blog.\nHis articles like his book, are always very thoughtful and I always learn something from reading them.\nGiven the initial context, let\u0026rsquo;s talk about Morgan Housel\u0026rsquo;s 5 best quotes. If you want to hear the podcast where Morgan spoke the phrases, you can check it here 5 best Morgan Housel quotes Quote 01 “Doing well with money is not about what you know, it\u0026rsquo;s not about where you went to school or how smart you are, it\u0026rsquo;s how you behave.”\nQuote 02 “Controlling your time is the highest dividend that money pays. The ability to do what you want, when you want, with whom you want is priceless.”\nQuote 03 “The most important part of every plan is planning on your plan, not going according to plan.”\nQuote 04 “Save like a pessimist and invest like an optimist.”\nQuote 05 “If markets never fell, they wouldn’t be risky, and if they weren’t risky, they’d get really expensive, and when they get really expensive, they fall.”\nThese are the 5 best Morgan Housel quotes from the Rule Breaker Investing podcast. I hope that you enjoyed it. I recommend reading The Psychology of Money: Timeless Lessons on Fortune, Greed, and Happiness.\nHappy investing!\n","permalink":"https://luizvieira.me/morgan-housel-best-quotes/","summary":"Morgan Housel, author of the best seller book Psychology of Money shares with us his 5 best quotes that can inspire and help us invest better","title":"Morgan Housel's 5 Best Quotes (and My Favorite One)"},{"content":"One of my favorite podcasts is Rule Breaker Investing from David Gardner who is co-founder of The Motley Fool Money. He already has two lists of principles, and he created the third list, 6 principles of a Rule Breaker portfolio, and as it is always possible to learn something, from his lists of principles I will bring them here.\nOn his podcast, he talks about a variety of topics, but his focus is on Rule Breaker companies, that is, innovative and disruptive companies that are “breaking the rules” today and creating their own rules.\nIn addition to the podcasts they make available for free, they have subscription services where they have recommended companies, etc.\nSpeaking about the list, this one is a combination between you and your stocks that becomes a portfolio.\nThe 6 principles of a Rule Breaker portfolio are intended to be generic, as each person is different and has different goals, making their portfolio different.\nThe 6 Principles of a Rule Breaker Portfolio The list of the 6 principles of a Rule Breaker portfolio is divided into two parts. The first 3 principles are principles for building a portfolio, the last 3 are principles to help you maintain your portfolio.\nBefore starting, David himself mentioned that this is still a draft, and maybe it will be improved with feedback from his listeners.\nLet\u0026rsquo;s go to the list\nPrinciples for building the portfolio The principles below refer to the construction phase of your portfolio.\n1. Make your portfolio reflect your best vision for our future Photo by Anastasia Petrova\nThis is one of the phrases that David speaks the most, he always tells you to invest in what you believe in. Putting your money into companies you believe will make the future better.\nBy investing in a company, you are in a way endorsing the company, so by investing in companies that go against your best future vision, you are in a way supporting them.\nTherefore, David advocates that you invest in companies that somehow reflect your way of consuming and seeing the world.\nSuppose you are in favor of reducing plastics, then it makes sense to put companies in your portfolio that are making decisions to reduce plastics.\nAnother example: If you are a smoker, it makes sense for you to invest in tobacco companies as you consume and love the product. (Although it is a product harmful to health).\nEach person will have a different vision, and that\u0026rsquo;s the idea, build your portfolio accordingly. With this, each person will have a different portfolio.\nFrom the first time I heard this I started to reflect and little by little, I was shaping my portfolio for that. This is one of the reasons I stopped investing in JBS, ExxonMobil, etc… Let\u0026rsquo;s say that my global investment portfolio still doesn\u0026rsquo;t fully reflect my best vision of the future, but it\u0026rsquo;s getting better and better.\n2. Name your purpose and whether or not there will be money coming in Photo by Sandy Millar\nThe idea of ​​naming is to define its purpose. Know why you are doing what you are doing.\nIf your goal is to invest for your retirement, name your portfolio Retirement (or something similar). So, in case something happens in the short term that you are tempted to make moves, remembering the name of the portfolio will make you remember its objective to avoid making decisions that go against your real objective.\nAdditionally, in addition to defining the name, write a few paragraphs about its purpose, and always come back to that paragraph when buying and selling something or when trying to make trades in the heat of the moment.\nAn important point is that the objective, and perhaps even the name, should evolve as your goals and needs evolve.\nThe second part of the principle tells you to define whether there will be money being contributed regularly or not.\nI believe most readers will always have money coming in regularly, as most should be accumulating. But there are cases where you may be in retirement, and you will start enjoying the investments.\nKnowing whether or not there will be money coming into the portfolio will help you better manage it.\n3. Fair starting line Photo by Austris Augusts\nDavid advocates that when starting a portfolio, you assign equal weights to all stocks in the portfolio. That is, if you want to have 30 different stocks in your portfolio, you would allocate 3.33% of the portfolio to each stock.\nDavid also argues that when starting a portfolio, the minimum number he likes is to have 20 stocks, each of which would have 5% of the total portfolio.\nBut it\u0026rsquo;s good to remember, that he\u0026rsquo;s talking about building just a portfolio with Rule Breaker companies. I take a slightly different approach, putting 0.5% to 2% of my capital into a new position depending on the risk/return expectation I have with it.\nPrinciples for portfolio maintenance The principles below are designed to help you maintain your portfolio.\n4. Set your sleep number Photo by Cris Saur\nThe sleep number is the maximum percentage that you can keep in one stock and still be able to sleep peacefully.\nTherefore, when you define, or find out, what your sleep number is, you will know when you will need to cut the positions that pass this number.\nInvesting shouldn\u0026rsquo;t be something that keeps you up at night. If you\u0026rsquo;re taking out, you need to review your portfolio and strategy. So it\u0026rsquo;s good to know what your sleep number is.\nThat\u0026rsquo;s also because over time, some companies will grow much more than others, and as you let the winners win, they will (thankfully) come and go past your sleep number.\nLet\u0026rsquo;s say your sleep number is 5. That means you\u0026rsquo;re not comfortable with more than 5% of your portfolio in a single asset.\nWhat is your sleep number?\nIn my case, mine is 20. That is, I start pruning positions after they start to exceed 20% of my portfolio.\nEntrepreneurs usually have a very high number, as they probably have the majority of their portfolio in their own company.\nAnother case is that generally the older you get, your risk tolerance decreases and consequently your sleep number since you depend or are closer to depending on income from investments or capital.\n5. Good news, you can invest throughout the race Photo by Capstone Events\nMany seek to buy low and sell high, but David\u0026rsquo;s thinking is a little different, he wants to buy high, and stay with it for as long as possible, as good companies tend to grow. In addition, good companies are always “expensive” according to traditional valuation methods.\nFollowing this, investing throughout the run means being able to buy stocks multiple times during the company\u0026rsquo;s “run”. So if you bought it and a few years later the company is still good or even better, you can buy more, and so on.\nAs he always says, let your winners win. Another of his sayings is \u0026ldquo;go away, don\u0026rsquo;t bend down\u0026rdquo;.\n6. Review your portfolio quarterly, and manage accordingly Photo by Debby Hudson\nThe last principle on the list is a portfolio essential, review the portfolio.\nDavid indicates that the portfolio review should be done on a quarterly basis. As for “manage accordingly”, this is where you rebalance by closing positions that no longer make sense based on your worldview. Or maybe it\u0026rsquo;s the positions that have passed your sleep number.\nDavid also always advises looking at the portfolio in percentage and before making contributions and buying new companies, look at your portfolio and see if there is any company that deserves to receive the contribution.\nThis is a summary of the 6 principles of a Rule Breaker portfolio with a brief comment on my approach to some of them. If you want to hear the full episode click here.\nHappy investing!\n","permalink":"https://luizvieira.me/6-principles-rule-breaker-portfolio/","summary":"Check out the 6 principles of an innovative and disruptive portfolio (Rule Breaker) created by David Gardner of The Motley Fool","title":"6 Principles of a Rule Breaker Portfolio"},{"content":"Rule Breaker Investing is a podcast created by the co-founder of The Motley Fool, David Gardner, where he shares his insights into today’s most innovative and disruptive companies – and how to profit from them by following his signature “Rule Breaker Investing” principles. Below you will have 6 tips on how to invest according to Rule Breaker principles.\nUsually, when we invest we have to answer two questions: What do we invest in? And how do we invest?\nThe “what we invest in” is: what kind of company do you invest in? Do you invest in innovative companies? Market-leading companies? Traditional companies? Companies that pay good dividends?\nWhat to invest in from David is as follows:\nMy “what do I invest in”? I like to find the most innovative companies of our time, and I like to make sure that aren\u0026rsquo;t just R\u0026amp;D companies or aren\u0026rsquo;t just hope and dreams. Companies that are real and that offer excellent solutions, often create disruptions in the industries in which they are participating; they are really innovative;\nAs for “how do we invest?” it is linked to the criteria that guide our decisions when it comes to investing.\nHow we invest is about you, how do you invest? What principles does it follow? What rules?\n6 tips on how to invest according to Rule Breaker Investing Below, see 6 tips on how to invest that David follows in Rule Breaker Investing.\n“How” #1: Let your winners rise. Rise High In David\u0026rsquo;s experience, the most important thing as investors is to maintain. Keep companies in your portfolio. You should buy the companies you believe in and keep them in your portfolio.\nIt\u0026rsquo;s a simple idea, but when we have a company that has grown more than 100% in our portfolio, we start to think about selling it to realize the profits. David advocates against this.\nHe comments that you have to let it rise, and rise high.\nAn example is that if you had sold Netflix in your second year or Amazon in your third year of trading, you would have lost a 150 times multiplication in price.\nThe amount of money you leave on the table in these situations far exceeds the 100% loss in a lot of other positions.\nIn short, the idea is: Find good companies and hold those positions tenaciously over time to produce multiples and multiples of your original investment.\n“How” #2: Increment instead of doubling down The second is linked to not adding to the losers, but to the winners.\nWe always hear that we should buy low and sell high. The danger here is in the selling part. When we sell, we are violating “how” #1.\nAnother danger is “buying low”, this makes us tend to add money to companies where the position is lower than when we bought it, that is, the current value is lower than the price we paid. This is the downward bend mentioned at the beginning.\nThe tip here is to always add money to the winners, those companies that are going up, and not add money to those that are going down, that is, with the lowest value.\nIn short, it\u0026rsquo;s trying to find excellence, buy excellence, and increase excellence over time. And blindfold mediocrity.\n“How” #3: Invest for at least three years Buy a company and hold it for at least 3 years.\nThis rule is linked to investing in the long term and not speculating in the short term.\nThis is because companies in the short term are subject to market variations.\nOver at least 3 years you will have less influence on the market mood on the company\u0026rsquo;s price and more on the company\u0026rsquo;s fundamentals.\n“How” #4: Remember the Four Principles of Conscious Capitalism Conscious Capitalism is a philosophy that states that companies must serve all key stakeholders, including the environment. It does not minimize the pursuit of profits but encourages the assimilation of all common interests into the company\u0026rsquo;s business plan.\nThe four principles are:\nPrinciple #1: Look for purpose-driven companies.\nPrinciple #2: Look for companies that value all stakeholders. Companies that are oriented to make everyone win. Customers, certainly. Customers always come first for companies. Your employees. Your partners and suppliers. Your shareholders too.\nPrinciple #3: Conscious or Servant Leadership. You should be able to detect this among company executives.\nPrinciple #4: Conscious Culture. The culture of the companies in which we are investing. These must be really good. Employees must love working there.\nMake your portfolio reflect your best vision of the future.\nIn David\u0026rsquo;s experience, when you have companies that are going to make the world better, that\u0026rsquo;s one of the best reasons to keep holding on to them and hope they do well over time.\nSo think and actively ask, “What is my best vision for the future? Does my money line up with that?”\n\u0026ldquo;How\u0026rdquo; #5: Maximum starting position of 5% When starting to build a portfolio for yourself, never start a position in a company with more than 5% of the total amount you have to invest.\nThis means that when you build a well-structured portfolio you will have at least 20 companies in your portfolio.\nOf course, initially, when you start investing with little money, it is not easy to diversify into 20 companies. But as you build your portfolio you will have to diversify.\nThe main idea of this principle is to avoid focusing too much on a position that seems to be a very good opportunity, and after a while you discover that it actually wasn\u0026rsquo;t.\nThe principle also doesn\u0026rsquo;t stop you from starting with 5% and over time the company is doing well, you can\u0026rsquo;t add to it following principle #2.\n“How” #6: Focus to achieve 60% accuracy But what is meant by precision? In David\u0026rsquo;s case, accuracy is the number of companies that are above the market. For example, if you have 10 stocks and 8 of them are above market, and two are below market, then I would say that\u0026rsquo;s an excellent accuracy of 80% [8 out of 10 companies].\nThe market can be considered the S\u0026amp;P 500 indicator.\nEven if you don\u0026rsquo;t get this precision right, the good news is that you can still earn on stock market averages.\nStudies show that most companies in the market lose to the market average. So if you\u0026rsquo;re hitting 50% accuracy, you\u0026rsquo;re probably outperforming a lot of fund managers.\nAchieving 60% accuracy also means you will lose at 4 out of 10 companies. And some of those losses will be very big. So you should be comfortable with losses, it\u0026rsquo;s natural in the market. But you should always aim for 60% accuracy.\n“You must be willing to lose to win,” comments David.\nIf you want to listen to the full podcast that contains 6 tips on how to invest directly from David, you can access it here.\nHappy investing!\n","permalink":"https://luizvieira.me/6-hows-rule-breaker-investing/","summary":"Check out the 6 \u0026ldquo;Hows\u0026rdquo; to invest like a Rule Breaker created by David Gardner of The Motley Fool","title":"6 tips on how to invest according to Rule Breaker Investing"},{"content":"We already briefly mentioned the Pact Broker in the previous article (Using Pact for Consumer-Driven Contract Testing) and this piece will explain its usage and how it helps us run Pact and contract testing on CI pipelines.\nThe Pact Broker is an application that you can run in an EC2 machine (or other, depending on your cloud infrastructure). The Pact Broker is who manages the contract versions and providers, verification results, deployed versions, and releases.\nThese are the main features of the Pact Broker:\nShare and collaborate on contracts across teams Manage contracts across code branches and environments Orchestrate builds to know when it is safe to deploy Integrate into your processes and tooling The Pact Broker has a UI where you can see the contracts, the verification results, etc. You can use it, but most of the access to it will happen by API by the CI.\nList of pacticipants in Pact Broker. Source\nAnd you can also see the contracts.\nExample of a contract definition between two services on Pact Broker. Source\nWhile seeing the relationship between services and the contracts is really nice, the real power of the Pact Broker lies in the integration with CI, mainly in managing contracts between the code branches and environments.\nPact Contract tests on CI To better understand the whole flow in the CI, let’s see some images of how it happens.\nFeature branches Let’s start with the feature branch when a developer is still developing the new feature and it is not yet merged to master. As we already discussed, Pact is a consumer-driven framework, so the natural step is to create the first test on the consumer side.\nSo, the developer develops (\u0026#x1f60e;) the Contract Tests, which generate the contract file and then verifies its own service.\nCI pipeline of a feature branch for a Pact Consumer\nHere no interaction with the Pact Broker is needed, as we are not publishing the contracts in feature branches. After all the tests pass and the normal Merge/Pull Request review process that we have today has been finished, the MR/PR can be merged to master. We are going to see what happens after merging later on.\nFor the provider, the flow is a bit different, and it requires that we already have a contract published to the Pact Broker as we need to get the contract to be verified.\nCI pipeline of a feature branch for a Pact Provider\nThe provider fetches the latest contract from the Pact Broker and verifies it. Here the result is not published to the Pact Broker, it will break the provider pipeline if it is not complying with the contract defined by the consumer. Again, after all the tests pass and the MR/PR review finishes, it can be merged to master.\nAfter merging to master So, after you hit that so-expected \u0026ldquo;Merge” button, a few things will happen. When your service is the consumer, it will trigger your entire flow + the provider flow. When you are a provider, your CI flow is a bit shorter, as you only do your things.\nLet’s see first the Consumer merge flow.\nCI pipeline of merging to master for a Pact Consumer\nAs you can see above, we start by running the consumer tests that generate the contract, just like in the feature branch. The additional step here is to publish the contract to the Pact Broker, so the providers can use it to verify. Simply, this is the only addition to the feature CI flow for the consumer.\nIf the contract is new or has changed, the Pact Broker can trigger a webhook for the Provider CI. This step allows the provider to check the changes and see if it’s still compatible with the consumer. This webhook you have to set up, it does not come automatically\nAfter we merge an MR for the provider, or we have a webhook call from a consumer, the following flow will happen.\nCI pipeline of merging to master for a Pact Provider\nAgain, this is similar to the feature CI flow, the addition here is that after the test is run, the provider will publish the result of the verification to the Pact Broker, so it will add it to the Pact Matrix. This is very useful for the deployment of CI flow. This publishing of the result is what will add green or red to the row in the Pact Broker UI that we showed in the first image.\nIf it is green, it means that the latest contract is published and verified. We can deploy it.\nCan I Deploy? Before you deploy a new version of an application to any environment, you need to know whether or not the version you\u0026rsquo;re about to deploy is compatible with the versions of the other services that already exist in that environment.\nBecause of that, Pact Broker has a feature called can-I-deploy that allows each service to check if a specific version can be deployed to a specific environment.\nBoth Consumer and Provider have to call the can-I-deploy and the process is the same for both, so the image below summarizes it.\nCI pipeline of Can I deploy?\nIn the example above, a service (which can be a consumer or provider) is asking the Pact Broker if it can deploy version 1.0 to the DEV environment. If the response is yes, meaning that we have a valid contract, then we can safely deploy the service to the desired environment. If the answer is no. The pipeline will fail.\nAfter deploying the service, the pipeline calls another function (record-deployment) on the Pact Broker informing it that the version was deployed. You have to always deploy the provider first and then run the can I deploy on the consumer, otherwise the consumer will not have a provider available in that environment.\nIn this way, we know which version of the service is in each environment and we can have as many environments as we want.\nThis was a bit about the CI flow of Pact testing.\nHappy testing!\n","permalink":"https://luizvieira.me/pact-contract-testing-flow-ci-pipeline/","summary":"Check out how is the Pact Contract Testing flow in a CI pipeline in both feature branches and also master branches and how to safely deploy your services","title":"Pact Contract Testing flow on a CI pipeline"},{"content":"Warren Buffett\u0026rsquo;s investment advice is timeless. By keeping Buffett\u0026rsquo;s investment advice in mind, investors can avoid some of the common pitfalls that hurt returns and jeopardize financial goals. Below are 10 pieces of investment advice from Warren Buffett.\nWarren Buffett is famous for not only being the greatest investor of all time but also being widely quoted and followed by many. He has many great quotes, and the world looks at him for wisdom, mainly in periods of great tension and distress in the markets and economy.\nHe has lived, and invested, for many periods of time, which allows him to have a great perspective on the world and investing.\n10 pieces of investment advice from Warren Buffett 1. Invest in what you know… and nothing else One of the easiest ways to make an avoidable mistake is to engage in overly complex investments.\n\u0026ldquo;Never invest in a business you can\u0026rsquo;t understand\u0026rdquo;\nThis does not mean that you cannot invest in companies whose business you don\u0026rsquo;t fully understand, but you should proceed carefully and study them well.\nEveryone has some edge in something. If you work for a tech company, you may know well how the tech sector is doing and have an edge in understanding the companies. If you work in a shoe factory, you may have insights in which companies are thriving and have more chances of success.\n2. Never compromise on business quality While saying “no” to complicated companies and industries is simple enough, identifying high-quality companies is much more challenging and difficult even for professionals.\n\u0026ldquo;It is much better to buy a wonderful company at a fair price than a fair company at a wonderful price.\u0026rdquo;\nHere Buffett points out that you shouldn\u0026rsquo;t put business quality aside when valuing the company, and you should not buy a company regardless of price.\n\u0026ldquo;Time is the friend of wonderful businesses, the enemy of mediocre ones\u0026rdquo;\n3. When buying a stock, plan to hold it forever Warren Buffett clearly adopts the buy and hold mentality. He held some of his shares for several decades.\n\u0026ldquo;If you haven\u0026rsquo;t thought about owning a stock in ten years, don\u0026rsquo;t even think about owning it for ten minutes.\u0026rdquo;\nAnother quote related\n\u0026ldquo;Our favorite waiting period is forever\u0026rdquo;\nand another\n\u0026ldquo;The stock market is designed to transfer money from the impatient to the patient.\u0026rdquo;\nBut buy and hold does not mean buy and forget and also does not mean never selling it. But it means that you plan to hold it for as long as you believe the company is poised for success. He has sold many companies along the way, but his greatest results came from the ones that he kept for a long time.\n4. Diversification can be dangerous Warren Buffett currently has more than 46 stocks in his portfolio of public companies, but he says that.\n\u0026ldquo;Diversification is a protection against ignorance. It makes very little sense to someone who knows what they\u0026rsquo;re doing\u0026rdquo;\nWarren Buffett is against extreme diversification, something like 100+ assets. But we have to keep in mind that he has over 50 years of experience and picking stocks is his job.\nDiversification can be good, if you are not a professional investor that is the whole day studying the companies, you will surely be ignorant (even the pros are). Ignorance is not a bad thing, thinking that you are not is the worst thing.\n5. Most news is noise, not news If you worry about all the news, you will go crazy.\n\u0026ldquo;Remember that the stock market is a manic depressive.\u0026rdquo;\nAs investors, we need to ask ourselves whether the news really affects our company\u0026rsquo;s long-term earning power. Companies report results quarterly, and even that does not change much. So why keep looking at the investments daily?\nThe newspaper business is to sell you newspapers, subscriptions, or even ads. They are not there to help you make great investments. So keep an eye on what you read and try not to be affected by the noise.\n6. Investing is not rocket science, but there is no “easy button” One of the biggest misconceptions about investing is that only sophisticated people can successfully pick stocks. Equally important, investors should be aware that there is no magic set of rules, formulas, or “easy button” that can generate better results than the market. It doesn\u0026rsquo;t exist and it never will.\n\u0026ldquo;You don\u0026rsquo;t have to be a rocket scientist. Investing is not a game where the guy with the 160 IQ beats the guy with the 130 IQ\u0026rdquo;\nThe most difficult thing is consistency. Consistency is not complicated, complex, or difficult to understand. It is just difficult to do. If you are able to keep consistent throughout the years and even decades, your chances of success are very high.\n7. Know the difference between price and value Investors love to fixate on quotes, but quotes are much more volatile than company fundamentals.\n\u0026ldquo;Price is what you pay. Value is what you get.\u0026rdquo;\nStock prices fluctuate with investors\u0026rsquo; emotions, but that doesn\u0026rsquo;t mean a company\u0026rsquo;s future cash flow has changed. The market moves according to expectations and future events. But as we already said, the companies only publish results every quarter, so why do the prices change so much during this period?\n8. The best plays are usually boring Investing in the stock market is not a get-rich-quick path. Investing is not to be exciting, but to raise capital in the long term.\n\u0026ldquo;Beware of investment activity that produces applause; big moves are usually greeted by yawns.\u0026rdquo;\nThe biggest results come from companies that just keep delivering through the years. If everyone in the BBQ that you went to is talking about a specific stock, be careful with that.\n9. Low-cost index funds are suitable for most investors Most investors fail when trying to beat the market. We undermine our performance in many different ways – trying to time the market, taking excessive risks, trading emotions, venturing outside our circle of competence, and more.\n\u0026ldquo;My advice to investors couldn\u0026rsquo;t be simpler: put 10% of your money in short-term government bonds and 90% in a very low-cost S\u0026amp;P 500 index fund. I believe that the long-term results of the confidence of this policy will be superior to those achieved by most investors – whether pension funds, institutions or individuals – who employ managers with high fees.\u0026rdquo;\nEveryone thinks they are better than average, but that is not mathematically possible. So, if you don\u0026rsquo;t think you have an edge, sometimes it is better to go with the average.\nAlso, not everyone has a life goal of keeping up with the companies that they invest in, they just want to save for the future and have time to enjoy life. That is also a great motive to index.\n10. Only listen to those you know and trust Throughout his letters to shareholders and occasional interviews, Warren Buffett emphasizes the importance of investing only in competent and trustworthy management teams.\n\u0026ldquo;We have long felt that the only value of stock analysts is to make fortune-tellers look good.\u0026rdquo;\nand one more quote.\n\u0026ldquo;Wall Street is the only place people ride in a Rolls Royce to get advice from those taking the subway.\u0026rdquo;\nAlso, keep in mind that looking trustworthy is different than being trustworthy.\nConcluding By adopting some of Warren Buffett\u0026rsquo;s investment advice, focusing on the long term, and holding dividend stocks, we can better manage our portfolios to reduce the number of costly mistakes we make and continually move closer to achieving our goals.\nHappy investing!\n","permalink":"https://luizvieira.me/10-investment-advice-from-warren-buffett/","summary":"Warren Buffett is one of the greatest investors of all time, and these 10 pieces of his investment advice are going to help you become a better investor","title":"10 important pieces of investment advice from Warren Buffett"},{"content":"The dictionary offers various definitions for Compounder, depending on the context. The definition that best fits our discussion here is: \u0026ldquo;To compute (interest) on the principal and accrued interest.\u0026rdquo; But beyond just definitions, the idea of compounding holds a significant place in both personal finance and investing strategies.\nHere on the blog, I like to use two perspectives on the term Compounder: Compounder as a process and Compounder in companies. I believe that the best way to achieve meaningful returns over time is by understanding and applying these concepts, especially through investing in Compounder Companies.\nThe Compounder Process The compounding process aligns closely with the definition provided earlier, but a more detailed explanation comes from Investopedia:\n\u0026ldquo;Compounding is the process in which an asset\u0026rsquo;s earnings, from either capital gains or interest, are reinvested to generate additional earnings over time. This growth, calculated using exponential functions, occurs because the investment will generate earnings from both its initial principal and the accumulated earnings from preceding periods.\u0026rdquo;\nThe power of compounding lies in the exponential growth of your investment. It’s not just the initial investment that grows, but the reinvested earnings that begin to earn returns as well. This snowball effect is what can turn modest investments into significant wealth over time.\nA Visual Example Here’s an example of the compounding process in action. If you invest $500 a month, starting at age 25, and the investment compounds at an annual rate of 8%, by age 59, it could be worth more than $1.7 million.\nCompounding Effect. Source\nTo achieve this compounding effect, remember three key actions: SAVE, INVEST, REPEAT. Of course, it’s crucial to find investments that align with your desired returns, but that is a separate and complex topic.\nPatience is the real secret to compounding. As Charlie Munger wisely says, “The big money is not in the buying or selling, but in the waiting.” Time is your best ally in letting the compounding effect work its magic.\nCompounder Companies With an understanding of the compounding process, let’s shift our focus to Compounder Companies. These are businesses that leverage the compounding effect internally, generating consistent returns over time.\nA clear definition of Compounder Companies comes from Morgan Stanley:\n\u0026ldquo;We define compounders as companies with high quality, franchise businesses, ideally with recurring revenues, built on dominant and durable intangible assets, which possess pricing power and low capital intensity.\u0026rdquo;\nWhile this definition is thorough, I prefer a more streamlined version:\nWe define compounders as companies with a sustainable competitive advantage that can generate consistent, high returns over long periods.\nWhy Invest in Compounder Companies? The ability of these companies to maintain and reinvest high returns makes them ideal for long-term investment. Their competitive advantage (be it through brand strength, intellectual property, or network effects) allows them to reinvest profits back into the business at attractive rates, leading to further growth. This reinvestment fuels the compounding effect, making them resilient and valuable over time.\nFor another checklist of what makes a great business, see the 13 attributes of a perfect company by Peter Lynch.\nA key distinction here is that we’re talking about investing in companies, not just stocks. Owning a stock means owning a part of a company and its potential for growth. Compounder Companies are particularly appealing because they can continuously enhance shareholder value through their ability to generate and reinvest profits effectively.\nHappy investing, and may the power of compounding work in your favor!\n","permalink":"https://luizvieira.me/what-are-compounders/","summary":"Learn about compounders, the power of compounding, and how investing in compounder companies can boost long-term returns through exponential growth.","title":"What Are Compounders? The Power of Long-Term Investing"},{"content":"We already talked about the basics of Contract Testing in a broader range, now we will go deeper and talk about one of the frameworks used for contract testing: Pact.\nProvider-Driven Contracts vs Consumer-Driven Contracts When we talk about contract tests, we have basically two ways to think: Provider-Driven Contracts and Consumer-Driven Contracts. The basic difference is who defines the contract.\nIn a provider-driven contract, the contract is defined by the provider (the API owner or the message sender) and the consumer (the API consumer or the message receiver) validates if its use is according to the contract.\nIn a consumer-driven contract, the consumer defines the contract with the information used by the service and the provider verifies if it is supplying the data as needed.\nA popular framework for provider-driven contract testing is Spring Cloud Contract. And Pact is a popular consumer-driven one.\nMeet Pact Pact is a consumer-driven testing tool that was originally developed at realestate.com.au but is now open source. Pact supports multiple languages and platforms, such as the JVM, JavaScript, Python, and .NET, and can also be used with messaging interactions.\nIt has a sophisticated approach to writing tests for the consumer and the provider side, gives you stubs for separate services out of the box, and allows you to exchange CDC tests with other teams.\nWith Pact, you start by defining the expectations of the consumer using a DSL in any of the supported languages. When you run the test, it launches a local Pact server and runs this expectation against it to create the Pact specification file. The Pact file is just a formal JSON specification.\nA really nice property of this model is that the locally running mock server used to generate the Pact file also works as a local stub for downstream microservices. By defining your expectations locally, you are defining how this local stub service should respond.\nOn the provider side, you then verify that this consumer specification is met by using the JSON Pact specification to drive calls against your microservice and verify responses. For this to work, the producer needs access to the Pact file. This means that we need some way for this JSON file, which will be generated to the consumer build, to be made available by the provider.\nThe best way to store this JSON file is to use the Pact Broker, which allows you to store multiple versions of your Pact specifications. This could let you run your consumer-driven contract tests against multiple different versions of the consumers if you wanted to test against, say, the version of the consumer in production and the version of the consumer that was most recently built.\nThe Pact Broker actually has a host of other useful capabilities. Aside from acting as a place where contracts can be stored, you can also find out when those contracts were validated and a lot more. Also, because the Pact Broker knows about the relationship between the consumer and producer, it’s able to show you which microservices depend on which other microservices.\nPact is a consumer-driven contract testing tool that generates explicit contracts by using a test double that records requests and expected responses to a contract that is called a “pact”.\nHow Pact Works As was said before, we have the consumer, which is the one that is consuming the APIs or messages, and the providers, as the name says, it provides the API and messages.\nThis is an image from pact.io that illustrates in a broad view how it works.\nThe first step is to define the contract.\nHow Pact Works from Pact Docs\nThis animation from pactflow.io shows a bit better.\nHow Pact Works animation from Pact Flow\nOne important point is that it not only works for HTTP calls but also messages (RabbitMQ, Kafka, etc) are also supported by Pact.\nConsumer side As we said before Pact is consumer-driven so let us start with the consumer part.\nThe Pact Docs defines a consumer as:\n\u0026ldquo;An application that makes use of the functionality or data from another application to do its job. For applications that use HTTP, the consumer is always the application that initiates the HTTP request (eg. the web front end), regardless of the direction of data flow. For applications that use queues, the consumer is the application that reads the message from the queue.\u0026rdquo;\nAs a consumer-driven contract framework, the first step is to create a test for the consumer. The below consumer sample is from the Pact Docs.\ndescribe(\u0026#39;Pact with Order API\u0026#39;, () =\u0026gt; { describe(\u0026#39;given there are orders\u0026#39;, () =\u0026gt; { describe(\u0026#39;when a call to the API is made\u0026#39;, () =\u0026gt; { before(() =\u0026gt; { return provider.addInteraction({ state: \u0026#39;there are orders\u0026#39;, uponReceiving: \u0026#39;a request for orders\u0026#39;, withRequest: { path: \u0026#39;/orders\u0026#39;, method: \u0026#39;GET\u0026#39;, }, willRespondWith: { body: eachLike({ id: 1, items: eachLike({ name: \u0026#39;burger\u0026#39;, quantity: 2, value: 100, }), }), status: 200, headers: { \u0026#39;Content-Type\u0026#39;: \u0026#39;application/json; charset=utf-8\u0026#39;, }, }, }) }) it(\u0026#39;will receive the list of current orders\u0026#39;, () =\u0026gt; { return expect(fetchOrders()).to.eventually.have.deep.members([ new Order(orderProperties.id, [itemProperties]), ]) }) }) }) }) One important thing to keep in mind is that in the consumer you will add in the willRespondWith only the fields from the provider that you are really using. The minimal response. In this way, the provider can change the fields that are not used by your consumer without breaking anything.\nAlso according to the Pact Docs, you should follow these best practices for matching:\nRequest matching \u0026ldquo;As a rule of thumb, you generally want to use exact matching when you\u0026rsquo;re setting up the expectations for a request (upon_receiving(\u0026hellip;).with(\u0026hellip;)) because you\u0026rsquo;re under control of the data at this stage, and according to Postel\u0026rsquo;s Law, we want to be \u0026ldquo;strict\u0026rdquo; with what we send out.\u0026rdquo;\nResponse matching \u0026ldquo;You want to be as loose as possible with the matching for the response (will_respond_with(\u0026hellip;)) though. This stops the tests from being brittle on the provider side. Generally speaking, it doesn\u0026rsquo;t matter what value the provider actually returns during verification, as long as the types match. When you need certain formats in the values (eg. URLS), you can use terms (see docs below). Really really consider before you start introducing too many matchers however - for example, yes, the provider might be currently returning a GUID, but would anything in your consumer really break if they returned a different format of string ID? (If it did, that\u0026rsquo;s a nasty code smell!) Note that during provider verification, following Postel\u0026rsquo;s Law of being \u0026ldquo;relaxed\u0026rdquo; with what we accept, \u0026ldquo;unexpected\u0026rdquo; values in JSON response bodies are ignored. This is expected and is perfectly OK. Another consumer may have an expectation about that field.\u0026rdquo;\nRandom data - avoid it \u0026ldquo;If you are using a Pact Broker to exchange pacts, then avoid using random data in your pacts. If a new pact is published that is exactly the same as a previous version that has already been verified, the existing verification results will be applied to the new pact publication. This means that you don\u0026rsquo;t have to wait for the provider verification to run before deploying your consumer - you can go straight to prod. Random data makes it look like the contract has changed, and therefore you lose this optimization.\u0026rdquo;\nThe contract When we run the consumer test and it is green, a \u0026ldquo;pact\u0026rdquo; (contract) will be generated, usually on /pact folder. This contract file is a JSON with all the expectations that we defined for the consumer tests.\n{ \u0026#34;consumer\u0026#34;: { \u0026#34;name\u0026#34;: \u0026#34;GettingStartedOrderWeb\u0026#34; }, \u0026#34;provider\u0026#34;: { \u0026#34;name\u0026#34;: \u0026#34;GettingStartedOrderApi\u0026#34; }, \u0026#34;interactions\u0026#34;: [ { \u0026#34;description\u0026#34;: \u0026#34;a request for orders\u0026#34;, \u0026#34;providerState\u0026#34;: \u0026#34;there are orders\u0026#34;, \u0026#34;request\u0026#34;: { \u0026#34;method\u0026#34;: \u0026#34;GET\u0026#34;, \u0026#34;path\u0026#34;: \u0026#34;/orders\u0026#34; }, \u0026#34;response\u0026#34;: { \u0026#34;status\u0026#34;: 200, \u0026#34;headers\u0026#34;: { \u0026#34;Content-Type\u0026#34;: \u0026#34;application/json; charset=utf-8\u0026#34; }, \u0026#34;body\u0026#34;: [ { \u0026#34;id\u0026#34;: 1, \u0026#34;items\u0026#34;: [ { \u0026#34;name\u0026#34;: \u0026#34;burger\u0026#34;, \u0026#34;quantity\u0026#34;: 2, \u0026#34;value\u0026#34;: 100 } ] } ], \u0026#34;matchingRules\u0026#34;: { \u0026#34;$.body\u0026#34;: { \u0026#34;min\u0026#34;: 1 }, \u0026#34;$.body[*].*\u0026#34;: { \u0026#34;match\u0026#34;: \u0026#34;type\u0026#34; }, \u0026#34;$.body[*].items\u0026#34;: { \u0026#34;min\u0026#34;: 1 }, \u0026#34;$.body[*].items[*].*\u0026#34;: { \u0026#34;match\u0026#34;: \u0026#34;type\u0026#34; } } }, \u0026#34;metadata\u0026#34;: null } ], \u0026#34;metadata\u0026#34;: { \u0026#34;pactSpecification\u0026#34;: { \u0026#34;version\u0026#34;: \u0026#34;2.0.0\u0026#34; } } } This contract has to be shared with the provider (usually using Pact Broker) so that the provider can verify it.\nProvider side The final step is to verify if the provider is providing (who would guess?) the API or Message with all the fields that the consumer needs.\nThe Pact Docs defines a provider as:\n\u0026ldquo;An application (often called a service) that provides functionality or data for other applications to use, often via an API. For applications that use HTTP, the provider is the application that returns the response. For applications that use queues, the provider (also called producer) is the application that writes the messages to the queue.\u0026rdquo;\n// Verify that the provider meets all consumer expectations describe(\u0026#39;Pact Verification\u0026#39;, () =\u0026gt; { before(async () =\u0026gt; { port = await getPort() opts = { provider: providerName, providerBaseUrl: `http://localhost:${port}`, pactBrokerUrl: \u0026#39;https://test.pact.dius.com.au/\u0026#39;,, publishVerificationResult: true, providerVersion: \u0026#39;1.0.\u0026#39; + process.env.HOSTNAME, } server.listen(port, () =\u0026gt; { console.log(`Provider service listening on http://localhost:${port}`) }) }) it(\u0026#39;should validate the expectations of Order Web\u0026#39;, () =\u0026gt; { return new Verifier() .verifyProvider(opts) .then(output =\u0026gt; { console.log(\u0026#39;Pact Verification Complete!\u0026#39;) console.log(output) }) .catch(e =\u0026gt; { console.error(\u0026#39;Pact verification failed :(\u0026#39;, e) }) }) }) The above sample is also from the Pact Docs. In there, the endpoint returns the data as follows.\n[ { id: 1, items: [ { name: \u0026#39;burger\u0026#39;, quantity: 2, value: 20, }, { name: \u0026#39;coke\u0026#39;, quantity: 2, value: 5, }, ] } ] In a user case, I would personally add a mock to the test.\nSummary This was a bit about the Pact framework for consumer-driven contract tests. I would strongly recommend you to read the Pact Documentation which has a lot of information and a lot of examples. Very nice documentation.\nI also wrote about how this Pact contract testing flow runs on a CI pipeline.\nHappy testing!\nReferences This post would not be possible without the great texts that came before. I am only standing on the shoulders of giants.\nBook Building Microservices What is contract testing? PACTFLOW Pact Docs ","permalink":"https://luizvieira.me/pact-contract-testing/","summary":"Pact is a consumer-driven testing tool that helps with contract tests. In this post, we explore more about Pact and how it works and check out a sample code","title":"Using Pact for Consumer-Driven Contract Testing"},{"content":"A contract is an agreement between two or more parties. When you sign a contract, you are agreeing to a set of rights and/or obligations. A contract in a Contract Test is similar, it describes how an external service will behave so you know what to expect from it.\nFor each communication interface, there are usually two parties involved: the provider and the consumer. The provider serves data to consumers. The consumer processes data obtained from a provider.\nIn a REST world, a provider builds a REST API with all required endpoints; a consumer makes calls to this REST API to fetch data or trigger changes in the other service.\nIn an asynchronous, event-driven world, a provider (often also called a publisher) publishes data to a queue; a consumer (often called a subscriber) subscribes to these queues and reads (consumes) and processes data.\nIn other words, a \u0026quot; contract is less about testing your own microservice and more about specifying how you expect an external service to behave\u0026quot;.\nOne of the main reasons that these contract tests can be useful is that they can be run against any stubs or mocks you are using that represent external services. This makes it easier and quicker to run.\nContract tests become very useful when used as part of consumer-driven contracts (CDCs). With CDCs, the consumer team ensures that these contract tests are shared with the provider team to allow the producer team to ensure that its microservice meets these expectations.\nIt is very important from a test feedback point of view, that these tests need to be run only against a single producer in isolation, so they can be faster and more reliable than the end-to-end tests they might replace.\nIn a way, contracts are as much about fostering clear lines of communication and collaboration, where needed, between microservices and the teams that consume them. It makes easier and more clear the lines of interaction between services. It is important to understand that CDCs require good communication and trust between the consumer and producing service.\nAs the authors of the book Accelerate (Nicole Forsgren, Jez Humble, and Gene Kim) said,\n“The fear and anxiety that engineers and technical staff feel when they push code into production can tell us a lot about a team’s software delivery performance.”\nSo, besides the improvement of the communication between the consumer team and provider team. The contract tests reduce the fear and anxiety of the engineers that are working with both consumers and providers.\nSo with CDCs, we can identify a breaking change prior to our software going into production without having to use a potentially expensive end-to-end test.\nOther benefits are that the tests run independently, give fast feedback, are stable, are easy to maintain, and give you the confidence to release.\nWhere do they sit in the test pyramid? CDCs sit at the same level in the test pyramid as service tests, albeit with a very different focus. These tests are focused on how a consumer will use the service, and the trigger, if they break, is very different when compared with service tests.\nIf one of these CDCs breaks during a build of the Customer service, it becomes obvious which consumer would be impacted. So with CDCs, we can identify a breaking change prior to our software going into production without having to use a potentially expensive end-to-end test.\nSam Newman on Building Microservices - Testing Pyramid\nAccording to pactflow, these are the main values of contract tests:\nThey run fast because they don’t need to talk to multiple systems. They are easier to maintain: you don’t need to understand the entire ecosystem to write your tests. They are easy to debug and fix because the problem is only ever in the component you are testing - so you generally get a line number or a specific API endpoint that is failing. They are repeatable. Contract tests scale: because each component can be independently tested, build pipelines don’t increase linearly / exponentially in time They uncover bugs locally, on developer machines: contract tests can and should run on developer machines prior to pushing code. As we well know, the later in a project lifecycle that a bug is found, the costlier it is to fix. So using contract tests we bring the tests closer to the base of the pyramid. As it is very well illustrated in Beth’s image below that compares the contract test to the E2E.\nFrom Beth\u0026rsquo;s excellent talk on the topic\nSummary So in summary, the contract tests bring more confidence and less anxiety for the whole team. It also helps in the documentation of the code and also helps the communication between teams. It is also cheaper and quicker than end-to-end tests. If you want to explore more about CDCs using Pact, check out Using Pact for Consumer-Driven Contract Testing\nHappy testing!\nReferences This post would not be possible without the great texts that came before. I am only standing on the shoulders of giants.\nBook Building Microservices Book Accelerate The Practical Test Pyramid | Martin Fowler blog What is contract testing? PACTFLOW Pact Docs YOW! 2017 Beth Skurrie - It is Not Hard to Test Smart: Delivering Customer Value Faster ","permalink":"https://luizvieira.me/contract-testing/","summary":"Contract testing brings more confidence and less anxiety for the whole engineering team. It also helps in the documentation of the code and communication","title":"Contract Testing: Keeping Microservices Communicating"},{"content":"First things first: What is a code smell?\nAccording to Martin Fowler\nA code smell is a surface indication that usually corresponds to a deeper problem in the system.\nSo, code smells are signals that your code is not in very good shape, and you should think about refactoring it.\nEvery software has some code smells. Some have low severity code smells, but some have very bad code smells. I was watching the Clean Code and in the video, none other than Uncle Bob (Robert C. Martin) explained what makes bad code smell so bad.\nBecause of the usefulness of that, I am bringing up the 4 main reasons mentioned in the video that make a code smell bad.\nRigidity Rigidity is the tendency of a system to resist change. A system is rigid when that system requires us to make many changes to many different places in order to fix a single bug or add a single new behavior. Such a system resists change, and so we say it is rigid.\nA rigid system requires multiple changes, in multiple places just to make a simple change.\nFragility A fragile system is a system that malfunctions in many unpredictable ways when a single simple change is made. We say that a system is fragile when the repair of a single bug or the addition of a single new feature causes a malfunction in one or many other parts of the system that have no connection with the part that was changed\nI think this is the worst, as we are always afraid to make some changes as we do not know where it will break.\nInseparability An inseparable system is a system in which those parts that might be profitably used in another system cannot be separated out from the first system. Indeed, we say that a system is inseparable when the various points of that system cannot be independent and be used in some other system.\nInseparable systems are unpredictable. You never know if you can reuse the components in the system, and so the changes cannot be reliably estimated.\nOpacity Opacity is the tendency of a system to be so ineptly structured that no amount of effort can be applied to divine the author\u0026rsquo;s original intent. We say that a system is opaque when reading the code tells us little or nothing about what the system does or the way it works.\nOpaque code is hard to read, hard to understand, and hard to change.\nOne way to make a better code is to write a clean code.\nHappy coding!\nPhoto by Juanjo Jaramillo\n","permalink":"https://luizvieira.me/what-makes-bad-code-smell-bad/","summary":"We know that code smells are bad. But what is it that makes bad code smell so bad? In this post, I will list 4 main reasons for a code to smell bad.","title":"What is it that makes bad code smell so bad?"},{"content":"I recently watched Clean Code, where none other than Uncle Bob (Robert C. Martin) delves into the essence of clean code. For those unfamiliar with Uncle Bob, he’s a software development legend. His influence in the software world is massive, especially through his contributions to the Agile Manifesto and his many writings on software principles. Let’s take a quick look at how Wikipedia describes him:\nRobert Cecil Martin, colloquially called \u0026ldquo;Uncle Bob\u0026rdquo;, is an American software engineer, instructor, and best-selling author. He is most recognized for developing many software design principles and for being a founder of the influential Agile Manifesto. Martin has authored many books and magazine articles.\nHowever, this post isn’t just about Uncle Bob; it’s about what clean code truly means. In the video, Uncle Bob posed the question \u0026ldquo;What is clean code?\u0026rdquo; to several prominent figures in the software world. Their responses provide a rich perspective on what clean code represents to experienced developers.\nWhat the Experts Say Bjarne Stroustrup, the inventor of C++, answered:\n\u0026ldquo;I like my code to be elegant and efficient. Clean code should do one thing.\u0026rdquo;\nThis is a simple but powerful definition. Clean code should strive to be both elegant and efficient, two qualities often seen as opposing forces. Elegance in code means achieving more with fewer words, while efficiency means using minimal system resources (CPU cycles). Stroustrup’s answer emphasizes the balance between these two qualities. Code should be focused, doing exactly what is required without unnecessary complexity.\nGrady Booch, the author of Object-Oriented Design and Analysis with Applications, a classic text in software design, contributed:\n\u0026ldquo;Clean code is simple and direct. Clean code reads like well-written prose.\u0026rdquo;\nFor Booch, clean code has an almost literary quality. It should read as easily as a well-written book: clear, concise, and without unnecessary ornamentation. It’s not about showing off cleverness but rather about making sure the code communicates its intent in the most straightforward way possible.\nMichael Feathers, author of Working Effectively with Legacy Code, offered a more emotional take:\n\u0026ldquo;Clean code always looks like it was written by someone who cares.\u0026rdquo;\nFeathers reminds us that clean code reflects the mindset of the developer. It’s written with care and attention, conveying a sense of craftsmanship. When we approach our work with pride and thoughtfulness, it shows in the results.\nWard Cunningham, the inventor of the wiki, added:\n\u0026ldquo;You know you are reading clean code when every routine that you read is pretty much what you expected.\u0026rdquo;\nCunningham’s response underscores the predictability of clean code. When you read it, it behaves and flows as anticipated. There\u0026rsquo;s no confusion, no surprises, just clarity. Clean code is intuitive because it aligns with what a fellow developer might expect when reading it.\nThe Common Thread From these perspectives, we can draw some key principles that define clean code:\nElegance and Efficiency: Do more with less. Simplicity and Clarity: Make it read like prose, simple and direct. Care and Craftsmanship: Write with thoughtfulness and intention. Predictability: It should behave as expected, with no surprises. At its core, clean code is easy to understand. That’s the goal: writing code that communicates effectively with other developers.\nUncle Bob’s Golden Rule As Uncle Bob succinctly put it:\n\u0026ldquo;Remember that it doesn\u0026rsquo;t require an awful lot of skill to write a program that a computer understands. The skill is in writing programs that humans understand.\u0026rdquo;\nThis quote encapsulates the true challenge in software development. Computers are binary machines. They will execute even the most poorly written code as long as it compiles. But clean code ensures that other people can understand, maintain, and build upon your work. After all, we don’t write code in isolation; we write for future developers, collaborators, and even our future selves.\nA Thought to Live By One quote from the video that resonated with me is one I try to live by in my daily work. It comes from Robert Baden-Powell, the founder of the Boy Scouts. In his posthumous message to the organization, he said:\n\u0026ldquo;Leave the world better than you found it.\u0026rdquo;\nWhat if we took that philosophy to heart in our coding practices? What if every time you checked in code, you made it just a little bit better than it was when you checked it out? Small, consistent improvements over time can transform even the most tangled codebases into something clean, elegant, and efficient.\nThis is what I strive for in my daily tasks: to leave my code a little better than I found it, continuously improving the overall quality of the project.\nI also wrote about what makes bad code smell so bad and the principles that guide my work as a software engineer.\nHappy coding!\nPhoto by Oskar Yildiz on Unsplash\n","permalink":"https://luizvieira.me/clean-code/","summary":"Clean code is elegant, efficient, simple, and written with care. It’s about writing code that\u0026rsquo;s easy for humans to understand, not just for computers to execute","title":"Clean Code: Insights from Uncle Bob and Others"},{"content":"Since this is my first post, I figured it would be fitting to talk about the platform powering this very blog. Given that this blog is all about software, coding, and technology, I’ll share what tech stack I\u0026rsquo;m using, why I chose it, and the process behind it.\nStatic vs. Dynamic Blog: What’s the Difference? The first big decision I had to make was whether to use a static or dynamic platform for my blog. Let’s break down the differences between the two.\nStatic blog As the name suggests, a static blog is made up of static files. It\u0026rsquo;s much simpler than a dynamic blog since it doesn\u0026rsquo;t require a database or a complex backend.\nEssentially, you write your posts in markdown (.md) or another format, and the static site generator transforms them into HTML, JavaScript, and CSS, which are then served directly by the web server. No need for server-side logic once the files are generated: what you see is what you get.\nWhile static sites tend to be faster because they don’t have to query a database for every page request, they are also somewhat limited in functionality. However, for a straightforward tech blog like mine, speed and simplicity are more important than having a full-featured content management system.\nDynamic blog Dynamic blogs, like WordPress, are much more user-friendly if you don’t want to touch code. They offer rich functionality out of the box, such as built-in themes, plugins, and content management features. The downside? They rely on a database and a more powerful backend to generate pages on the fly.\nFor instance, I run a travel blog once using WordPress. My wife and I both contributed to it, and the platform’s built-in tools make it easy for us to upload and organize photos, write posts, and manage the site together. But it does come with some performance issues, especially as traffic grows. Even with caching, I’ve received warnings from my hosting provider (HostGator shared hosting) about high resource usage.\nWhile WordPress works well for a media-rich, collaborative site like Pieces of the World, it’s not necessary for this simpler blog.\nWhy I chose a static blog for this blog Having experienced performance issues with dynamic platforms in the past, I decided to go with a static blog for this project. I don’t need all the extra bells and whistles a dynamic platform offers. I just want something clean, fast, and easy to manage.\nThe downside of a static blog is that it requires a bit more technical know-how, but that’s not a problem for me. And on the plus side, I don’t have to worry about server load or performance as traffic increases.\nThis is my first post, so I’m still in the early stages of testing this setup. Whether it will prove to be the best choice over time remains to be seen.\nPicking a static site generator I had never used a static site generator before, so I did some research and came across three main contenders: Jekyll, Hugo, and Hexo. There are plenty of others, but these seemed to be the most popular.\nI briefly looked at Jekyll, but Hugo stood out to me for a couple of reasons. First, it’s known for being incredibly fast. Second, it’s written in Go, a language I’ve been curious about. The setup was also super easy: a quick install via Homebrew, and I was up and running in no time. It felt right for what I needed, so I decided to go with Hugo.\nHosting the blog Who doesn’t love free? For hosting, I looked for a free tier solution and found Netlify. Netlify offers a free tier that’s more than enough for a simple blog, and you only start paying once you hit certain usage limits.\nTo further optimize performance and keep my Netlify usage within free-tier limits, I added Cloudflare as a CDN (Content Delivery Network). This helps cache the site’s static files and speeds up delivery to visitors.\nConclusion In the end, I decided to build this blog as a static site using Hugo. It’s too early to say definitively whether this was the best decision, but so far, it feels like the right fit for my needs. Like most things in tech, this is an experiment, and I’ll continue to evolve and refine the setup over time.\nPhoto by Sean Stratton\n","permalink":"https://luizvieira.me/blog-stack/","summary":"Learn why I chose a static blog powered by Hugo, the pros and cons of static vs dynamic blogs, and how I\u0026rsquo;m hosting it for free","title":"Building My Blog: The Platform and Tech Stack"},{"content":"Welcome. I am Luiz Vieira.\nI am a Staff Software Engineer based in Vancouver, BC, and an immigrant from Brazil. I have been working in software for 13+ years, but I still see myself as a student.\nThis blog is where I write about things I am learning, testing, and trying to understand better. Some posts are technical, some are personal, and some are just me documenting a process so I do not forget it later.\nIf you are new here, a good place to start is Categories.\nSoftware Engineering Most of my day job writing appears here. I share what I learn while building and running systems in production: architecture decisions, observability, testing, delivery practices, and the mistakes that taught me the most.\nI try to keep these posts practical. If something worked for me, I explain why. If it failed, I explain that too.\nRead more in Software Engineering.\nLearning from Books I read a lot of non-fiction, and I write book notes to remember what mattered. I have read more than 90 books so far, and writing about them helps me turn ideas into action.\nThese are not formal summaries. They are my personal takeaways and the parts that actually changed how I think or work.\nRead more in Learnings from Books.\nTravel \u0026amp; Adventures My wife and I love to travel, especially places with nature and wildlife. I write about the planning, the tradeoffs, what surprised us, and what I would do differently next time.\nI also share a lot of photos because it helps me tell the story better.\nRead more in Travel \u0026amp; Adventures.\nImmigration Immigration was one of the biggest changes in my life. I share parts of my Canadian immigration journey and practical notes that can help others going through similar decisions.\nRead more in Immigration.\nPersonal Development I care a lot about health, habits, and sustainable growth. You will find posts about fitness, productivity, podcasts, and routines I use to stay consistent.\nSome experiments work, some do not. I usually write both.\nRead more in Personal Development.\nFinance \u0026amp; Investing I have tracked my expenses since I was 18 and started investing in 2015. Over the years, I moved from stock picking to a simpler, long-term index strategy.\nI do not post financial advice. I mostly share what has worked for me and why I prefer simple systems.\nRead more in Finance \u0026amp; Investing.\nLeadership \u0026amp; Work I write occasionally about leadership, communication, mentoring, and the reality of growing your career while helping other people grow with you.\nRead more in Leadership \u0026amp; Work.\nHobbies Outside work, I spend time on photography, stargazing, gardening, and other hobbies that keep me curious.\nRead more in Hobbies.\nWhy keep a blog? This blog is mainly for me.\nWriting helps me organize ideas and test my understanding. When I try to explain something clearly, I can quickly see what I do not fully understand yet.\nI am not trying to be perfect here. I am trying to be consistent and useful.\nIf any post helps you, even better.\nCheers.\n","permalink":"https://luizvieira.me/about/","summary":"Learn a little bit about Luiz Vieira and this blog","title":"About Luiz Vieira blog"}]