Openstack Swift: Introduction for Developers (Part I)

Openstack Swift is a mass scale object storage, coded in pure Python. It has code organized in following components:

  • account
  • container
  • proxy
  • obj
  • common

Things to remember

  • This is a single node, very first look at Swift code.
  • Code:
  • Installation: Use SAIO (Swift All In One). It is not complete, I guess. I did the following:
  • All components in swift are WSGI based web servers. You will find GET, PUT, POST, HEAD, DELETE implemented here. There are good points to start understanding code.
  • An object has a storage path. This path is combination of account, container and object-name. Consider this path as a key.
  • Each path is unique. Using the storage path, an object can be retrieved from the cluster.
  • Ring is an outsider stuff. Don’t worry about it in the beginning.
  • obj: Code for storage server.
    • It has code to write/ read objects on local disk. Start from “”.
  • container: A catalog of stored objects.
    • It is stored as a SQLite database. Look at “”
  • account: Code for account.
    • Yet to take a close look.
  • proxy: The main component that accepts requests from outside world.
    • It has three controllers under ./controller/: obj, account and container.
    • Each of these are WSGI web services and would call their respective handlers.
    • Each request to proxy might involve execution of multiple operations. e.g. a GET request needs a HEAD request to container server and followed by a GET request to object server. The former confirms existence of the object, the latter fetches it.
    • Useful files: All of’em.
      • Base Proxy server
      • ./controller/account: Calls account server
      • ./controller/container: Calls container server
      • ./controller/obj: Calls object server
  • Debug logs: /var/log/syslog has logs for all mentioned components

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: