Podbean logo
  • Discover
  • Podcast Features
    • Podcast Hosting

      Start your podcast with all the features you need.

    • Podbean AI Podbean AI

      AI-Enhanced Audio Quality and Content Generation.

    • Blog to Podcast

      Repurpose your blog into an engaging podcast.

    • Video to Podcast

      Convert YouTube playlists to podcasts, videos to audios.

  • Monetization
    • Ads Marketplace

      Join Ads Marketplace to earn through podcast sponsorships.

    • PodAds

      Manage your ads with dynamic ad insertion capability.

    • Apple Podcasts Subscriptions Integration

      Monetize with Apple Podcasts Subscriptions via Podbean.

    • Live Streaming

      Earn rewards and recurring income from Fan Club membership.

  • Podbean App
    • Podcast Studio

      Easy-to-use audio recorder app.

    • Podcast App

      The best podcast player & podcast app.

  • Help and Support
    • Help Center

      Get the answers and support you need.

    • Podbean Academy

      Resources and guides to launch, grow, and monetize podcast.

    • Podbean Blog

      Stay updated with the latest podcasting tips and trends.

    • What’s New

      Check out our newest and recently released features!

    • Podcasting Smarter

      Podcast interviews, best practices, and helpful tips.

  • Popular Topics
    • How to Start a Podcast

      The step-by-step guide to start your own podcast.

    • How to Start a Live Podcast

      Create the best live podcast and engage your audience.

    • How to Monetize a Podcast

      Tips on making the decision to monetize your podcast.

    • How to Promote Your Podcast

      The best ways to get more eyes and ears on your podcast.

    • Podcast Advertising 101

      Everything you need to know about podcast advertising.

    • Mobile Podcast Recording Guide

      The ultimate guide to recording a podcast on your phone.

    • How to Use Group Recording

      Steps to set up and use group recording in the Podbean app.

  • All Arts Business Comedy Education
  • Fiction Government Health & Fitness History Kids & Family
  • Leisure Music News Religion & Spirituality Science
  • Society & Culture Sports Technology True Crime TV & Film
  • Live
  • How to Start a Podcast
  • How to Start a Live Podcast
  • How to Monetize a podcast
  • How to Promote Your Podcast
  • How to Use Group Recording
  • Log in
  • Start your podcast for free
  • Podcasting
    • Podcast Features
      • Podcast Hosting

        Start your podcast with all the features you need.

      • Podbean AI Podbean AI

        AI-Enhanced Audio Quality and Content Generation.

      • Blog to Podcast

        Repurpose your blog into an engaging podcast.

      • Video to Podcast

        Convert YouTube playlists to podcasts, videos to audios.

    • Monetization
      • Ads Marketplace

        Join Ads Marketplace to earn through podcast sponsorships.

      • PodAds

        Manage your ads with dynamic ad insertion capability.

      • Apple Podcasts Subscriptions Integration

        Monetize with Apple Podcasts Subscriptions via Podbean.

      • Live Streaming

        Earn rewards and recurring income from Fan Club membership.

    • Podbean App
      • Podcast Studio

        Easy-to-use audio recorder app.

      • Podcast App

        The best podcast player & podcast app.

  • Advertisers
  • Enterprise
  • Pricing
  • Resources
    • Help and Support
      • Help Center

        Get the answers and support you need.

      • Podbean Academy

        Resources and guides to launch, grow, and monetize podcast.

      • Podbean Blog

        Stay updated with the latest podcasting tips and trends.

      • What’s New

        Check out our newest and recently released features!

      • Podcasting Smarter

        Podcast interviews, best practices, and helpful tips.

    • Popular Topics
      • How to Start a Podcast

        The step-by-step guide to start your own podcast.

      • How to Start a Live Podcast

        Create the best live podcast and engage your audience.

      • How to Monetize a Podcast

        Tips on making the decision to monetize your podcast.

      • How to Promote Your Podcast

        The best ways to get more eyes and ears on your podcast.

      • Podcast Advertising 101

        Everything you need to know about podcast advertising.

      • Mobile Podcast Recording Guide

        The ultimate guide to recording a podcast on your phone.

      • How to Use Group Recording

        Steps to set up and use group recording in the Podbean app.

  • Discover
  • Log in
    Sign up free
Coding Blocks

Coding Blocks

Technology

Designing Data-Intensive Applications – Multi-Object Transactions

Designing Data-Intensive Applications – Multi-Object Transactions

2023-02-06
Download Right click and do "save link as"

It’s time we learn about multi-object transactions as we continue our journey into Designing Data-Intensive Applications, while Allen didn’t specifically have that thought, Joe took a marketing class, and Michael promised he wouldn’t cry.

The full show notes for this episode are available at https://www.codingblocks.net/episode203.

News
  • Thanks for the reviews!
    • iTunes: Dom Bell 30, Tontonton2
  • Want some swag? We got swag! (/swag)
  • Orlando Codecamp 2023 is coming up in March 25th 2023 (orlandocodecamp.com)
Single Object and Multi-Object Operations
Best book evarr!
  • Multi-object transactions need to know which reads and writes are part of the same transaction.
    • In an RDBMS, this is typically handled by a unique transaction identifier managed by a transaction manager.
    • All statements between the BEGIN TRANSACTION and COMMIT TRANSACTION are part of that transaction.
  • Many non-relational databases don’t have a way of grouping those statements together.
  • Single object transactions must also be atomic and isolated.
  • Reading values while in the process of writing updated values would yield really weird results.
    • It’s for this reason that nearly all databases must support single object atomicity and isolation.
    • Atomicity is achievable with a log for crash recovery.
    • Isolation is achieved by locking the object to be written.
  • Some databases use a more complex atomic setup, such as an incrementer, eliminating the need for a read, modify, write cycle.
  • Another operation used is a compare and set.
  • These types of operations are useful for ensuring good writes when multiple clients are attempting to write the same object concurrently.
  • Transactions are more typically known for grouping multiple object writes into a single operational unit
Need for multi object transactions
  • Many distributed databases / datastores don’t have transactions because they are difficult to implement across partitions.
    • This can also cause problems for high performance or availability needs.
    • But there is no technical reason distributed transactions are not possible.
  • The author poses the question in the book: “Do we even need transactions?”
    • The short answer is, yes sometimes, such as:
      • Relational database systems where rows in tables link to rows in other tables,
      • In non-relational systems when data is denormalized for “object” reasons, those records need to be updated in a single shot, or
      • Indexes against tables in relational databases need to be updated at the same time as the underlying records in the tables.
  • These can be handled without database transactions, but error handling on the application side becomes much more difficult.
    • Lack of isolation can cause concurrency problems.
Handling errors and aborts
  • ACID transactions that fail are easily retry-able.
  • Some systems with leaderless replication follow the “best effort” basis. The database will do what it can, and if something fails in the middle, it’ll leave anything that was written, meaning it won’t undo anything it already finished.
    • This puts all the burden on the application to recover from an error or failure.
  • The book calls out developers saying that we only like to think about the happy path and not worry about what happens when something goes wrong.
  • The author also mentioned there are a number of ORM’s that don’t do transactions proud and rather than building in some retry functionality, if something goes wrong, it’ll just bubble an error up the stack, specifically calling out Rails ActiveRecord and Django.
  • Even ACID transactions aren’t necessarily perfect.
    • What if a transaction actually succeeded but the notification to the client got interrupted and now the application thinks it needs to try again, and MIGHT actually write a duplicate?
    • If an error is due to “overload”, basically a condition that will continue to error constantly, this could cause an unnecessary load of retries against the database.
    • Retrying may be pointless if there are network errors occurring.
    • Retrying something that will always yield an error is also pointless, such as a constraint violation.
    • There may be situations where your transactions trigger other actions, such as emails, SMS messages, etc. and in those situations you wouldn’t want to send new notifications every time you retry a transaction as it might generate a lot of noise.
      • When dealing with multiple systems such as the previous example, you may want to use something called a two-phase commit.
Tip of the Week
  • Manything is an app that lets you use your old devices as security cameras. You install the app on your old phone or tablet, hit record, and configure motion detection. A much easier and cheaper option than ordering a camera! (apps.apple.com, play.google.com)
  • The Linux Foundation offers training and certifications. Many great training courses, some free, some paid. There’s a nice Introduction to Kubernetes course you can try, and any money you do spend is going to a good place! (training.linuxfoundation.org)
  • Kubernetes has recommendations for common-labels. The labels are helpful and standardization makes it easier to write tooling and queries around them. (kubernetes.io)
  • Markdown Presentation for Visual Studio Code, thanks for the tip Nathan V! Marp lets you create slideshows from markdown in Visual Studio Code and helps you separate your content from the format. It looks great and it’s easy to version and re-use the data! (marketplace.visualstudio.com)
view more

More Episodes

Command, Repository and Mediator Design Patterns
2016-06-03
Dev Talk: Django, VB vs C#, and Bash on Windows
2016-04-19
How to be an Advanced Programmer
2016-03-20
How to be an Intermediate Programmer
2016-02-27
How to be a Programmer: Personal and Team Skills
2016-01-28
Our Favorite Developer Tools for 2015
2016-01-03
The Twelve Factor App: Dev/Prod Parity, Logs, and Admin Processes
2015-12-20
The Twelve-Factor App: Port Binding, Concurrency, and Disposability
2015-11-23
Toys for Developers
2015-11-10
The Twelve-Factor App: Backing Services, Building and Releasing, Stateless Processes
2015-10-22
The Twelve-Factor App: Codebase, Dependencies, and Config
2015-09-17
Javascript Promises and Beyond
2015-08-22
Design Patterns Part 4 – Adapter, Facade, and Memento
2015-07-26
Hierarchical Data cont’d – Path Enumeration and Closure Tables
2015-06-29
Hierarchical Data – Adjacency Lists and Nested Set Models
2015-06-08
Your Questions Our Answers SYN-ACK with Packet Loss
2015-05-08
Algorithms, Puzzles and the Technical Interview
2015-04-19
ASP.NET 5 – It’s Basically Java
2015-03-30
Delegate all the things!
2015-03-16
Back to Basics – Encapsulation for Object Oriented Programming
2015-02-10
  • ←
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • →
012345678910111213141516171819

Get this podcast on your
phone, FREE

Download Podbean app on App Store Download Podbean app on Google Play

Create your
podcast in
minutes

  • Full-featured podcast site
  • Unlimited storage and bandwidth
  • Comprehensive podcast stats
  • Distribute to Apple Podcasts, Spotify, and more
  • Make money with your podcast
Get started

It is Free

  • Podcast Services

    • Podcast Features
    • Pricing
    • Enterprise Solution
    • Private Podcast
    • The Podcast App
    • Live Stream
    • Audio Recorder
    • Remote Recording
    • Podbean AI
  •  
    • Create a Podcast
    • Video Podcast
    • Start Podcasting
    • Start Radio Talk Show
    • Education Podcast
    • Church Podcast
    • Nonprofit Podcast
    • Get Sermons Online
    • Free Audiobooks
  • MONETIZATION & MORE

    • Podcast Advertising
    • Dynamic Ads Insertion
    • Apple Podcasts Subscriptions
    • Switch to Podbean
    • YouTube to Podcast
    • Blog to Podcast
    • Submit Your Podcast
    • Podbean Plugins
    • Developers
  • KNOWLEDGE BASE

    • How to Start a Podcast
    • How to Start a Live Podcast
    • How to Monetize a Podcast
    • How to Promote Your Podcast
    • Mobile Podcast Recording Guide
    • How to Use Group Recording
    • Podcast Advertising 101
  • Support

    • Support Center
    • What’s New
    • Free Webinars
    • Podcast Events
    • Podbean Academy
    • Podbean Amplified Podcast
    • Badges
    • Resources
  • Podbean

    • About Us
    • Podbean Blog
    • Careers
    • Press and Media
    • Green Initiative
    • Affiliate Program
    • Contact Us
  • Privacy Policy
  • Cookie Policy
  • Terms of Use
  • Consent Preferences
  • Copyright © 2015-2025 Podbean.com