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

When to Log Out
2024-10-07
Things to Know when Considering Multi-Tenant or Multi-Threaded Applications
2024-09-02
Two Water Coolers Walk Into a Bar…
2024-08-18
How did We Even Arrive Here?
2024-08-04
AI, Blank Pages, and Client Libraries…oh my!
2024-07-07
Alternatives to Administering and Running Apache Kafka
2024-06-23
Nuts and Bolts of Apache Kafka
2024-06-09
Intro to Apache Kafka
2024-05-26
StackOverflow AI Disagreements, Kotlin Coroutines and More
2024-05-13
Llama 3 is Here, Spending Time on Environmental Setup and More
2024-04-28
Ktor, Logging Ideas, and Plugin Safety
2024-04-14
Importance of Data Structures, Bad Documentation and Comments and More
2024-04-01
Decorating your Home Office
2024-03-18
Multi-Value, Spatial, and Event Store Databases
2024-03-04
Overview of Object Oriented, Wide Column, and Vector Databases
2024-02-19
Picking the Right Database Type – Tougher than You Think
2024-02-05
There is still cool stuff on the internet
2024-01-21
Reflecting on 2023 and Looking Forward to 2024
2024-01-08
Gartner Top Strategic Technology Trends 2024
2023-12-18
2023 Holiday Season Developer Shopping List
2023-11-25
  • ←
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • →
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