Action Message Format (AMF) is a technology used for storing and sending
digital data. Technologies that support AMF include Adobe Flash and Apache Flex.
This page aims to do the following:
– Help you understand what AMF is, as simply as possible.
– Help you make an informed decision about whether or not to use AMF for
for your project
– Help you find solutions that fit your business
What is AMF?
AMF is a way to describe digital data. For example when you login to an application, the information must be sent from the client to the server and the server must understand it. In the same way, the server can send back information about who else is online. Your client must understand this.
In XML, the login information would be:
<login> <username>fwilson</username> <password>123456</password> </login>
In JSON, the login information would be:
AMF is binary, so can’t be read easily, but would be something like:
with a few extra bits for structure.
Should You Use AMF ?
If you need to send data, then you need to choose a format. There are many available formats, but for our purposes we’ll restrict the discussion to AMF, XML and JSON.
We’ll also limit things to the most common use case: a client (browser based application, mobile application, desktop application) that needs to communicate with a server in the cloud. The server provides centralized services such as
login/logout and a list of contacts.
First of all, JSON and XML are text formats. They can therefore be printed on screen easily. AMF is binary, so it can’t be shown on screen, but it is more compact.
It also has the following advantages:
– Information is never duplicated. If you need to send a list of contacts,
each with a name and address, most formats will repeat the
strings ‘name’, ‘address’ for each contact. If you use AMF, they will only be
– Data structures can be named and their content enforced.
This means better possibilities for error checking and more robust applications.
So AMF shines when you need to save bandwidth, and when you need to send complex data. This power comes at a cost though: AMF is more CPU intensive and a bit more difficult to debug, as it is binary. So it is better to use JSON or XML when bandwidth is not an issue and the data doesn’t have a complex structure.
In what kind of contexts is AMF used?
The following list covers most areas where AMF is used. This is of course not exhaustive.
– Games. Games need speed, and data goes faster if it is compact.
– Mobile Applications. On mobile, bandwidth is still expensive and worth sparing.
– Enterprise Solutions. Enterprise software often needs to manipulate large amounts of complex data, so AMF’s typing comes in handy.
Which client technologies support AMF?
Which server technologies support AMF?
A full discussion of server technologies that support AMF is too vast a subject and beyond the scope of this article. You are of course advised to use Baguette AMF.