
Coding Blocks
242 episodes — Page 3 of 5

Ep 142The DevOps Handbook – The Value of A/B Testing
We wrap up the second way from The DevOps Handbook, while Joe has a mystery episode, Michael doesn't like ketchup, and Allen has a Costco problem. These show notes, in all of their full sized digital glory, can be found at https://www.codingblocks.net/episode142, where you can join the conversation, for those using their podcast player to read this. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Survey Says When a new mobile OS update comes out on iOS or Android, do you ... Take the survey at: https://www.codingblocks.net/episode142. News We appreciate the new reviews, thank you! iTunes: Jynx_Protocol Stitcher: IllKeepItEasyForYouMike, KingJArthur Treating Features as Experiments Integrate Hypothesis Driven Development and A/B Testing "The most inefficient way to test a business model or product idea is to build the complete product to see whether the predicted demand actually exists." Jez Humble Constantly ask should we build it and why? A/B testing will allow us to know if an idea is worthwhile because allows for fast-feedback on what's working. Doing these experiments during peak season can allow you to out-experiment the competition. But this is only possible if you can deploy quickly and reliably. This allows A/B testing to support rapid, high-velocity experiments. A/B test is also known as "split testing". A/B testing is where one group sees one version of a page or feature and the other group sees another version. Study from Microsoft found that only about 1/3 of features actually improved the key metric they were trying to move! The important takeaway? Without measuring the impact of features, you don't know if you're adding value or decreasing it while increasing complexity. Integrate A/B Testing Into Releases Effective A/B testing is only possible with the ability to do production releases quickly and easily. Using feature flags allow you to delivery multiple versions of the application without requiring separate hardware to be deployed to. This requires meaningful telemetry at every level of the stack to understand how the application is being used. Etsy open-sourced their Feature API, used for online ramp-ups and throttling exposure to features. Optimizely and Google Analytics offer similar features. Integrating A/B Testing into Feature Planning Tie feature changes to actual business goals, i.e. the business has a hypothesis and an expected result and A/B testing allows the business owner to experiment. The ability to deploy quickly and reliably is what enables these experiments. Create Processes to Increase Quality Eliminate the need for "approvals" from those not closely tied to the code being deployed. Development, Operations and InfoSec should constantly be collaborating. The Dangers of Change Approval Process Bad deployments are often attributed to: Not enough approval processes in place, or Not good enough testing processes in place The findings of this is that often, command-and-control environments usually raise the likelihood of bad deployments. Beware of "Overly Controlling Changes" Traditional change controls can lead to: Longer lead times, and/or Reducing the "strength and immediacy" of the deployment process. Adding the traditional controls add more "friction" to the deployment process, by: Multiplying the number of steps in the approval process, Increasing batch sizes (size of deployments), and/or Increasing deployment lead times. People closest to the items know the most about them. Requiring people further from the problem to do approvals reduces the likelihood of success. As the distance between the person doing the work and the person approving the work increases, so does the likeliness of failure. Organizations that rely on change approvals often have worse stability and throughput in their IT systems. The takeaway is that peer reviews are much more effective than outside approvals. Enable Coordination and Scheduling of Changes The more loosely coupled our architecture, the less we have to communicate between teams. This allows teams to make changes in a much more autonomous way. This doesn't mean that communication isn't necessary, sometimes you HAVE to speak to someone. Especially true when overarching infrastructure changes are necessary. Enable Peer Review of Changes Those who are familiar with the systems are better to review the changes. Smaller changes are much better. The size of a change is not linear with the risk of the change. As the size of a change increases, the risk goes up by way more than a factor of one, Prefer short lived branches. "Scarier" changes may require more than just one reviewer. Potential Dangers of Doing More Manual Testing and Change Freezes The more manual testing you do, the slower you are to release. The larger the batch sizes, the slower you are to release. Enable Pair Programing to Improve all our Changes "I can't help wondering if pair programming is nothing more than co

Ep 141Is Kubernetes Programming?
We gather around the water cooler to discuss some random topics, while Joe sends too many calendar invites, Allen interferes with science, and Michael was totally duped. If you're reading these show notes via your podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode141. As Joe would say, check it out and join the conversation. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Secure Code Warrior – Start gamifying your organization's security posture today, score 5,000 points, and get a free Secure Code Warrior t-shirt. Survey Says Do you eat at your desk? Take the survey at: https://www.codingblocks.net/episode141. News Thank you to everyone left us a new review: iTunes: I Buy, Not Play! Stitcher: kconrad53, TheNicknameFieldIsTooShor, hopkir Factorio v1 is official! (factorio.com) Overheard Around the Water Cooler Are your unit tests bring your down? Do we hate unit tests now? Unit Testing Is Overrated (Hacker News) Is TDD Dead? (Reddit, Hacker News) Write tests. Not too many. Mostly integration. (KentCDodds.com) Do you have to read your emails? Are you ruining everything by working late? Is Kubernetes programmings? When developing the next big deal application, which of the following are most important to you? Features Automation, i.e. CI / CD pipeline Unit tests, maybe even TDD Dependency Injection ALM (Alerting, Logging, Monitoring) Security first Resources We Like RAW Vim Workshop/Tutorial (YouTube) Explore Kubernetes resources with Datadog Live Containers (Datadog) Tip of the Week Lens, The Kubernetes IDE (GitHub) Bind Docker inside a running container to the host's Docker instance to use Docker within Docker by adding the following to your Docker run command: -v /var/run/docker.sock:/var/run/docker.sock Note that this syntax works on Windows.

Ep 140The DevOps Handbook – Enabling Safe Deployments
We learn the secrets of a safe deployment practice while continuing to study The DevOps Handbook as Joe is a cartwheeling acrobat, Michael is not, and Allen is hurting, so much. For those of you that are reading these show notes via their podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode140. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Secure Code Warrior – Start gamifying your organization's security posture today, score 5,000 points, and get a free Secure Code Warrior t-shirt. Survey Says Do you prefer that your laptop keyboard ... Take the survey at: https://www.codingblocks.net/episode140. News Rob Pike's Rules of Programming (utexas.edu) No, you click the button … Enable Feedback to Safely Deploy Code Without a quick feedback loop: Operations doesn't like deploying developer code. Developers complain about operations not wanting to deploy their code. Given a button for anyone to push to deploy, nobody wants to push it. The solution is to deploy code with quick feedback loops. If there's a problem, fix it quickly and add new telemetry to track the fix. Puts the information in front of everyone so there are no secrets. This encourages developers to write more tests and better code and they take more pride in releasing successful deployments. An interesting side effect is developers are willing to check in smaller chunks of code because they know they're safer to deploy and easier to reason about. This also allows for frequent production releases with constant, tight feedback loops. Automating the deployment process isn't enough. You must have monitoring of your telemetry integrated into that process for visibility. Use Telemetry to Make Deployments Safer Always make sure you're monitoring telemetry when doing a production release, If anything goes wrong, you should see it pretty immediately. Nothing is "done" until it is operating as expected in the production environment. Just because you improve the development process, i.e. more unit tests, telemetry, etc., that doesn't mean there won't be issues. Having these monitors in place will enable you to find and fix these issues quicker and add more telemetry to help eliminate that particular issue from happening again going forward. Production deployments are one of the top causes of production issues. This is why it's so important to overlay those deployments on the metric graphs. Pager Duty – Devs and Ops together Problems sometimes can go on for extremely long periods of time. Those problems might be sent off to a team to be worked on, but they get deprioritized in lieu of some features to be added. The problems can be a major problem for operations, but not even a blip on the radar of dev. Upstream work centers that are optimizing for themselves reduces performance for the overall value stream. This means everyone in the value stream should share responsibility for handing operational incidents. When developers were awakened at 2 AM, New Relic found that issues were fixed faster than ever. Business goals are not achieved when features have been marked as "done", but instead only when they are truly operating properly. Have Developers Follow Work Downstream Having a developer "watch over the shoulder" of end-users can be very eye-opening. This almost always leads to the developers wanting to improve the quality of life for those users. Developers should have to do the same for the operational side of things. They should endure the pain the Ops team does to get the application running and stable. When developers do this downstream, they make better and more informed decisions in what they do daily, in regards to things such as deployability, manageability, operability, etc. Developers Self-Manage Their Production Service Sometimes deployments break in production because we learn operational problems too late in the cycle. Have developers monitor and manage the service when it first launches before handing over to operations. This is practiced by Google. Ops can act as consultants to assist in the process. Launch guidance: Defect counts and severity Type and frequency of pager alerts Monitoring coverage System architecture Deployment process Production hygiene If these items in the checklist aren't met, they should be addressed before being deployed and managed in production. Any regulatory compliance necessary? If so, you now have to manage technical AND security / compliance risks. Create a service hand back mechanism. If a production service becomes difficult to manage, operations can hand it back to the developers. Think of it as a pressure release valve. Google still does this and shows a mutual respect between development and operations. Resources We Like The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations (Amazon) The Phoenix Project: A Novel about IT, DevOps, and Helping Y

Ep 139The DevOps Handbook – Anticipating Problems
We're using telemetry to fill in the gaps and anticipate problems while discussing The DevOps Handbook, while Michael is still weird about LinkedIn, Joe knows who's your favorite JZ, and Allen might have gone on vacation. You can find these show notes at https://www.codingblocks.net/episode139, in case you're reading these within your podcast player. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Secure Code Warrior – Start gamifying your organization's security posture today, score 5,000 points, and get a free Secure Code Warrior t-shirt. Survey Says What's your favorite mobile device? Joe's Super Secret Survey Go or Rust? Take both surveys at: https://www.codingblocks.net/episode139. News Thank you to everyone that left us a new review: iTunes: AbhiZambre, Traz3r Stitcher: AndyIsTaken Most important things to do for new developer job seekers? I Got 99 Problems and DevOps ain't One Find and Fill Any Gaps Once we have telemetry in place, we can identify any gaps in our metrics, especially in the following levels of our application: Business level – These are metrics on business items, such as sales transactions, signups, etc. Application level – This includes metrics such as timing metrics, errors, etc. Infrastructure level – Metrics at this level cover things like databases, OS's, networking, storage, CPU, etc. Client software level – These metrics include data like errors, crashes, timings, etc. Deployment pipeline level – This level includes metrics for data points like test suite status, deployment lead times, frequencies, etc. Application and Business Metrics Gather telemetry not just for technical bits, but also organizational goals, i.e. things like new users, login events, session lengths, active users, abandoned carts, etc. Have every business metric be actionable. And if they're not actionable, they're "vanity metrics". By radiating these metrics, you enable fast feedback with feature teams to identify what's working and what isn't within their business unit. Infrastructure Metrics Need enough telemetry to identify what part of the infrastructure is having problems. Graphing telemetry across infrastructure and application allows you to detect when things are going wrong. Using business metrics along with infrastructure metrics allows development and operations teams to work quickly to resolve problems. Need the same telemetry in pre-production environments so you can catch problems before they make it to production. Overlaying other Relevant Information onto Our Metrics In addition to our business and infrastructure telemetry graphing, you also want to graph your deployments so you can quickly correlate if a release caused a deviation from normal. There may even be a "settling period" after a deployment where things spike (good or bad) and then return to normal. This is good information to have to see if deployments are acting as expected. Same thing goes for maintenance. Graphing when maintenance occurs helps you correlate infrastructure and application issues at the time they're deployed. Resources We Like The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations (Amazon) The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win (Amazon) The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Data (Amazon) The ONE Metric More Important Than Sales & Subscribers (YouTube) 2020 Developer Survey – Most Loved, Dreaded, and Wanted Languages (Stack Overflow) Instrument your Python applications with Datadog and OpenTelemetry (Datadog) Why does speed matter? (web.dev) Dash goes virtual! Join us on Tuesday, August 11 (Datadog) Tip of the Week Google Career Certificates (grow.google) Google Offers 100,000 Scholarships – Here's How To Get One (Forbes) Grow with Google (grow.google) Hearth Bound (HearthBoundPodcast.com, Twitter) Tsunami (GitHub) is a general purpose network security scanner with an extensible plugin system for detecting high severity vulnerabilities with high confidence. Plugins for Tsunami Security Scanner (GitHub)

Ep 138The DevOps Handbook – The Technical Practices of Feedback
It's all about telemetry and feedback as we continue learning from The DevOps Handbook, while Joe knows his versions, Michael might have gone crazy if he didn't find it, and Allen has more than enough muscles. For those that use their podcast player to read these show notes, did you know that you can find them at https://www.codingblocks.net/episode138? Well, you can. And now you know, and knowing is half the battle. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Secure Code Warrior – Start gamifying your organization's security posture today, score 5,000 points, and get a free Secure Code Warrior t-shirt. Survey Says Which one? Take the survey at: https://www.codingblocks.net/episode138. News We give a heartfelt thank you in our best announcer voice to everyone that left us a new review! iTunes: TomJerry24, Adam Korynta Stitcher: VirtualShinKicker, babbansen, Felixcited Cost of a Data Breach Report 2020 (IBM) Garmin Risks Repeat Attack If It Paid $10 Million Ransom (Forbes) Almost 4,000 databases wiped in 'Meow' attacks (WeLiveSecurity.com) The Second Way: The Principles of Feedback Implementing the technical practices of the Second Way Provides fast and continuous feedback from operations to development. Allows us to find and fix problems earlier on the software development life cycle. Create Telemetry to Enable Seeing and Solving Problems Identifying what causes problems can be difficult to pinpoint: was it the code, was it networking, was it something else? Use a disciplined approach to identifying the problems, don't just reboot servers. The only way to do this effectively is to always be generating telemetry. Needs to be in our applications and deployment pipelines. More metrics provide the confidence to change things. Companies that track telemetry are 168 times faster at resolving incidents than companies that don't, per the 2015 State of DevOps Report (Puppet). The two things that contributed to this increased MTTR ability was operations using source control and proactive monitoring (i.e. telemetry). Create Centralized Telemetry Infrastructure Must create a comprehensive set of telemetry from application metrics to operational metrics so you can see how the system operates as a whole. Data collection at the business logic, application, and environmental layers via events, logs and metrics. Event router that stores events and metrics. This enables visualization, trending, alerting, and anomaly detection. Transforms logs into metrics, grouping by known elements. Need to collect telemetry from our deployment pipelines, for metrics like: How many unit tests failed? How long it takes to build and execute tests? Static code analysis. Telemetry should be easily accessible via APIs. The telemetry data should be usable without the application that produced the logs Create Application Logging Telemetry that Helps Production Dev and Ops need to be creating telemetry as part of their daily work for new and old services. Should at least be familiar with the standard log levels Debug – extremely verbose, logs just about everything that happens in an application, typically disabled in production unless diagnosing a problem. Info – typically action based logging, either actions initiated by the system or user, such as saving an order. Warn – something you log when it looks like there might be a problem, such as a slow database call. Error – the actual error that occurs in a system. Fatal – logs when something has to exit and why. Using the appropriate log level is more important than you think Low toner is not an Error. You wouldn't want to be paged about low toner while sleeping! Examples of some things that should be logged: Authentication events, System and data access, System and app changes, Data operations (CRUD), Invalid input, Resource utilization, Health and availability, Startups and shutdowns, Faults and errors, Circuit breaker trips, Delays, Backup success and failure Use Telemetry to Guide Problem Solving Lack of telemetry has some negative issues: People use it to avoid being blamed for problems, which can be due to a political atmosphere and SUPER counter-productive. Telemetry allows for scientific methods of problem solving to be used. This approach leads to faster MTTR and a much better relationship between Dev and Ops. Enable Creation of Production Metrics as Part of Daily Work This needs to be easy, one-line implementations. StatsD, often used with Graphite or Graphana, creates timers and counters with a single line of code. Use data to generate graphs, and then overlay those graphs with production changes to see if anything changed significantly. This gives you the confidence to make changes. Create Self-Service Access to Telemetry and Information Radiators Make the data available to anyone in the value stream without having to jump through hoops to get it, be they part of Development, Operations, Product Management, or Infose

Ep 137The DevOps Handbook – Architecting for Low-Risk Releases
Our journey into the world of DevOps continues with The DevOps Handbook as Michael doesn't take enough tangents, Joe regrets automating the build, err, wait never regrets (sorry), and ducks really like Allen. If you're reading these show notes via your podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode137, where you can be a part of the conversation. Sponsors Datadog – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Secure Code Warrior – Start gamifying your organization's security posture today, score 5,000 points, and get a free Secure Code Warrior t-shirt. Survey Says What is your meeting limit? Take the survey at: https://www.codingblocks.net/episode137. News Thank you to everyone that left us a new review! iTunes: justsomedudewritingareview, stupub, andrew.diamond, scipiomarcellus Stitcher: Bicycle Repairman, BrunoLC Using Bazel to build and test software of any size, quickly and reliably. (bazel.build) Reflections on Trusting Trust (cs.cmu.edu) Build your own Linux distro! (linuxfromscratch.org) That System76 Oryx Pro keyboard though? (System76) Fast, Reliable. Pick Two Continuously Build, Test, and Integrate our Code and Environments Build and test processes run constantly, independent of coding. This ensures that we understand and codify all dependencies. This ensures repeatable deployments and configuration management. Once changes make it into source control, the packages and binaries are created only ONCE. Those same packages are used throughout the rest of the pipeline to ensure all environments are receiving the same bits. What does this mean for our team culture? You need to maintain reliable automated tests that truly validate deploy-ability. You need to stop the "production pipeline" when validation fails, i.e. pull the andon cord. You need to work in small, short lived batches that are based on trunk. No long-lived feature branches. Short, fast feedback loops are necessary; builds on every commit. Integrate Performance Testing into the Test Suite Should likely build the performance testing environment at the beginning of the project so that it can be used throughout. Logging results on each run is also important. If a set of changes shows a drastic difference from the previous run, then it should be investigated. Enable and Practice Continuous Integration Small batch and andon cord style development practices optimize for team productivity. Long lived feature branches optimize for individual productivity. But: They require painful integration periods, such as complex merges, which is "invisible work". They can complicate pipelines. The integration complexity scales exponentially with the number of feature branches in play. They can make adding new features, teams, and individuals to a team really difficult. Trunk based development has some major benefits such as: Merging more often means finding problems sooner. It moves us closer to "single piece flow", such as single envelope at a time story, like one big assembly line. Automate and Enable Low-Risk Releases Small batch changes are inherently less risky. The time to fix is strongly correlated with the time to remediate, i.e. the mean time to find (MTF) and the mean time to remediate (MTR). Automation needs to include operational changes, such as restarting services, that need to happen as well. Enable "self-service" deployments. Teams and individuals need to be able to dynamically spin up reliable environments. Decouple Deployments from Releases Releases are marketing driven and refer to when features are made available to customers. Feature flags can be used to toggle the release of functionality independent of their deployments. Feature flags enable roll back, graceful degradation, graceful release, and resilience. Architect for Low-Risk Releases Don't start over! You make a lot of the same mistakes, and new ones, and ultimately end up at the same place. Instead, fix forward! Use the strangler pattern instead to push the good stuff in and push the bad stuff out, like how strangler vines grow to cover and subsume a fig tree. Decouple your code and architecture. Use good, strong versioned APIs, and dependency management to help get there. Resources We Like The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations (Amazon) The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win (Amazon) The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Data (Amazon) Andon (manufacturing) (Wikipedia) LEGO Nintendo Entertainment System (lego.com) Comparing Git Workflows (episode 90) StranglerFigApplication (MartinFowler.com) Tip of the Week Be sure to check out the gaming channel in Slack to find and connect with some great people for your next game. Also, look up in the Slack channel. There may be cool information in the channel's description. Wit

Ep 136The DevOps Handbook - The Technical Practices of Flow
We begin our journey into the repeatable world of DevOps by taking cues from The DevOps Handbook, while Allen loves all things propane, Joe debuts his "singing" career with his new music video, and Michael did a very bad, awful thing. These show notes can be found at https://www.codingblocks.net/episode136 for those reading this via their podcast player. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Survey Says When you do listen to music, how do you do it? Take the survey at: https://www.codingblocks.net/episode136. News We're very thankful for all of the new reviews! iTunes: galTheJewishHammer, Ragnaroekk, Marcel7473826, rkosko31 Stitcher: Bicycle Repairman, BrunoLC Joe serenades us in song! (YouTube) Congratulations Allen on his renewed MVP status! What is The DevOps Handbook? It's a collection of arguments and high level guidance for understanding the spirit of DevOps. It's light on specifics and heavy on culture. The tools aren't the problem here, the people need to change. It's also a book about scaling features, teams, people, and environments. The First Way: The Principles of Flow The Deployment Pipeline is the Foundation Continuous delivery: Reduces the risk associated with deploying and releasing changes. Allows for an automated deployment pipeline. Allows for automated tests. Environments on Demand Always use production like environments at every stage of the stream. Environments must be created in an automated fashion. Should have all scripts and configurations stored in source control. Should require no intervention from operations. The reality though … Often times the first time an application is tested in a production like environment, is in production. Many times test and development environments are not configured the same. Ideally though … Developers should be running their code in production like environments from the very beginning, on their own workstations. This provides an early and constant feedback cycle. Rather than creating wiki pages on how to set things up, the configurations and scripts necessary are committed to source control. This can include any of all of the following: Copying virtualized environments. Building automated environments on bare metal. Using infrastructure as code, i.e. Puppet, Chef, Ansible, Salt, CFEngine, etc. Using automated OS configuration tools. Creating environments from virtual images or containers. Creating new environments in public clouds. All of this allows entire systems to be spun up quickly making this … A win for operations as they don't have to constantly battle configuration problems. A win for developers because they can find and fix things very early in the development process that benefits all environments. "When developers put all their application source files and configurations in version control, it becomes the single repository of truth that contains the precise intended state of the system." The DevOps Handbook Check Everything into One Spot, that Everybody has Access to Here are the types of things that should be stored in source control: All application code and its dependencies (e.g. libraries, static content, etc.) Scripts for creating databases, lookup data, etc. Environment creation tools and artifacts (VMWare, AMI images, Puppet or Chef recipes). Files used to create containers (Docker files, Rocket definition files, etc.) All automated tests and manual scripts. Scripts for code packaging, deployments, database migrations, and environment provisioning. Additional artifacts such as documentation, deployment procedures, and release notes. Cloud configuration files, such as AWS CloudFormation templates, Azure ARM templates, Terraform scripts, etc.) All scripts or configurations for infrastructure supporting services for things like services buses, firewalls, etc. Make Infrastructure Easier to Rebuild than to Repair Treat servers like cattle instead of pets, meaning, rather than care for and fix them when they're broken, instead delete and recreate them. This has the side effect of keeping your architecture fluid. Some have adopted immutable infrastructure where manual changes to environments are not allowed. Instead, changes are in source control which removes variance among environments. The Definition of Done "Done" means your changeset running in a production-like environment. This ensures that developers are involved in getting code to production and bring operations closer to the code. Enable Fast and Reliable Automated Testing Automated tests let you move faster, with more confidence, and shortens feedback cycles for catching and fixing problems earlier. Automated testing allowed the Google Web Server team to go from one of the least productive, to most productive group in the company. Resources We Like The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations (Amazon) The Phoenix Proje

Ep 135Survey Says ... 2020 Stack Overflow Developer Survey
We review the Stack Overflow Developer Survey in the same year it was created for the first time ever, while Joe has surprising news about the Hanson Brothers, Allen doesn't have a thought process, and Michael's callback is ruined. If you're reading these show notes via your podcast player, you can find this episode's full show notes and join the conversation at https://www.codingblocks.net/episode135. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Registration is NOW OPEN! Sign up and reserve your seat today! Survey Says How do you feel about semi-colons? Take the survey at: https://www.codingblocks.net/episode135, News Thank you, we appreciate the latest reviews: iTunes: Akma12345678843225, Rdudek101, SuperGoodDave, vis_1, Asaurus Rex, Brainswart, pr0ph3t, JoesGotTalent, RunsWithScissors Stitcher: TheDude01, barnabasj, oneWithTwoDotsOverTheO, MustardMakerDeluxe, OnlyRaul, _agentShrapnel, yael, d3v3l0p3r, eats_glue Zoom says free users will get end-to-end encryption after all (The Verge) AMD Ryzen 4000-Powered Asus Mini PC Challenges Intel's NUC (Tom's Hardware) Joe was a guest on Gaming Fyx! Gaming Fyx – Episode 125! (Cloudy With A Chance Of PS5!!) (fyx.space) Resources We Like 2020 Developer Survey (Stack Overflow) Tip of the Week Firefox now has their own VPN service: Firefox Private Network. (fpn.firefox.com) SDKMAN! The software development kit manager for managing parallel versions of multiple SDKs on most Unix based systems. (sdkman.io) What is Scaffolder, and how you can use it to increase your team dev velocity (dev.to) Fast, repeatable, simple, local Kubernetes development. (skaffold.dev)

Ep 134Google's Engineering Practices – How to Navigate a Code Review
As we learn from Google about how to navigate a code review, Michael learns to not give out compliments, Joe promises to sing if we get enough new reviews, and Allen introduces a new section to the show. For those reading this via their podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode134. Sponsors University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Registration is NOW OPEN! Sign up and reserve your seat today! Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Survey Says How many hours per week do you work on average? Take the survey at: https://www.codingblocks.net/episode134. News Thank you, we appreciate the latest reviews: Stitcher: Jean Guillaume Misteli, gitterskow LGTM Navigating a CL in Review A couple starting questions when reviewing a CL (changelist): Does the change make sense? Does the CL have a good description? Take a broad view of the CL If the change doesn't make sense, you need to immediately respond with WHY it shouldn't be there. Typically if you do this, you should probably also respond with what they should have done. Be courteous. Give a good reason why. If you notice that you're getting more than a single CL or two that doesn't belong, you should consider putting together a quick guide to let people know what should be a part of CL's in a particular area of code This will save a lot of work and frustration. Examine the main parts of the CL Look at the file with the most changes first as that will typically aid in figuring out the rest of the CL quicker. The smaller changes are usually part of that bigger change. Ask the developer to point you in the right direction. Ask to have the CL split into multiple smaller CL's If you see a major problem with the CL, you need to send that feedback immediately, maybe even before you look at the rest of the CL. Might be that the rest of the CL isn't even legit any longer if the major problem ends up being a show stopper. Why's it so important to review and send out feedback quickly? Developers might be moving onto their next task that built off the CL in review. You want to reduce the amount of wasted effort. Developers have deadlines they have to meet so if there's a major change that needs to happen, they need to find out about it as soon as possible. Look at the rest of the CL in an appropriate sequence Looking at files in a meaningful order will help understanding the CL. Reviewing the unit tests first will help with a general understanding of the CL. Speed of Code Reviews Velocity of the team is more important than the individual. The individual slacking on the review gets other work done, but they slow things down for the team. Looking at the other files in the CL in a meaningful order may help in speed and understanding of the CL. If there are long delays in the process, it encourages rubber stamping. One business day is the maximum to time to respond to a CL. You don't have to stop your flow immediately though. Wait for a natural break point, like after lunch or a meeting. The primary focus on response time to the CL. When is it okay to LGTM (looks good to me)? The reviewer trusts the developer to address all of the issues raised. The changes are minor. How to write code review comments Be kind. Explain your reasoning. Balance giving directions with pointing out problems. Encourage simplifications or add comments instead of just complaining about complexity. Courtesy is important. Don't be accusatory. Don't say "Why did you…" Say "This could be simpler by…" Explain why things are important. It's the developer's responsibility to fix the code, not the reviewer's. It's sufficient to state the problem. Code review comments should either be conveyed in code or code comments. Pull request comments aren't easily searchable. Handling pushback in code reviews When the developer disagrees, consider if they're right. They are probably closer to the code than you. If you believe the CL improves things, then don't give up. Stay polite. People tend to get more upset about the tone of comments, rather than the reviewers insistence on quality. The longer you wait to clean-up, the less likely the clean-up is to happen. Better to block the request up front then move on. Having a standard to point to clears up a lot of disputes. Change takes time, people will adjust. Resources We Like Google Engineering Practices Documentation (GitHub) Navigating a CL in review (GitHub) Speed of Code Reviews (GitHub) How to write code reviews comments (GitHub) Handling pushback in code reviews (GitHub) The CL author's guide to getting through code review (GitHub) Writing good CL descriptions (GitHub) Small CLs (GitHub) How to handle reviewer comments (GitHub) The Myers diff algorithm: part 1 (b

Ep 133Google's Engineering Practices - What to Look for in a Code Review
We learn what to look for in a code review while reviewing Google's engineering practices documentation as Michael relates patterns to choo-choos, Joe has a "weird voice", and Allen has a new favorite portion of the show. Are you reading this via your podcast player? You can find this episode's full show notes at https://www.codingblocks.net/episode133 where you can also join the conversation. Sponsors University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Registration is NOW OPEN! Sign up and reserve your seat today! Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Survey Says How likely are you to advocate for working from home in the future? Take the survey at: https://www.codingblocks.net/episode133. News Thank you to everyone that left us a review: iTunes: codewith_himanshu, SpaceDuckets, akirakinski Stitcher: Anonymous (from Croatia), Llanfairpwllgwyngyll (Wikipedia), Murali Suriar Watch Joe solve LeetCode Problems (YouTube) Regarding the OWNERs file … // TODO: Insert Clever Subtitle Here Design This is the MOST IMPORTANT part of the review: the overall design of the changelist (CL). Does the code make sense? Does it belong in the codebase or in a library? Does it meld well with the rest of the system? Is it the right time to add it to the code base? Functionality Does the CL do what it's supposed to do? Even if it does what it's supposed to do, is it a good change for the users, both developers and actual end-users? As a reviewer, you should be thinking about all the edge-cases, concurrency issues, and generally just trying to see if any bugs arise just looking at the code. As a reviewer, you can verify the CL if you'd like, or have the developer walk you through the changes (the actual implemented changes rather than just slogging through code). Google specifically calls out parallel programming types of issues that are hard to reason about (even when debugging) especially when it comes to deadlocks and similar types of situations. Complexity This should be checked at every level of the change: Single lines of code, Functions, and Classes Too complex is code that is not easy to understand just looking at the code. Code like this will potentially introduce bugs as developers need to change it in the future. A particular type of complexity is over-engineering, where developers have made the code more generic than it needs to be, or added functionality that isn't presently needed by the system. Reviewers should be especially vigilant about over-engineering. Encourage developers to solve the problem they know needs to be solved now, not the problem that the developer speculates might need to be solved in the future. The future problem should be solved once it arrives and you can see its actual shape and requirements in the physical universe. Google's Engineering Practices documentation Tests Usually tests should be added in the same CL as the change, unless the CL is for an emergency. Emergencies were discussed in episode 132. Make sure the tests are correct and useful. Will the tests fail if the code is broken? Are the assertions simple and useful? Are the tests separated appropriately into different test methods? Naming Were good names chosen? A good name is long enough to be useful and not too long to be hard to read, Comments Were the comments clear and understandable, in English? Were the comments necessary? They should explain WHY code exists and NOT what it's doing. If the code isn't clear enough on its own, it should be refactored. Exceptions to the rule can include regular expressions and complex algorithms. Comments are different than documentation of code. Code documentation expresses the purpose, usage and behavior of that code. Style Have a style guide. Google has one for most of the languages they use. Make sure the CL follows the style guide. If something isn't in the style guide, and as the reviewer you want to comment on the CL to make a point about style, prefix your comment with "Nit". DO NOT BLOCK PR's based on personal style preference! Style changes should not be mixed in with "real" changes. Those should be a separate CL. Consistency Google indicates that if existing code conflicts with the style guide, the style guide wins. If the style guide is a recommendation rather than a hard requirement, it's a judgement call on whether to follow the guide or existing code. If no style guide applies, the CL should remain consistent with existing code. Use TODO statements for cleaning up existing code if outside the scope of the CL. Documentation If the CL changes any significant portion of builds, interactions, tests, etc., then appropriate README's, reference docs, etc. should be updated. If the CL deprecates portions of the documentation, that should also likely

Ep 132Google's Engineering Practices – Code Review Standards
We dig into Google's engineering practices documentation as we learn how to code review while Michael, er, Fives is done with proper nouns, Allen can't get his pull request approved, and Joe prefers to take the average of his code reviews. In case you're reading this via your podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode132. Be sure to check it out and join the conversation. Sponsors University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Registration is NOW OPEN! Sign up and reserve your seat today! Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after your first dashboard. Survey Says Do you *always* include (new or updated) unit tests with your pull requests? Take the survey at: https://www.codingblocks.net/episode132. News Thank you to everyone that left us a review: iTunes: Jbarger, Podcast Devourer, Duracce Stitcher: Daemyon C How to Code Review Code Review Developer Guide Q: What is a code review? A: When someone other than the author of the code examines that code. Q: But why code review? A: To ensure high quality standards for code as well as helping ensure more maintainable code. What should code reviewers look for? Design: Is the code well-designed and appropriate for your system? Functionality: Does the code behave as the author likely intended? Is the way the code behaves good for its users? Complexity: Could the code be made simpler? Would another developer be able to easily understand and use this code when they come across it in the future? Tests: Does the code have correct and well-designed automated tests? Naming: Did the developer choose clear names for variables, classes, methods, etc.? Comments: Are the comments clear and useful? Style: Does the code follow our style guides? Documentation: Did the developer also update relevant documentation? Picking the Best Reviewers Get the best reviewer you can, someone who can review your code within the appropriate time frame. The best reviewer is the one who can give you the most thorough review. This might or might not be people in the OWNERS file. Different people might need to review different portions of your changes for the same pull request. If the "best" person isn't available, they should still be CC'd on the change list. In Person Reviews If you pair-programmed with someone who was the right person for a code review, then the code is considered reviewed. You can also do code reviews where the reviewer asks questions and the coder only speaks when responding to the questions. How to do a Code Review The Standard of a Code Review The purpose of the code review is to make sure code quality is improving over time. There are trade-offs: Developers need to actually be able to complete some tasks. If reviewers are a pain to work with, for example they are overly critical, then folks will be less incentivized to make good improvements or ask for good reviews in the future. It is still the duty of the reviewer to make sure the code is good quality. You don't want the health of the product or code base to degrade over time. The reviewer has ownership and responsibility over the code they're reviewing. Reviewers should favor approving the changes when the code health is improved even if the changes aren't perfect. There's no such thing as perfect code, just better code. Reviewers can actually reject a set of changes even if it's quality code if they feel it doesn't belong in "their" system. Reviewers should not seek perfection but they should seek constant improvement. This doesn't mean that reviewers must stay silent. They can point out things in a comment using a prefix such as "Nit", indicating something that could be better but doesn't block the overall change request. Code that worsens the overall quality or health of a system should not be admitted unless it's under extreme/emergency circumstances. What constitutes an emergency? A small change that: Allows a major launch to continue, Fixes a significant production bug impacting users, Addresses a legal issue, or Patches a security hole. What does not constitute an emergency? You want the change in sooner rather than later. You've worked hard on the feature for a long time. The reviewers are away or in another timezone. Because it's Friday and you want the code merged in before the weekend. A manager says that it has to be merged in today because of a soft deadline. Rolling back causes test failures or breaks the build. Mentoring Code reviews can absolutely be used as a tool for mentoring, for example teaching design patterns, explaining algorithms, etc., but if it's not something that needs to be changed for the PR to be completed, note it as a "Nit" or "Note". Principles Technical facts and data overrule opinions and/or preferences. The st

Ep 131Big Data - How Far is Too Far?
We gather around the water cooler at 6 foot distances as Michael and Joe aren't sure what they streamed, we finally learn who has the best fries, at least in the US, and Allen doesn't understand evenly distributing your condiments. For those reading this via their podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode131. Stop by and join in on the conversation. Survey Says Are you staying sane during these stay-at-home orders? Take the survey at: https://www.codingblocks.net/episode131. News We really appreciate the latest reviews, so thank you! iTunes: Braver1996summer, eleneshector, Dis14Joe Stitcher: Nik P, Anonymous, Please HelP, Dis14Joe, thephdwasamistake Be on the lookout for live streams of Joe on YouTube or Twitch! Heard Around the Water Cooler COVID-19 Pushes Up Internet Use 70% And Streaming More Than 12%, First Figures Reveal (Forbes) Security at Zoom (Zoom) Joe has been busy live streaming (YouTube) Come learn Apache Drill with us! (YouTube) Cmder – Portable console emulator for Windows. We're still learning the keyboard shortcuts. 30-Day LeetCoding Challenge (LeetCode.com) Codewars – Achieve mastery through challenge. Conway's Game of Life (Wikipedia) by John Horton Conway (Wikipedia) Coding Interview Tips, How to get better at technical interviews without practicing (InterviewCake.com) True descriptions of languages (Reddit) Allen upgrades to the AMD Ryzen 9 3900x AMD Ryzen 9 3900X 12-core, 24-thread CPU (Amazon) Asus TUF A15 laptop review: AMD's Ryzen 4000 is a groundbreaking mobile CPU (Eurogamer.net) Big data has been on our minds lately. Data lake (Wikipedia) Apache Hadoop Apache Cassandra Apache Parquet Google Cloud Bigtable Uber's Big Data Platform: 100+ Petabytes with Minute Latency (eng.uber.com) Tip of the Week Interested in COBOL, game development, and Dvorak keyboards? Check out Joe's new favorite streamer Zorchenhimer. (Twitch) Using helm uninstall doesn't remove persistent volumes nor their claims. After doing helm uninstall RELEASE_NAME, delete the persistent volume claim using kubectl delete pvc PVC_NAME to remove the claim, which depending on the storage class and reclaim policy, will also remove the persistent volume. Otherwise, you'd need to manually remove the persistent volume using kubectl delete pv PV-NAME. kafkacat – A generic non-JVM producer and consumer for Apache Kafka. (GitHub)

Ep 130Designing Data-Intensive Applications - To B-Tree or not to B-Tree
We dig into the details of how databases use B-trees as we continue our discussion of Designing Data-Intensive Applications while Michael's description of median is awful, live streaming isn't for Allen, and Joe really wants to bring us back from the break. For those reading this via their podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode130 in all their glory. Check it out, as Joe would say, and join the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after install the agent. Survey Says What tools are you using to ease WFH? Take the survey at: https://www.codingblocks.net/episode130. News We really appreciate the latest reviews, so thank you! iTunes: Anips79, Jacobboyd23, LoadedGalaxy, JenT Avid Listener Pluralsight is free for the month of April! (Pluralsight) TechSmith is offering Snagit and Video Review for free through June 2020. (TechSmith) Remember when we gushed over Zoom? Zoom: Every security issue uncovered in the video chat app (CNET) Zoom Go Boom (TWiT) Maybe should use Jitsi instead of Zoom. (Jitsi) Be on the lookout for live streams of Joe on YouTube or Twitch! B-Trees are Awesome B-trees are the most commonly used indexing structure. Introduced in 1970, and called ubiquitous 10 years later. They are the implementation used by most relational database systems, as well as a number of non-relational DB's. "Indexing" is the way databases store metadata about your data to make quick look ups. Like the SSTable, the B-tree stores key/value pairs sorted by key. This makes range query look ups quick. B-trees use fixed block sizes, referred to as pages, that are usually 4 KB in size which (generally) map well to the underlying hardware because disks are typically arranged in fixed block sizes. Every page has an address that can be referenced from other pages. These are pointers to positions on a disk. Knowing (or being able to quickly find) which page the data you are looking for is in, drastically cuts down on the amount of data you have to scan through. B-trees start with a root page. All key searches start here. This root will contain references to child pages based off of key ranges. The child pages might contain more references to other child pages based off of more narrowly focused key ranges. This continues until you reach the page that has the data for the key you searched for. These pages are called leaf pages, where the values live along with the key. The branching factor is the number of references to child pages in one page of a B-tree. The branching factor is tied to the space needed to store the page references and the range boundaries. The book states that it's common to have a branching factor of several hundred, some even say low thousands! The higher the branching factor means the fewer levels you have to go through, i.e. less pages you have to scan, when looking for your data. Updating a value in a B-tree can be complicated. You search for the leaf node containing the key and then update the value and write it to disk. Assuming everything fits in the page, then none of the upstream references change and everything is still valid. If you are inserting a new key, you find the leaf node where the key should live based on the ranges and then you add the key and value there. Again, if everything fits in the page, then similar to the update, none of the upstream references need to change. However, if the key/value would exceed the size of the page, the page is split into two half-pages, and the parent page's references are updated to point to the new pages. This update to the parent page might require it to also be split. And this update/split pattern might continue up to and including the root page. By splitting the pages into halves as data is added that exceeds the page size, this keeps the tree balanced. A balanced tree is the secret to consistent lookup times. It terms of big-O, a B-tree with n keys has a depth of O(log n). Most DB's only go 3 to 4 levels deep. A tree with four levels, using a 4 KB page size, and a branching factor of 500 can store up to 256 TB! Making B-Trees Reliable The main notion is that writes in a B-tree occur in the same location as the original page, that way no references have to change, assuming the page size isn't exceeded. Think of this as a hardware operation. These actually map to spinning drives better than SSD's. SSD's must rewrite large blocks of a storage chip at a time. Because some operations require multiple pages to be written, in the case of splitting full pages and updating the parent, it can be dangerous because if there is a DB crash at any point during the writing of the pages, you can end up with orphaned pages. To combat this, implementations usually include a write-ahead log (WAL, aka a redo log). This is an append-only file where all modifications go before the tree is updated. If the database crashes, this file is r

Ep 129How to Work Remote Effectively
Since we can't leave the house, we discuss what it takes to effectively work remote while Allen's frail body requires an ergonomic keyboard, Joe finally takes a passionate stance, and Michael tells them why they're wrong. Reading these show notes via your podcast player? You can find this episode's full show notes at https://www.codingblocks.net/episode129 and be a part of the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after install the agent. University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Spring registration is NOW OPEN! Sign up and reserve your seat today! Survey Says What's your preferred method to increase your productivity? Take the survey at: https://www.codingblocks.net/episode129. News Thank you, krauseling, for the latest iTunes review. TechSmith is offering Snagit and Video Review for free through June 2020. (TechSmith) How to WFH The Essentials First and foremost, get a quality internet connection. For video calls, favor lower latency over higher bandwidth. Turn your camera on. Use a comfortable headset with a good microphone Wired headphones are definitely the way to go. Better audio quality, fewer problems, and no battery life issues to worry about. Mute unless talking. Not all video sharing is equal. Know which to use when screen sharing. Screen sharing in Zoom is much better than in Hangouts. The text on the screen is crisp and readable and the screen sharing session is responsive. Communicate when you will be away during normal hours. Make sure your IM application status and/or availability is accurate. Sound Good Price Description $30 Sony MDRXB50AP Extra Bass Earbuds Headset with mic (Amazon) $149 SteelSeries Arctis 7 Gaming Headphones (Amazon) $18 Apple EarPods with 3.5mm Headphone Plug (Amazon) Avoid these headphones Description Price Sennheiser SC 130 USB Single Sided Headset (Amazon) NA Sennheiser SC 160 USB Double-Sided Headset (Amazon) $65 Look Good, too Price Description NA Logitech c930e WebCam (Amazon) Digging Deeper Don't be afraid to spend time on calls just chatting about non work related stuff. Working from home means there's little opportunity to connect personally and that is sorely needed when working from home. Taking time to chat will help to keep the team connected. Keep it light and have fun! Be available and over communicate. During business hours make sure you're available. That doesn't mean you need to be in front of your computer constantly, but it does mean to make sure you can be reached via phone, email, or chat and can participate when needed. Working from home also means it is super important to communicate status and make sure people feel like progress is being made. Also, if you need to be offline for any reason, send up a flare, don't just disappear. Make sure your chat application status is really your status. People will rely on you showing "Active" meaning that you are available. Don't game your status. Take a break if you need to but if you aren't available, don't show available. Also, if you don't show "Active" many will assume that you aren't available or online. We've also found that sometimes it is good to show "offline" or "unavailable" to give us a chance to get into a flow and get things done, so don't be afraid to do that. Having this be a "known agreement" will signal to others that they may just want to send you an e-mail or schedule a conference later. If something is urgent in email, make sure to send the subject with a prefix of "URGENT:" But beware the an "urgent" email doesn't mean you'll get an instant reply. If you need an answer right now, consider a phone call. An "urgent" email should be treated as "as soon as you read this", knowing that it might not be read for a while. Make sure your calendar is up to date. If you are busy or out of the office (OOO) then make sure you schedule that in your calendar so that people will know when they can meet with you. Along with the above, when scheduling meetings, check the availability of your attendees. Be flexible. This goes with things mentioned above. As a manager especially, you need to be flexible and recognize that working from home sometimes means people need to be away for periods of time for personal reasons. Don't sweat that unless these people aren't delivering per the next point. Favor shorter milestones or deliverables and an iterative approach. This helps keep people focused and results oriented. Science projects are easy to squash if you define short milestones that provide quick wins on the way to a longer term goal. We use the term "fail fast" a lot where we break projects into smaller bits and try to attack what's scariest first in an effort to "fail fast" and change course. We use JIRA and work in 2 week sprints. Define work in small enough

Ep 128Designing Data-Intensive Applications - SSTables and LSM-Trees
It's time to learn about SSTables and LSM-Trees as Joe feels pretty zacked, Michael clarifies what he was looking forward to, and Allen has opinions about Dr Who. These show notes can be found at https://www.codingblocks.net/episode128 where you be a part of the conversation, in case you're reading this via your podcast player. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after install the agent. ABOUT YOU processes > 200,000 API calls per minute. You like things that scale? Give their corporate page a visit! They are looking for new team members! Apply now at aboutyou.com/job. University of California, Irvine Division of Continuing Education – One of the top 50 nationally ranked universities, UCI offers over 80 certificates and specialized programs designed for working professionals. Spring registration is NOW OPEN! Sign up and reserve your seat today! Survey Says Do you leave your laptop plugged in the majority of the time? Take the survey at: https://www.codingblocks.net/episode128. News Thank you for all of the great reviews: iTunes: devextremis, CaffinatedGamer, Matt Hussey, index out of range Stitcher: Marcos Sagrado, MoarLiekCodingRokzAmirite, Asparges69 Sadly, due to COVID-19 (aka Coronavirus), the 15th Annual Orlando Code Camp & Tech Conference has been cancelled. We'll keep you informed of your next opportunity to kick us in the shins. (orlandocodecamp.com) During this unprecedented time, TechSmith is offering Snagit and Video Review for free through June 2020. (TechSmith) SSTables and LSM-Trees SSTables SSTable is short for "Sorted String Table". SSTable requires that the writes be sorted by key. This means we cannot append the new key/value pairs to the segment immediately because we need to make sure the data is sorted by key first. What are the benefits of the SSTable over the hash indexed log segments? Merging the segments is much faster, and simpler. It's basically a mergesort against the segment files being merged. Look at the first key in each file, and take the lowest key (according to the sort order), add it to the new segment file … rinse-n-repeat. When the same key shows in multiple segment files, keep the newer segment's key/value pair, sticking with the notion that the last written key/value for any given key is the most up to date value. To find keys, you no longer need to keep the entire hash of indexes in memory. Instead, you can use a sparse index where you store a key in memory for every few kilobytes from a segment file This saves on memory. This also allows for quick scans as well. For example, when you search for a key, Michael and the key isn't in the index, you can find two keys in the sparse index that Michael falls between, such as Micah and Mick, then start at the Micah offset and scan that portion of the segment until you find the Michael key. Another improvement for speeding up read scans is to write chunks of data to disk in compressed blocks. Then, the keys in the sparse index point to the beginning of that compressed block. So how do you write this to disk in the proper order? If you just write them to disk as you get them, they'll be out of order in an append only manner because you're likely going to receive them out of order. One method is to actually write them to disk in a sorted structure. B-Tree is one option. However, maintaining a sorted structure in memory is actually easier than trying to maintain it on disk though, due to well known tree data structures like red-black trees and AVL trees. The keys are sorted as they're inserted due to the way nodes are shuffled during inserts. This allows you to write the data to memory in any order and retrieve it sorted. When data arrives, write it to the memory balanced tree data structure, such as a red-black tree. This is also referred to as a memtable. Once you've reached a predefined size threshold, you dump the data from memory to disk in a new SSTable file. While the new segment is being written to disk, any incoming key/value pairs get written to a new memtable. When serving up read requests, you search in your memtable first, then back to the most recent segment, and so on moving backwards until you find the key you're looking for. Occasionally run a merge on the segments to get rid of overwritten or deleted items. Downside of this method? If the database crashes for some reason, the data in the memtable is lost. To avoid this, you can use an append-only, unsorted log for each new record that comes in. If the database crashes, that log file can be used to recreate the memtable. LSM-Trees This implementation is the ground work for: LevelDB (GitHub) and RocksDB (GitHub), Databases intended to be embedded in other applications, RocksDB is embedded in Kafka Streams and is used for GlobalKTables. Similar storage engines are used by Cassandra and HBase. Both took some design queues from Google's BigTable whitepaper, which introduced the terms SSTable and me

Ep 127Designing Data-Intensive Applications – Storage and Retrieval
In this episode, Allen is back, Joe knows his maff, and Michael brings the jokes, all that and more as we discuss the internals of how databases store and retrieve the data we save as we continue our deep dive into Designing Data-Intensive Applications. If you're reading these show notes via your podcast player, did you know that you can find them at https://www.codingblocks.net/episode127? Well you do now! Check it out and join in the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 10% off any course or annual subscription. Clubhouse – The fast and enjoyable project management platform that breaks down silos and brings teams together to ship value, not features. Sign up to get two additional free months of Clubhouse on any paid plan by visiting clubhouse.io/codingblocks. Survey Says Which fast food restaurant makes the better fries? Take the survey at: https://www.codingblocks.net/episode127. News We thank all of the awesome people that left us reviews: iTunes: TheLunceforce, BrianMorrisonMe, Collectorofmuchstuff, Momentum Mori, brianbrifri, Isyldar, James Speaker Stitcher: adigolee Come see Allen, Joe, and Michael in person at the 15th Annual Orlando Code Camp & Tech Conference, March 28th. Sign up for your chance to kick them all in the shins and grab some swag. (orlandocodecamp.com) Database Storage and Retrieval A database is a collection of data. A database management system includes the database, APIs for managing the data and access to it. RDBMS Storage Data Structures Generally speaking, data is written to a log in an append only fashion, which is very efficient. Log: an append-only sequence of records; this doesn't have to be human readable. These write operations are typically pretty fast because writing to the end of a file is generally a very fast operation. Reading for a key from a file is much more expensive though as the entire file has to be scanned for instances of the key. To solve this problem, there are indexes. Generally speaking, an index is just different ways to store another structure derived from the primary set of data. Having indices incurs additional overhead on writes. You're no longer just writing to the primary data file, but you're also keeping the indices up to date at the same time. This is a trade-off you incur in databases: indexes speed up reads but slow down writes. Hash Indexes One possible solution is to keep every key's offset (which points to the location of the value of the key) in memory. This is what is done for Bitcask, the default storage engine for Riak. The system must have enough RAM for the index though. In the example given, all the keys stay in memory, but the file is still always appended to, meaning that the key's offset is likely to change frequently, but it's still very efficient as you're only ever storing a pointer to the location of the value. If you're always writing to a file, aren't you going to run out of disk space? File segmenting / compaction solves this. Duplicate keys in a given file are compacted to store just the last value written for the key, and those values are written to a new file. This typically happens on a background thread. Once the new segment file has been created, after merging in changes from the previous file, then it becomes the new "live" log file. This means while the background thread is running to create the new segment, the locations for keys are being read from the old segment files in the meantime so that processes aren't blocked. After the new segment file creation is completed, the old segment files can be deleted. This is how Kafka topic retention policies work, and what happens when you run "force merge" on an Elasticsearch index (same goes for similar systems). Some key factors in making this work well: File format CSV is not a great format for logs. Typically you want to use a binary format that encodes the length of the string in bytes with the actual string appended afterwards. Deleting records requires some special attention You have to add a tombstone record to the file. During the merge process, the key and values will be deleted. Crash recovery If things go south on the server, recovering might take some time if there are large segments or key/value pairs. Bitcask makes this faster by snapshotting the in-memory hashes on occasion so that starting back up can be faster. Incomplete record writes Bitcask files include checksums so any corruption in the logs can be ignored. Concurrency control It's common for there to only be one writer thread, but multiple reader threads, since written data is immutable. Why not update the file, instead of only appending to it? Appending and merging are sequential operations, which are particularly efficient on HDD and somewhat on SSD. Concurrency and crash r

Ep 126Why Attend Developer Conferences and What were the Hot Topics at NDC London 2020?
Jamie from https://dotnetcore.show/ and Allen, ya know, from Coding Blocks, sat down together at NDC London to talk about the hot topics from the conference as well as how to get the most out of any conference you attend. If you're reading this episodes show notes via your podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode126 where you can join in on the conversation. Sponsors Datadog - Sign up today at codingblocks.net/datadog for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Read Datadog's new State of Serverless research report that breaks down the state of Serverless, with a detailed look at AWS Lambda usage. Educative.io - Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 10% off any course or annual subscription. Clubhouse - The fast and enjoyable project management platform that breaks down silos and brings teams together to ship value, not features. Sign up to get two additional free months of Clubhouse on any paid plan by visiting clubhouse.io/codingblocks. How to get the most out of a Conference If the conference has an app - I highly recommend downloading it - typically latest breaking changes to venue, rooms, talks, etc. will be in the app Attend talks that are outside your immediate realm of knowledge - get exposed to new things, new ideas, new ways of thinking Walk away with fewer "unknown unknowns" and gain some more "known unknowns" Provides you with things to search when you get back from the conference Picking the talks you want to attend Sometimes you have to sacrifice bigger names just to attend talks that may pique your interest Know that what you're seeing on stage for an hour was probably weeks worth of effort to make it go off without a hitch - so when you try to replicate these things at home, don't lose hope when your try isn't as smooth as what you saw on stage This next bit goes for Meetups, Conferences, etc - Get involved in conversations - don't just sit on the sideline - many developers are introverts, but to truly get the most out of a conference you want to have some meaningful discussions Pacman effect - leave a gap when you're standing in a group having a conversation Take advantage of eating times - find a table with an open spot and don't pick up your phone!!! Say good morning or good afternoon! "What's been your favorite talk today?" When it's "drinking time", talk to people. If you're not a drinker, grab a water or a soda and join in on the conversation Try and reach out BEFORE the conference online - Twitter, Facebook, Slack, etc - try and find out who all is going to be attending and try to make a point to meet up at the event! Makes things much less awkward when you've planned a meeting rather than just shouldering your way in. Be a wingman/wingwoman or bring one along - help introduce people to your ring of contacts' Maybe sign up to be a speaker at one of these things! If you watch the other folks giving presentations, you'll see they're regular people just sharing the things they're passionate about The big names in the industry became big names because they took that first step - you don't become a big name overnight Must-see Presentations Allen Underwood (shameless plug) - Big Data Analytics in Near-Real-Time with Apache Kafka Streams Twitter: @theallenu [https://www.twitter.com/theallenu] Summary: https://ndc-london.com/talk/big-data-analytics-in-near-real-time-with-apache-kafka-streams/ Actual talk here: Coming Soon Laura Silvanavičiūtė (this was my favorite of the entire conference) - How to code music? Twitter: @laurasilvanavi [https://www.twitter.com/@laurasilvanavi] Summary: https://ndc-london.com/talk/how-to-code-music/ Actual talk here: Coming Soon Tess Ferrandez-Norlander - We are the Guardians of our Future Summary: https://ndc-london.com/talk/keynote-we-are-the-guardians-of-our-future/ Actual talk here: https://www.youtube.com/watch?v=2YjrmgFJ_S8 Clifford Agius - 3D printed Bionic Hand a little IOT and a Xamarin Mobile App Twitter: @CliffordAgius [https://www.twitter.com/CliffordAgius] Summary: https://ndc-london.com/talk/3d-printed-bionic-hand-a-little-iot-and-a-xamarin-mobile-app/ Actual talk here: ComingSoon Blog version: https://cliffordagius.co.uk/2019/10/06/3d-printing-a-hand/ Carl Franklin from .NET Rocks - Deep Dive on Server-Side Blazor Twitter: @carlfranklin [https://www.twitter.com/carlfranklin] Summary: https://ndc-london.com/talk/deep-dive-on-server-side-blazor/ Actual talk here: Coming Soon David Fowler: SignalR Deep Dive: Building Servers Twitter: @davidfowl [https://www.twitter.com/davidfowl] Summary: https://ndc-london.com/talk/signalr-deep-dive-building-servers/ Actual talk here: Coming Soon Steve Gordon Twitter: @stevejgordon Summary: https://ndc-london.com/talk/turbocharged-writing-high-performance-c-and-net-code/ Actual talk here: Coming Soon David James - Turning a side project into a business 10

Ep 125Designing Data-Intensive Applications – Data Models: Query Languages
We dive into declarative vs imperative query languages as we continue to dive into Designing Data-Intensive Applications while Allen is gallivanting around London, Michael had a bullish opinion, and Joe might not know about The Witcher. If you're reading this episodes show notes via your podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode125 where you can join in on the conversation. Sponsors Datadog – Sign up today at codingblocks.net/datadog for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Read Datadog's new State of Serverless research report that breaks down the state of Serverless, with a detailed look at AWS Lambda usage. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 10% off any course or annual subscription. Clubhouse – The fast and enjoyable project management platform that breaks down silos and brings teams together to ship value, not features. Sign up to get two additional free months of Clubhouse on any paid plan by visiting clubhouse.io/codingblocks. Survey Says How do you pronounce data? Take the survey at: https://www.codingblocks.net/episode125. News We thank everyone that left us some great reviews: iTunes: 3divint, RyansWorld23 Stitcher: Thomasvc, thew_s_witcher4, DaveTheShirt, Yarpskendaya Get your shin kicking shoes on and sign up for the South Florida Software Developers Conference 2020, February 29th, where Joe will be giving his talk, Streaming Architectures by Example. (fladotnet.com) Come meet us at the 15th annual Orlando Code Camp & Tech Conference, March 28th. Grab some swag and kick us in the shins. (orlandocodecamp.com) Query Languages Declarative vs Imperative The relational model introduced a declarative query language: SQL. Prior models used imperative code. An imperative language performs certain operations in a certain order, i.e. do this, then do that. With a declarative query language, you specify the pattern of data you want, the conditions that must be met, any sorting, grouping, etc. Note that you don't specify how to retrieve the data. That is left to the optimizer to figure out. Declarative languages are attractive because they are shorter and easier to work with. Consider UI frameworks where you declaratively describe the UI without needing to write code that actually draws a button of a specific size in a specific place with a specific label, etc. Additionally, declarative languages hide the implementation details. This means it's easier to continue using the code as the underlying engine is updated, be it a database, UI framework, etc. This also means that the declarative code can take advantage of performance enhancements with little to no change (often) to the declarative code. Because declarative languages only specify the result, instead of how to get the result, they are often more likely to be able to take advantage of parallel execution. Conversely, because imperative code needs to happen in a specific order, it's more difficult to parallelize. MapReduce Made popular by Google, MapReduce is a programming model meant for processing large amounts of data in bulk in a horizontally distributed fashion. Some NoSQL databases, such as MongoDB and CouchDB, support MapReduce in a limited form as a way to perform read-only queries across many documents. MapReduce isn't a declarative query language but it's also not completely an imperative query API either. This is because to use it, you're implementing the Template Pattern (episode 16). With MapReduce, you implement two methods: map() and reduce(). The map() and reduce() functions are pure functions. They can only use the data passed into them, they can't perform additional queries, and they must not have side effects. Pure functions are a concept used in functional programming. From a usability perspective though, it does require writing two functions that are somewhat tied to each other, which may be more effort than just writing a single SQL query. Plus a purely declarative SQL query is better able to take advantage of the optimizer. For this reason, MongoDB added a declarative query language called the aggregation pipeline to wrap the MapReduce functionality. It's expessiveness is similar to a subset of SQL but in a JSON syntax. Graph-Like Data Models Relationships, particularly many-to-many, are an important feature for distinguishing between when to use which data model. As relationships get even more complicated, graph models start to feel more natural. Where as document databases have documents, and relational databases have tables, rows, and columns, graph databases have: Vertices: Nodes in the graph Edges: Define the relationships between nodes, and can contain data about those relationships. Examples of graph-like data: Social graphs: Vertices are the entities (people, media, articles), and edges are the relationships (friends with, likes, etc.) Web graph

Ep 124Designing Data-Intensive Applications – Data Models: Relationships
While we continue to dig into Designing Data-Intensive Applications, we take a step back to discuss data models and relationships as Michael covers all of his bases, Allen has a survey answer just for him, and Joe really didn't get his tip from Reddit. This episode's full show notes can be found at https://www.codingblocks.net/episode124, in case you're reading this via your podcast player, where you can be a part of the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 10% off any course or annual subscription. Clubhouse – The fast and enjoyable project management platform that breaks down silos and brings teams together to ship value, not features. Sign up to get two additional free months of Clubhouse on any paid plan by visiting clubhouse.io/codingblocks. Survey Says Which keyboard do you use? Take the survey at: https://www.codingblocks.net/episode124. News Thank you for the awesome reviews: iTunes: Kampfirez, Ameise776, JozacAlanOutlaw, skmetzger, Napalm684, Dingus the First Get your tickets now for NDC { London }, January 27th – 31st, where you can kick Allen in the shins where he will be giving his talk, Big Data Analytics in Near-Real-Time with Apache Kafka Streams. (ndc-london.com) Hurry and sign up for the South Florida Software Developers Conference 2020, February 29th, where Joe will be giving his talk, Streaming Architectures by Example. This is a great opportunity for you to try to kick him in the shins. (fladotnet.com) The CB guys will be at the 15th Annual Orlando Code Camp & Tech Conference, March 28th. Sign up for your chance to kick them all in the shins and grab some swag. (orlandocodecamp.com) Relationships … It's complicated Normalization Relational databases are typically normalized. A quick description of normalization would be associating meaningful data with a key and then relating data by keys rather than storing all of the data together. Normalization reduces redundancy and improve data integrity. Relational normalization has several benefits: Consistent styling and spelling for meaningful values. No ambiguity, even when text values are coincidentally the same, for example, Georgia the state vs Georgia the country. Updating meaningful values is easy since there is only one spot to change. Language localization support can be easier because you can associate different meaningful values with the same key for each supported language. Search for hierarchical relationships can be easier, for example, getting a list of cities for a particular state. This can vary based on how the data is stored. See episode 28 and episode 29 for more detailed discussions related to some strategies. There are legitimate reasons for having denormalized data in a relational database, like faster searches, although there might be better tools for the specific use case. Relationships … In Document Databases Document databases struggle as relationships get more complicated. Document database designers have to make careful decisions about where data will be stored. A big benefit of document databases is locality, meaning all of the relevant data for an entity is stored in one spot. Fetching an order object is one simple get in a document database, while the relational database might end up being more than one query and will surely join multiple tables. In Relational Databases There are several benefits of relational database relationships, particularly Many-to-One and Many-to-Many relationships To illustrate a Many-to-One example, there are many parts associated to one particular computer. To illustrate a Many-to-Many example, a person can be associated to many computers and a computer can be associated to many people. As your product matures, your database (typically) gets more complicated. The relational model holds up really well to these changes over time. The queries get more complicated as you add more relationships, but your flexibility remains. Query Optimization A query optimizer, a common part of popular RDBMSes, is responsible for deciding which parts of your written query to execute in which order and which indexes to use. The query optimizer has a huge impact on performance and is a big part of the reason why proprietary RDBMSes like Oracle and SQL Server are so popular. Imagine if you, the developer, had to be smarter about the order that you joined your tables and the order of items in your WHERE clause … and then ratios of data in the tables were different in production vs development, and then a new index was added, … The query optimizer uses advanced statistics about your data to make smart choices about how to execute your query. A key insight into the relational model is that the query optimizer only has to be built once and everybody benefits from it. In document databases, the

Ep 123Designing Data-Intensive Applications - Data Models: Relational vs Document
We're comparing data models as we continue our deep dive into Designing Data-Intensive Applications as Coach Joe is ready to teach some basketball, Michael can't pronounce 6NF, and Allen measured some geodesic distances just this morning. For those reading these show notes via a podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode123 where you can also join in on the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course or, for a limited time, get 50% off an annual subscription. ABOUT YOU – One of the fastest growing e-commerce companies headquartered in Hamburg, Germany that is growing fast and looking for motivated team members like you. Apply now at aboutyou.com/job. Survey Says Which data model do you prefer? Take the survey at: https://www.codingblocks.net/episode123. News We thank everyone that took a moment to leave us a review: iTunes: BoulderDude333, the pang1, fizch26 Hurry up and get your tickets now for NDC { London }, January 27th – 31st, where Allen will be giving his talk, Big Data Analytics in Near-Real-Time with Apache Kafka Streams. This is your chance to kick him in the shins on the other side of the pond. (ndc-london.com) Sign up for your chance to kick Joe in the shins at the South Florida Software Developers Conference 2020, February 29th, where he will be giving his talk, Streaming Architectures by Example. (fladotnet.com) Want a chance to kick all three Coding Blocks hosts in the shins? Sign up for the 15th Annual Orlando Code Camp & Tech Conference, March 28th, for your chance to kick them all in the shins and grab some swag. (orlandocodecamp.com) Data Models Data models are one of the most important pieces of developing software. It dictates how the software is written. And it dictates how we think about the problems we're solving. Software is typically written by stacking layers of modeling on top of each other. We write objects and data structures to reflect the real world. These then get translated into some format that will be persisted in JSON, XML, relational tables, graph db's, etc. The people that built the storage engine had to determine how to model the data on disk and in memory to support things like search, fast access, etc. Even further down, those bits have to be converted to electrical current, pulses of light, magnetic fields and so on. Complex applications commonly have many layers: APIs built on top of APIs. What's the purpose of these layers? To hide the complexity of the layer below it. The abstractions allow different groups of people (potentially with completely different skillsets) to work together. There are MANY types of data models, all with different usages and needs in mind. It can take a LOT of time and effort to master just a single model. Data models have a HUGE impact on how you write your applications, so its important to choose one that makes sense for what you're trying to accomplish. Relational Model vs Document Model Best-known model today is probably the ones based on SQL. The relational model was proposed by Edgar Codd back in 1970. The relational model organizes data into relations (i.e. tables in SQL) where each relation contains an unordered collection of tuples (i.e. rows in SQL). People originally doubted it would work but it's dominance has lasted since the mid-80's, which the author points out is basically an eternity in software. Origins were based in business data processing, particularly transaction processing. There have been a number of competing data storage and querying approaches over the years. Network and Hierarchical models in 70's and 80's, Object databases were competitors in the late 80's and early 90's, XML databases, Basically a number a competitors over the years but nobody has dethroned the relational database. Almost everything you see and use today has some sort of relational database working behind it. NoSQL NoSQL is the latest competitor to Relational Databases. It was originally intended as a catchy Twitter hashtag for a meetup about open source, distributed, non-relational databases. It has since been re-termed to "Not only SQL". What needs does NoSQL aim to address? The need for greater scalability than traditional RDBMS's can typically achieve, including very large datasets and fast writes. The desire for FOSS (free and open source software), as opposed to very expensive, commercial RDBMS's. Specialized query operations that are not supported well in the relational model. Shortcomings of relational models – need for more dynamic and/or expressive data models. Different applications (or even different pieces of the same application) have different needs and may require different data models. For that reason, it's very likely that NoSQL won'

Ep 122Designing Data-Intensive Applications – Maintainability
We dig into what it takes to make a maintainable application as we continue to learn from Designing Data-Intensive Applications, as Allen is a big fan of baby Yoda, Michael's index isn't corrupt, and Joe has some latency issues. In case you're reading this via your podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode122 where you can join in on the conversation. Sponsors Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course or, for a limited time, get 50% off an annual subscription. ABOUT YOU – One of the fastest growing e-commerce companies headquartered in Hamburg, Germany that is growing fast and looking for motivated team members like you. Apply now at aboutyou.com/job. Survey Says Which sci-fi series is best? Take the survey at: https://www.codingblocks.net/episode122. News Thank you for taking a moment out of your day to leave us a review: iTunes: Kodestar, CrouchingProbeHiddenCannon Stitcher: programticalpragrammerer, Patricio Page, TheOtherOtherJZ, Luke Garrigan Be careful about sharing/using code to/from Stack Overflow! You need to be aware of the licensing and what it might mean for your application. What is the license for the content I post? (Stack Overflow) Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (Creative Commons) Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (tldrlegal.com) We Still Don't Understand Open Source Licensing (episode 5) Get your tickets now for NDC { London } for your chance to kick Allen in the shins where he will be giving his talk Big Data Analytics in Near-Real-Time with Apache Kafka Streams. (ndc-london.com) Maintainability A majority of cost in software is maintaining it, not creating it in the first place. Coincidentally most people dislike working on these legacy systems possibly due to one or more of the following: Bad code, Outdated platforms, and/or Made to do things the system wasn't designed to do. We SHOULD build applications to minimize the pain during the maintenance phase which involves using the following design principals: Operability – make it easy to keep the system running smoothly. Simplicity – make it easy for new developers to pick up and understand what was created, remove complexity from the system. Evolvability – make it easy for developers to extend, modify, and enhance the system. Operability Good operations can overcome bad software, but great software cannot overcome bad operations. Operations teams are vital for making software run properly. Responsibilities include: Monitoring and restoring service if the system goes into a bad state. Tracking down the problems. Keeping the system updated and patched. Keeping track of how systems impact each other. Anticipating and planning for future problems, such as scale and/or capacity. Establish good practices for deployments, configuration management, etc. Doing complicated maintenance tasks, such as migrating from one platform to another. Maintaining security. Making processes and operations predictable for stability. Keeping knowledge of systems in the business even as people come and go. No tribal knowledge. The whole point of this is to make mundane tasks easy allowing the operations teams to focus on higher value activities. This is where data systems come in. Get visibility into running systems, i.e. monitoring. Supporting automation and integration. Avoiding dependencies on specific machines. Documenting easy to understand operational models, for example, if you do this action, then this will happen. Giving good default behavior with the ability to override settings. Self-healing when possible but also manually controllable. Predictable behavior. Simplicity As projects grow, they tend to get much more complicated over time. This slows down development as it takes longer to make changes. If you're not careful, it can become a big ball of mud. Indicators of complexity: Explosion of state space, Tight coupling, Spaghetti of dependencies, Inconsistent coding standards such as naming and terminology, Hacking in performance improvements, Code to handle one off edge cases sprinkled throughout. Greater risk of introducing bugs. Reducing complexity improves maintainability of software. For this reason alone, we should strive to make our systems simpler to understand. Reducing complexity DOES NOT mean removing or reducing functionality. Accidental complexity – Complexity that is accidental if it is not inherent in the problem that the software solves, but arises only from the implementation. Ben Moseley and Peter Marks, Out of the Tar Pit How to remove accidental complexity? Abstraction Allows you to hide implementation details behind a facade. Also allows you to reduce duplication as abstractions can allow for reuse among many implementations. Examples of good abstractions: Programming languages abstract system level architectures such as CPU, RAM

Ep 121Designing Data-Intensive Applications – Scalability
We continue to study the teachings of Designing Data-Intensive Applications, while Michael's favorite book series might be the Twilight series, Joe blames his squeak toy chewing habit on his dogs, and Allen might be a Belieber. Head over to https://www.codingblocks.net/episode121 to find this episode's full show notes and join in the conversation, in case you're reading these show notes via your podcast player. Sponsors Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course or, for a limited time, get 50% off an annual subscription. Survey Says With the new year coming, what kind of learning resolution do you plan on setting? I plan to learn ... Take the survey at: https://www.codingblocks.net/episode121. News So many new reviews to be thankful for! Thanks for making it a point to share your review with us: iTunes: bobby_richard, SeanNeedsNewGlasses, Teshiwyn, vasul007, The Jin John Stitcher: HotReloadJalapeño, Leonieke, Anonymous, Juke0815 Joe was a guest on The Waffling Taylors. Check out the entire three episode series: Squidge The Ring, Jay vs Doors, and Exploding Horses. Be aware of "free" VPNs. This iOS Security App Shares User Data With China: 8 Million Americans Impacted (Forbes) Facebook shuts down Onavo VPN app following privacy scandal (Engadget) Allen will be speaking at NDC { London } where he will be giving his talk Big Data Analytics in Near-Real-Time with Apache Kafka Streams. Be sure to stop by for your chance to kick him in the shins! (ndc-london.com) Scalability Increased load is a common reason for degradation of reliability. Scalability is the term used to describe a system's ability to cope with increased load. It can be tempting to say X scales, or doesn't, but referring to a system as "scalable" really means how good your options are. Couple questions to ask of your system: If the system grows in a particular way (more data, more users, more usage), what are our options for coping? How easy is it to add computing resources? Describing Load Need to figure out how to describe load before before we can truly answer any questions. "Load Parameters" are the metrics that make sense to measure for your system. Load Parameters are a measure of stress, not of performance. Different parameters may matter more for your system. Examples for particular uses may include: Web Server: requests per second Database: read/write ratio Application: # of simultaneous active users Cache: hit/miss ratio This may not be a simple number either. Sometimes you may care more about the average number, sometimes only the extremes. Describing Performance Two ways to look at describing performance: How does performance change when you increase a load parameter, without changing resources? How much do you need to increase resources to maintain performance when increasing a load parameter? Performance numbers measure how well your system is responding. Examples can include: Throughput (records processed per second) Response time Latency vs Response Time Latency is how long a request is waiting to be handled, awaiting service. Response time is the total time it takes for the client to see the response, including any latency. What do you mean by "numbers"? Performance numbers are generally a set of numbers: i.e. minimum, maximum, average, median, percentile. Sometimes the outliers are really important. For example, a game may have an average of 59 FPS but that number might drop to 10 FPS when garbage collection is running. Average may not be your best measure if you want to see the typical response time. For this reason it's better to use percentiles. Consider the median (sort all the response times and the one in the middle is the median). Median is known as the 50th percentile or P50. That means that half of your response times will be under the 50% mark and half will be over. To find the outliers, you can look at the 95th, 99th and 99.9th percentiles, aka P95, P99, P999. If you were to look at the P95 mark and the response time is 2s, then that means that 95% of all requests come back in under 2 seconds and 5% of all requests come back in over 2s. The example provided is that Amazon describes response times in the P999 even though it only affects 1 in 1000 users. The reason? Because the slowest response times would be for the customers who've made the most purchases. In other words, the most valued customers! Increased response times have been measured by many large companies in regards to completions of orders, leaving sites, etc. Ultimately, trying to optimize for P999 is very expensive and may not make the investment worth it. Not only is it expensive but it's also difficult because you may be fighting environmental things outside of your control. Percentiles are often used in: SLO's – Service Level Objectives SLA's – Service Level Agreements Both are contracts that draw out the expected performance and availability of a service. Queuing delay

Ep 120Designing Data-Intensive Applications - Reliability
We start our deep dive into Joe's favorite new book, Designing Data-Intensive Applications as Joe can't be stopped while running downhill, Michael might have a new spin on #fartgate, and Allen doesn't quite have a dozen tips this episode. If you're reading this via your podcast player, you can always go to https://www.codingblocks.net/episode120 to read these show notes on a larger screen and participate in the conversation. Sponsors Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course. Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Survey Says What is the single most important piece of your battlestation? Take the survey at: https://www.codingblocks.net/episode120. News Thank you to those that took time out of their day to leave us a review: Stitcher: Anonymous, jeoffman How to get started with a SQL Server database using Docker: SQL Server Tips – Run in Docker and an Amazing SSMS Tip (YouTube) Sample SQL Server Database and Docker (YouTube) Come see Allen at NDC { London } for your chance to kick him in the shins, where he will be giving his talk Big Data Analytics in Near-Real-Time with Apache Kafka Streams. (ndc-london.com) John Deere – Customer Showcase: Perform Real-time ETL from IoT Devices into your Data Lake with Amazon Kinesis (YouTube) There's a new SSD sheriff in town and it's the Seagate Firecuda 520 with a reported maximum 5,000 MB/s sequential reads and 4,400 MB/s sequential writes!!! (Amazon) Seagate Firecuda 520 1TB NVMe PCIe Gen4 M.2 SSD Review (TweakTown) Get 40% off your Pluralsight subscription! (Pluralsight) Joe was a guest on The Waffling Taylors, episode 59. (wafflingtaylors.rocks) Designing Data-Intensive Applications About this book What is a data-intensive application per the book? Any application whose primary challenge is: The quantity of data. The complexity of the data. The speed at which the data is changing. That's in contrast to applications that are compute intensive. Buzzwords that seem to be synonymous with data-intensive NoSQL Message queues Caches Search indexes Batch / stream processing This book is … This book is NOT a tutorial on how to do data-intensive applications with a particular toolset or pure theory. What the book IS: A study of successful data systems. A look into the tools / technologies that enable these data intensive systems to perform, scale, and be reliable in production environments Examining their algorithms and the trade-offs they made. Why read this book? The goal is that by going through this, you will be able to understand what's available and why you would use various methods, algorithms, and technologies. While this book is geared towards software engineers/architects and their managers, it will especially appeal to those that: Want to learn how to make systems scalable. Need to learn how to make applications highly available. Want to learn how to make systems easier to maintain. Are just curious how these things work. "[B]uilding for scale that you don't need is wasted effort and may lock you into an inflexible design." Martin Kleppmann While building for scale can be a form of premature optimization, it is important to choose the right tool for the job and knowing these tools and their strengths and weaknesses can help you make better informed decisions. Most of the book covers what is known as "big data" but the author doesn't like that term for good reason: "Big data" is too vague. Big data to one person is small data to someone else. Instead, single node vs distributed systems are the types of language used in the book. The book is also heavily biased towards FOSS (Free Open Source Software) because it's possible to dig in and see what's actually going on. Are we living in the golden age of data? There are an insane number of really good database systems. The cloud has made things easy for a while, but tools like K8s, Docker, and Serverless are making things even easier. Tons of machine learning services taking care of common use cases, and lowering the barrier to entry: NLP, STT, and Sentiment analysis for example. Reliability Most applications today are data-intensive rather than compute-intensive. CPU's are usually not the bottleneck in modern day applications – size, complexity, and the dynamic nature of data are. Most of these applications have similar needs: Store data so the application can find it again later. Cache expensive operations so they'll be faster next time. Allow user searches. Sending messages to other processes – stream processing. Process chunks of data at intervals – batch processing. Designing data-intensive applications involve answering a lot of questions: How do you ensure the data is correct and complete even when something goes wrong? How do you provide good performance to clients even as parts of your system are struggling? How do you scale to increase

Ep 119Developer Shopping Spree 2019
We discuss this year's shopping spree only to learn that Michael spent too much, Allen spent too much, and Joe spent too much.

Ep 118DevOps: Job Title or Job Responsibility?
We debate whether DevOps is a job title or a job responsibility as Michael finally understands dev.to's name, Allen is an infosec expert, and Joe wears his sunglasses at night. If you aren't already viewing this episode's show notes in your browser, you can find these show notes at https://www.codingblocks.net/episode118 and join the conversation. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. WayScript – Sign up and build cloud hosted tools that seamlessly integrate and automate your tasks. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course. Survey Says … Is DevOps a ... Take the survey here: https://www.codingblocks.net/episode118. News We appreciate everyone that took a moment to leave us a review and say thanks: iTunes: kevo_ker, Cheiss, MathewSomers Stitcher: BlockedTicket Is DevOps a Job Title or Company Culture? What is DevOps? What isn't DevOps? How do you learn DevOps? How mature is your DevOps? The myths of DevOps … Resources We Like What Is DevOps? (New Relic) The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win (Amazon) The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations (Amazon) The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Data (Amazon) DevOps is a culture, not a role! (Medium) Why is kubernetes source code an order of magnitude larger than other container orchestrators? (Stack Overflow) Welcoming Molly – The DEV Team's First Lead SRE! (dev.to, Molly Struve) The DevOps Checklist (devopschecklist.com) Vagrant (vagrantup.com) Tip of the Week Edit your last Slack message by pressing the UP arrow key. That and more keyboard shortcuts available in the Slack Help Center. (Slack) Integrate Linux Commands into Windows with PowerShell and the Windows Subsystem for Linux (devblogs.microsoft.com) Use readlink to see where a symlink ultimately lands. (manpages.ubuntu.com) What are Durable Functions? (docs.microsoft.com) Change your Cmder theme to Allen's favorite: Babun. (cmder.net) My favourite Git commit (fatbusinessman.com)

Ep 1173factor app - Async Serverless
We take an introspective look into what's wrong with Michael's life, Allen keeps taking us down random tangents, and Joe misses the chance for the perfect joke as we wrap up our deep dive into Hasura's 3factor app architecture pattern. For those reading these show notes via their podcast player, this episode's full show notes can be found at https://www.codingblocks.net/episode117. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. O'Reilly Software Architecture Conference – Microservices, domain-driven design, and more. The O'Reilly Software Architecture Conference covers the skills and tools every software architect needs. Use the code BLOCKS during registration to get 20% off of most passes. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course. Survey Says … Which relational database is your go to? Take the survey here: https://www.codingblocks.net/episode117. News Thank you to everyone that left us a review: iTunes: codeand40k, buckrivard Stitcher: Jediknightluke, nmolina Factor Tres – Async Serverless The first two factors, realtime GraphQL and reliable eventing, provide the foundation for a decoupled architecture that paves the way for the third factor: async serverless. These serverless processes meet two properties: Idempotency: Events are delivered at least once. Out of order messaging: The order the events are received is not guaranteed. Traditional vs 3factor app Traditional application 3factor application Synchronous procedure code. Loosely coupled event handlers. Deployed on VMs or containers. Deployed on serverless platforms. You manage the platform. The platform is managed for you. Requires operational expertise. No operational expertise necessary. Auto-scale when possible. Auto-scales by default. Benefits of serverless architectures No-ops: no run time to manage. Free scale: scales based on utilization. Cost: you pay for utilization. Sample serverless providers AWS Lambda Google Cloud Functions Azure Functions Zeit OpenFaas Kubeless Knative When to use the 3 Factor app? Multiple subsystems that need to subscribe to the same events. Low latency events. Complex event processing. High volume, velocity data. Benefits Producers and consumers are decoupled. No point-to point-integrations. Consumers can respond to events immediately as they arrive. Highly scalable and distributed. Subsystems have independent views of the event stream. Challenges Guaranteed event delivery. Processing events in order. Processing events exactly once. Latency related to initial serverless start up time. The five key phases of software development. Resources We Like 3factor app (3factor.app) 3Factor Canonical App (GitHub) Event-driven architecture style (docs.microsoft.com) Azure Functions and CosmosDB from MS Ignite (episode 92) Two General's Problem (Wikipedia) Erlang: The Movie (YouTube) Erlang: The Movie II: The Sequel (YouTube) Ultimate Dog Tease (YouTube) Reggie! Don't eat him! (Facebook) Docker for Developers (episode 80) Tip of the Week Keep your email address private in your GitHub repo's git log by setting your email address to [email protected] like git config user.email [email protected]. (GitHub) Darknet Diaries: True stories from the dark side of the Internet (darknetdiaries.com) ARM Template Viewer for VS Code displays a graphical preview of Azure Resource Manager (ARM) templates. (marketplace.visualstudio.com) WSL Support Framework for IntelliJ and RubyMine (plugins.jetbrains.com) Visual Studio Code Remote – WSL extension lets you use the Windows Subsystem for Linux as your development environment within VS Code. (code.visualstudio.com) What is Azure Data Studio? (docs.microsoft.com) The DevOps Handbook is available on Audible! (Audible, Amazon)

Ep 1163factor app - Reliable Eventing
We discuss the second factor of Hasura's 3factor app, Reliable Eventing, as Allen says he still _surfs_ the Internet (but really, does he?), it's never too late for pizza according to Joe, and Michael wants to un-hear things. This episode's full show notes can be found at https://www.codingblocks.net/episode116, just in case you're using your podcast player to read this. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. O'Reilly Velocity Conference – Get expert insight on building and maintaining cloud native systems. Use the code BLOCKS during registration to get 20% off of most passes. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course. Survey Says … What's the first thing you do when picking up a new technology or stack? Take the survey here: https://www.codingblocks.net/episode116. News Thank you to everyone that left us a review: iTunes: !theBestCoder, guacamoly, Fishslider Stitcher: SpottieDog We have photographic evidence that we were in the same room with Beej from Complete Developer at Atlanta Code Camp. The Second Factor – Reliable Eventing Don't allow for mutable state. Get rid of in memory state manipulation in APIs. Persist everything in atomic events. The event system should have the following characteristics: Atomic – the entire operation must succeed and be isolated from other operations. Reliable – events should be delivered to subscribers at least once. Comparing the 3factor app Eventing to Traditional Transactions Traditional application 3factor application Request is issued, data loaded from various storage areas, apply business logic, and finally commit the data to storage. Request is issued and all events are stored individually. Avoid using async features because it's difficult to rollback when there are problems. Due to the use of the event system, async operations are much easier to implement. Have to implement custom recovery logic to rewind the business logic. Recovery logic isn't required since the events are atomic. Benefits of an Immutable Event Log Primary benefit is simplicity when dealing with recovery. There's no custom business logic because all the event data is available for replayability. Due to the nature of persisting the individual event data, you have a built in audit trail, without the need for additional logging. Replicating the application is as simple as taking the events and replaying the business logic on top of them. Downsides of the Immutable Event Log Information isn't (instantly) queryable, not taking into account snapshotting. CQRS (command query responsibility segregation) helps to answer this particular problem. Forcing event sourcing on every part of the system introduces significant complexity where it may not be needed. For evolving applications, changing business needs require changes to the event schema and this can become very complex and difficult to maintain. Upcasting: converting an event record on the fly to reflect a newer schema. Problem with this is you've now defeated the purpose of immutable events. Lazy upcasting is evolving the event records over time, but that means you're now maintaining code that knows how to understand each version of the event records in the system, making it very difficult to maintain. Converting the entire set of data any time a schema needs to change. Keeps things in sync but at a potentially large cost of taking the hit to update everything. Considerations of event granularity, i.e. how many isolated events are too much and how few are not enough? Too many and there won't be enough information attached to the event to be meaningful and useful. Too few and you take a major hit on serialization/deserialization and you run the risk of not having any domain value. So what's the best granularity? Keep the events closely tied to the DDD intent. Fixing bugs in the system may be quite a bit more difficult than a simple update query in a database because events are supposed to be immutable. Resources We Like 3factor app (3factor.app) 3Factor Canonical App (GitHub) Atomic commit (Wikipedia) DDD & co., part 2: Semantics over CRUD (thenativeweb.io) Event Sourcing (martinFowler.com) CQRS (martinFowler.com) What they don't tell you about event sourcing (medium.com) A Practical Guide to GraphQL: From the Client Perspective (educative.io) Tip of the Week Use docker system to manage your Docker environment. Use docker system df to see the the disk usage. Use docker system prune to clean up your environment. How To View Clipboard History On Windows 10 (AddictiveTips.com) Use docker-compose down -v to also remove the volumes when stopping your containers. Intel 660p M.2 2TB NVMe PCIe SSD (Amazon) Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems (Amazon)

Ep 1153factor app - Realtime GraphQL
We begin to twitch as we review the first factor of Hasura's 3factor app, Realtime GraphQL, while Allen gets distrac … SQUIRREL!, Michael might own some bell bottoms, and Joe is stuck with cobalt. If you're reading these notes via your podcast app, you can find this episode's full show notes and join in on the conversation at https://www.codingblocks.net/episode115. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. O'Reilly Software Architecture Conference – Microservices, domain-driven design, and more. The O'Reilly Software Architecture Conference covers the skills and tools every software architect needs. Use the code BLOCKS during registration to get 20% off of most passes. Educative.io – Level up your coding skills, quickly and efficiently. Visit educative.io/codingblocks to get 20% off any course. Survey Says … Would you be interested in doing a Coding Blocks Fantasy Football League? Take the survey here: https://www.codingblocks.net/episode115. News To everyone that took a moment to leave us a review, thank you. We really appreciate it. iTunes: Zj, Who farted? Not me., Markus Johansson, this jus10, siftycat, Runs-With-Scissors Stitcher: wuddadid, unclescooter Zach Ingbretsen gives us a Vim tutorial: RAW Vim Workshop/Tutorial (YouTube) 3factor app and the First Factor 3factor app The 3factor app is a modern architecture for full stack applications, described by the folks at Hasura. High feature velocity and scalability from the start: Real time GraphQL Reliable eventing Async serverless Kinda boils down to … Have an API gateway (for them, GraphQL). Store state in a (most likely distributed) store. Have services interact with state via an event system. Versus how did we used to do things using a REST API for each individual entity. Let's be honest though. We probably created a single very specialized REST API for a particular page all in the name of performance. But it was only used for that page. Related technologies: Web Sockets Serverless Lambda / Kappa – Types Streaming architectures Event based architectures Microservices Factor 1 – Realtime GraphQL Use Realtime GraphQL as the Data API Layer Must be low-latency. Less than 100 ms is ideal. Must support subscriptions. Allows the application to consume information from the GraphQL API in real-time. Some Comparisons to Typical Backend API Calls Traditional application 3factor application Uses REST calls. Uses GraphQL API. May require multiple calls to retrieve all data (customer, order, order details) – OR a complex purpose built call that will return all three in one call. Uses GraphQL query to return data needed in a single call defined by the caller. Uses something like Swagger to generate API documentation. GraphQL will auto-generate entire schema and related documents. For realtime you'll set up WebSocket based APIs. Use GraphQL's native subscriptions. Continuously poll backend for updates. Use GraphQL's event based subscriptions to receive updates. Major Benefits of GraphQL Massively accelerates front-end development speed because developers can get the data they want without any need to build additional APIs. GraphQL APIs are strongly typed. Don't need to maintain additional documenting tools. Using a UI like GraphiQL, you can explore data by writing queries with an Intellisense like auto-complete experience. Realtime built in natively. Prevents over-fetching. Sorta. To the client, yes. Not necessarily so though on the server side. A Little More About GraphQL GraphQL is a Query Language for your API. It isn't tied to any particular database or storage engine. It's backed by your existing code and data. Queries are all about asking for specific fields on objects. The shape of your query will match the shape of the results. Queries allow for traversing relationships, so you can get all the data you need in a single request. Every field and nested object has its own set of arguments that can be passed. Many types are supported, including enums. Aliases GraphQL has the ability to alias fields to return multiple results of the same type but with different return names (think of aliasing tables in a database query). Fragments Fragments allow you to save a set of query fields to retrieve, allowing you to later reuse those fragments in simpler queries. This allows you to create complex queries with a much smaller syntax. There's even the ability to use variables within the fragments for further queries requiring more flexibility. Operations Three types of operations are supported: query, mutation, and subscription. Providing an operation name is not required, except for multi-operation documents, but is recommended to aid debugging and server side logging. Variables Queries are typically dynamic by way of variables. Supported variable types are scalars, enums, and input object types. Input object types must map to server defined objects. Can be optional or requi

Ep 114The Pragmatic Programmer - How to Build Pragmatic Teams
We learn how to apply the concepts of The Pragmatic Programmer to teams while Michael uses his advertisement voice, Joe has a list, and Allen doesn't want anyone up in his Wheaties.

Ep 113The Pragmatic Programmer - How to use Exceptions
After 112 episodes, Michael can't introduce the show, Allen pronounces it "ma-meee", and don't make Joe run your janky tests as The Pragmatic Programmer teaches us how we should use exceptions and program deliberately. How are you reading this? If you answered via your podcast player, you can find this episode's full show notes and join the conversation at https://www.codingblocks.net/episode113. Sponsors Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Survey Says … When you want to bring in a new technology or take a new approach when implementing something new or add to the tech stack, do you ...? Take the survey here: https://www.codingblocks.net/episode113 News Thank you for taking a moment out of your day to leave us a review. iTunes: MatteKarla, WinnerOfTheRaceCondition, michael_mancuso Stitcher: rundevcycle, Canmichaelpronouncethis, WinnerOfTheRaceCondition, C_Flat_Fella, UncleBobsNephew, alexUnique Autonomous ErgoChair 2 Review (YouTube) Come see us Saturday, September 14, 2019 at the Atlanta Code Camp 2019 (atlantacodecamp.com) Are they cakes, cookies, or biscuits? (Wikipedia) Intentional Code When to use Exceptions In an earlier chapter, Dead Programs Tell No Lies, the book recommends: Checking for every possible error. Favor crashing your program over running into an inconsistent state. This can get really ugly! Especially if you believe in the "one return at the bottom" methodology for your methods. You can accomplish the same thing by just catching an exception for a block of code, and throwing your own with additional information. This is nice, but it brings up the question? When should you return a failed status, and when should you throw an exception? Do you tend to throw more exceptions in one layer more than another, such as throwing more in your C# layer than your JS layer? The authors advise throwing exceptions for unexpected events. Ask yourself, will the code still work if I remove the exception handlers? If you answered "no", then maybe your throwing exceptions for non-exceptional circumstances. Tip 34 Use exceptions for exceptional problems Exceptions vs Error Handling Should you throw an exception if you try to open a file, and it doesn't exist? If it should be there, i.e. a config, yes, throw the exception. If it might be OK for it not to be there, i.e. you're polling for a file to be created, then no, you should handle the error condition. Is it dangerous to rely on implicit exception throwing, i.e. opening a file that isn't there? On the one hand, it's cleaner without checking for the exceptions, but there's no signaling to your co-coders that you did this intentionally. Exceptions are a kind of coupling because they break the normal input/output contract. Some languages / frameworks allow you to register error handlers that are outside the flow of the normal problem. This is great for certain types of problems, like serialization problems, particularly when there is a prescribed flow, such as error pages, serialization, or SSL errors. Programming by Coincidence What does it mean to "program by coincidence"? Getting lured into a false sense of security and then getting hit by what you were trying to avoid. Avoid programming by coincidence and instead program deliberately. Don't rely on being lucky. Writing code and seeing that it works without fully understanding why is how you program by coincidence. This really becomes a problem when something goes wrong and you can't figure out why because you never knew why it worked to start off with. We may not be innocent … What if you write code that adheres to some other code that was done in error … if that code is eventually fixed, your own code may fail. So if it's working, why would you touch it? It might not actually be working … Maybe it doesn't work with a different resolution. Undocumented code might change, thus changing your "luck". Unnecessary method calls slow down the code. Those extra calls increase the risk of bugs. Write code that others implement with well documented code that adheres to a contract. Accidents of Context You can also make the mistake that you assume certain things are a given, such as that there's a UI or that there's a given language. Implicit Assumptions Don't assume something, prove it. Assumptions that aren't based on fact become a major sticking point in many cases. Tip 44 Don't Program by Coincidence How to Program Deliberately Always be aware of what you're doing. Don't code blindfolded, Make sure you understand what you're programming in, both business domain related and programming language. Code from a plan. Rely on reliable things. Don't code based on assumptions. Document assumptions. Test your code _and_ your assumptions. Prioritize and spend time on the most important aspects first. Don't let old code dictate new code. Be prepared to refactor if necessary. Resources We Like The Pragmatic Programmer by Andrew

Ep 112The Pragmatic Programmer - How to Generate Code
We continue our dive into The Pragmatic Programmer and debate when is it text manipulation vs code generation as Joe can't read his bill, Michael makes a painful recommendation, and Allen's gaming lives up to Southern expectations. In case you're reading these show notes via your podcast player, you can find this episode's full show notes at https://www.codingblocks.net/episode112 and join in on the conversation. Sponsors Clubhouse – The first project management platform for software development that brings everyone on every team together to build better products. Sign up for two free months of Clubhouse by visiting clubhouse.io/codingblocks. Datadog.com/codingblocks – Sign up today for a free 14 day trial and get a free Datadog t-shirt after creating your first dashboard. Survey Says … What native language are you most interested in? Take the survey here: https://www.codingblocks.net/episode112 News We really appreciate every review we get. Thank you for taking the time. iTunes: AsIRoseOneMorn, MrBramme, MP7373, tbone189, BernieF1982, Davidwrpayne, mldennison Stitcher: Ben T, moreginger, Tomski, Java Joe Blurring the Text Manipulation Line Text Manipulation Programmers manipulate text the same way woodworkers shape wood. Text manipulation tools are like routers: noisy, messy, brutish. You can use text manipulation tools to trim the data into shape. Once you master them, they can provide an impressive amount of finesse. Alternative is to build a more polished tool, check it in, test it, etc. Tip 28 Learn a Text Manipulation Language. Code Generators When you have a repetitive task, why not generate it? The generated code takes away complexity and reduces errors. And it's reuse has little to no additional cost. Tip 29 Write Code That Writes Code. There are two types of code generators: Passive code generators are run once (scaffolding). Active code generators are used each time they are required. Passive code generators save typing by automating… New files from a template, i.e. the "File -> New" experience. One off conversions (one language to another). These don't need to be completely perfect. Producing lookup tables and other resources that are expensive to compute. Full-fledged source file. You get to pick how accurate you want the generators to be. Maybe it writes 80% of the code for you and you do the rest by hand. Active code generators Active code generators are necessary if you want to adhere to the DRY principle. This form is not considered duplication because it's generated as needed by taking a single representation and converting it to all of the forms you need. Great for system boundaries (think databases or web services). Great for keeping things in sync. Recommend creating your own parser. Why generate when you can just … program? Scaffolding, so it's a starting off point that you edit. Performance. System boundaries. Some uses work best when built into your build pipeline. Think about automatically generating code to match your DB at compile time, like a T4 generator for Entity Framework. It's often easier to express the code to be generated in a language neutral representation so that it can be output in multiple languages. Something like System.CodeDom comes to mind. These generators don't need to be complex. And the output doesn't always need to be code. It could be XML, JSON, etc. Resources We Like The Pragmatic Programmer by Andrew Hunt, David Thomas (Amazon) The Pragmatic Bookshelf (pragprog.com) C# and .NET Core scripting with the "dotnet-script" global tool (hanselman.com) Using the CodeDOM (docs.microsoft.com) Johnny Dangerously (1984) (IMDb) Tip of the Week Within Visual Studio Code, after you use CTRL+F to find some text in your current document, you can take it a step further by pressing ALT+ENTER to enter into block selection/edit mode. Turn learning Vi into a game with VIM Adventures. (vim-adventures.com) Never confuse forward Slash with back Slash again.

Ep 111The Pragmatic Programmer - How to Debug
It's about time we finally learn how to debug by taking take a page from The Pragmatic Programmer playbook, while Michael replaces a developer's cheat sheet, Joe judges the H-O-R-S-E competition for VI, and Allen stabs you in the front.

Ep 110The Pragmatic Programmer - Know Thy Tools
We dig into the details of the basic tools while continuing our journey into The Pragmatic Programmer while Joe programs by coincidence, Michael can't pronounce numbers, and Allen makes a point.

Ep 109The Pragmatic Programmer - How to Estimate
Joe is distracted by all of the announcements from E3, Allen is on the run from the Feebs, and Michael counts debugging as coding. All this and more as we continue discussing The Pragmatic Programmer.

Ep 108The Pragmatic Programmer - Tracer Bullets and Prototyping
The Pragmatic Programmer teaches us how to use tracer bullets versus prototyping while Joe doesn't know who won the Game of Thrones, Allen thought he knew about road numbers, and Michael thinks 475 is four letters.

Ep 107The Pragmatic Programmer - Is Your Code Orthogonal?
The dad jokes are back as we learn about orthogonal code while JZ (the 8-mile guy) has spaghetti on him, Michael's Harry Potter references fail, and Allen voice goes up a couple octaves.

Ep 106The Pragmatic Programmer - The Evils of Duplication
We take a deep dive into the various forms of duplication and jump aboard the complain train as Allen complains about Confluent's documentation, Michael complains about Docker's documentation, and Joe complains about curl.

Ep 105The Pragmatic Programmer - Investing in Your Knowledge Portfolio
We begin our journey into the wisdom of The Pragmatic Programmer, which as Joe puts it, it's less about type-y type-y and more about think-y think-y, while Allen is not quite as pessimistic as Joe, and Michael can't wait to say his smart words.

Ep 104Should your web app be a progressive web app (PWA)?
We dig into the nitty gritty details of what a Progressive Web App (PWA) is and why you should care, while Allen isn't sure if he is recording, Michael was the only one prepared to talk about Flo and the Progressive Price Gun, and Joe has to get his headphones.

Ep 103The Second Date is Always Easier
The Date deep dive continues as we focus in on C# and JavaScript, while Michael reminisces about the fluorescent crayons, Joe needs a new tip of the week, and Allen confuses time zones.

Ep 102Why Date-ing is Hard
We take a deep dive into understanding why all Date-s are not created equal while learning that Joe is not a fan of months, King Kong has nothing on Allen, and Michael still uses GETDATE. Oops.

Ep 101What Should You Learn Next?
After being asked to quiet down, our friend, John Stone, joins us again as we move the conversation to the nearest cubicle while Michael reminds us of Bing, Joe regrets getting a cellphone, and Allen's accent might surprise you.

Ep 100Tackling Tough Developer Questions
We gather around the water cooler to celebrate our 100th episode with our friend John Stone for some random developer discussions as Michael goes off script, Joe needs his techno while coding, and Allen sings some sweet sounds.

Ep 99JAMstack with J.A.M.
We learn all about JAMstack in real-time as Michael lowers the bar with new jokes, Allen submits a pull request, and Joe still owes us a tattoo.

Ep 98Data Structures - Heaps and Tries
We dig into heaps and tries as Allen gives us an up to date movie review while Joe and Michael compare how the bands measure up.

Ep 97Data Structures - (some) Trees
We ring in 2019 with a discussion of various trees as Allen questions when should you abstract while Michael and Joe introduce us to the Groot Tree.

Ep 96Data Structures - Hashtable vs Dictionary
Just in time to help you spread some cheer this holiday season, the dad jokes are back as we dig into the details of hash tables and dictionaries.

Ep 95Data Structures - Arrays and Array-ish
We continue our deep dive into data structures, this time focusing in on arrays and array-like types as Allen gives Shania Twain some singing competition, Joe is going to owe us another tattoo, and wait ... when does Michael think C++ was invented?

Ep 94Data Structures - Primitives
We begin our journey into data structures by taking a deep dive into primitives while Allen makes Michael blush and Joe crashes his browser.

Ep 93Developer Shopping Spree
With the holiday season soon approaching, we address the most important requirements list of all ... our wish lists as Joe has to disclose a cheese powder incident, Michael hopes his Bitcoin gains some value, and Allen researches his purchases to the extreme.