Hayloft is a C++-based object oriented interface to the Amazon Web Services (AWS) Simple Storage Service (S3). It is built on top of  Desperadito (a subset of Desperado) and Bryan Ischo's excellent C-based libs3. Hayloft is licensed under the GNU Public License 3.0. libs3 is in turn built on top of the cURL and SSL libraries. It is designed to make S3 easy to use in small embedded systems although it is likely to be useful in any C++-based application.

Hayloft currently implements much S3 interface functionality (limited mainly by what libs3 provides).

  • Service Manifest (list of buckets within a service)
  • Bucket Create
  • Bucket Head (metadata)
  • Bucket Manifest (list of objects within a bucket)
  • Bucket Delete
  • Object  Head (metadata)
  • Object Get (using Desperado Output functors)
  • Object Put (using Desperado Input functors)
  • Object Delete
  • Grant Get (access control list)
  • Grant Set (access control list)
  • Log Set (server access logging)
  • Log Get (server access logging)

Different regions (a.k.a. location contraints), endpoints, and access permissions are supported. There's a wealth of unit tests that demonstrate how to use Hayloft against an live AWS S3 account. I've used the unit tests to measure differences in convergence in S3's Eventual Consistency architecture. Hayloft leverages C++ language features to make getting started with S3 easy (trivial really) in C++.

Hayloft offers a variety of mechanisms, with examples of all of them in its extensive unit and functional test suite, for managing S3 actions that include both synchronous and asynchronous behavior and single threaded and multithreaded execution.

Hayloft has some useful collateral even if you aren't interested in S3.

  • Packet implements a infinite (as long as memory holds out) length bi-directional memory buffer that support prepend and append. It maintains a linked list of individual objects like PacketBuffer that are themselves bi-directional fixed length memory buffers. The combination makes it easy to build network protocol packets by prepending and appending (or, if you are quite clever, inserting) fields. Much of the building can be done in-place without copying data.
  • Logger extends the Desperado Logger class by implementing a mechanism to turn individual log levels on and off, either programatically or using an environmental variable.
  • Hayloft provides a simple to use set of classes based on POSIX Threads (pthreads) that makes it easy to write simple multi-threaded C++ applications: Thread, Mutex, CriticalSection, Condition, Uncancellable, and MemoryBarrier.
  • Hayloft is unit tested using Google Test. It has lots of examples of how to set up and tear down individual tests or the entire test suite.

Hayloft has been tested on a Linux/GNU-based PC (Ubuntu).

Hayloft can be found on GitHub here.

Here are some articles that my alter-ego Chip Overclock has written about Hayloft.


Presentation: Implications of Memory Consistency (or Lack of It) Models for Java, C++, and C Developers (more)

Seminar Review: Jack Ganssle, Better Firmware Faster, 2006 (more)

Article: Vaster than Empires and More Slow: The Dimensions of Scalability (more)

Article: In Praise of do-while (false) (more)

Book Review: Joel Spolsky, Best Software Writing I, Apress, 2005 (more)

Presentation: Robert Austin, Measuring and Managing Performance in Organizations, Dorset House, 1996 (more)

Book Review: Joel Spolsky, Joel on Software, Apress, 2004 (more)

Presentation: James Surowiecki, The Wisdom of Crowds, Doubleday, 2004 (more)

Travelogue: China Journal: Dancing with a Sleeping Giant (more)

Unless otherwise specified, all contents Copyright © 1995-2015 by the Digital Aggregates Corporation, Colorado, USA.
Such copyrighted content is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.5 License.