What the Heck Is an “Atomic Object”?

 

You may have noticed that Atomic Object has a pretty cool name. In fact, we’ve received phone calls from people just wondering what it is we do (no doubt speculating whether we’re a Michigan-based version of CERN).

Unsurprisingly, our company name is rooted in two computer science concepts—Atomicity and Objects.

Atomicity

In computer programming, an operation done by a computer is considered atomic if it is guaranteed to be isolated from other operations that may be happening at the same time. Put another way, atomic operations are indivisible.

Atomic operations are critically important when dealing with shared resources. To understand why, let’s look at an example. Imagine two people, Sam and Sally, are trying to buy an item online using the same bank account with a $100 balance:

  1. Sam clicks “buy now” on a $100 Lego set.
  2. Banking software checks to see that at least $100 is in its account database, and confirms that that there is enough to make the purchase.
  3. Sally clicks “buy now” on a $50 video game.
  4. Banking software checks to see that at least $50 is in its account database and confirms that that there is enough to buy the game.
  5. The bank withdraws $100 to pay for Sam’s Lego set. (Balance is now $0.)
  6. The bank withdraws $50 to pay for Sally’s video game. (Balance is now $-50.)

The account is now overdrawn because the banking transaction (checking for and withdrawing funds) is not atomic. To correct this problem, the banking software would need some form of mutual exclusion to ensure that the multi-step process of checking funds and withdrawing funds is indivisible.

One approach is to use a lock, which we set before accessing the shared resource and then release when we are finished. Other threads must wait until the lock is released to use the shared resource. The code within the block is called a critical section.

acquire lock
  /* Entering critical section */
  if $100 is availabile
    withdraw $100
  /* Leaving critical section */
release lock

If the bank software used the above algorithm, the sequence of events between Sam and Sally would be:

  1. Sam clicks “buy now” on a $100 Lego set.
  2. Sam’s request acquires the lock, checks to see that at least $100 is in its account database, and confirms that that there is enough to make the purchase.
  3. Sally clicks “buy now” on a $50 video game.
  4. The banking software waits on the lock—it’s currently in use by Sam’s request.
  5. The bank withdraws $100 to pay for Sam’s Lego set (balance is now $0), and releases the lock.
  6. Sally’s request acquires the lock, checks to see if at least $50 is in the account database, and sees that there is not enough.
  7. Sally is unable to buy the video game.

Atomicity is a essential feature of many computer systems, multi-threading, databases, parallel processing, memory management, etc.

Objects

In Object-Oriented programming, a class is a type of thing, and an object is a specific example of that thing. For example, for the class Car, you might have objects like John’s Mazda3 or Stephanie’s Civic.

A class works like a template for creating objects. Each class has properties that define it. The class Car might have properties like:

  • Brand
  • Model
  • Year Manufactured
  • Color
  • Number of Doors

The object John’s Mazda3 is a Mazda, a model 3, was manufactured in 2008, is gray, and has five doors. The object Stephanie’s Civic is a Honda, a Civic, was manufactured in 2003, is beige, and has four doors.

Both John’s Mazda3 and Stephanie’s Civic are objects of the type Car. Objects are a fundamental programming concept in most modern languages.

Cultural Significance

So why was our company named Atomic Object? It sounds cool and reflects our roots in engineering. It also lends itself to a unique company nomenclature:

  • Individual employees are called “Atoms.”
  • We sometimes refer to the company as our “Molecule.”
  • Our regular internal newsletter is called the “Nucleus.”
  • We recently announced our Accelerator program.

But beyond clever naming and coolness, “Atomic Object” reflects the way we empower each employee to make decisions individually as if they were an owner of the company. Atoms can make purchasing decisions, are required to account for their time, blog regularly, consult directly with clients, etc. New employees are often surprised with the level of implicit trust and responsibility they are given at Atomic.

We trust our people to act atomically, but when combined, we are much stronger and more interesting—just like atoms in a molecule.