Architecture toolbox

December 30 2008

yesterday i was reading a nice paper by Nat Pryce on testing asynchronous systems, presented at last XP Day in london. the topic is really interesting to me, but what caught my attention was the diagrams describing system X, Y and Z: what a nice and compact way of showing complex architectures and testing strategies! system Z resembles our last customer’s project, a mix of http, jms and soap. moreover, a service bus was choosen to interconnect applications, such as in sistem Y.

i’m really interested in software architectures and distributed systems. having a background in system administration and integration, and an engineering curricolum too, i always start considering existing standards and solutions when facing problems. but that’s half the story. being an XPer, i value simplicity. so, avoiding to reinvent the wheel, while looking for simple strategies, which components are in our architecture toolbox?

first, when we need to store, retrieve and share data in a distributed system, we can choose:

  1. a RDBMS, using a relational model
  2. a filesystem, for flat (files) or hierarchical (directories) data
  3. a queue or topic, using a flat (and asynchronous) model
  4. a directory service, for hierarchical data
  5. e-mails, using a flat (and asynchronous) model

sharing data at resource level means using existing standard or vendor specific protocol and transport. here they are a few:

  1. SQL and ODBC, or some platform-specific technology such as JDBC
  2. network filesystems such as NFS or SMB accessed through a socket. otherwise, WebDAV resources on top of HTTP, or the aged FTP. for local filesystems, you can rely on the OS and URL abstraction (using file:// schema)
  3. a messaging system, such as JMS for Java or Microsft MSMQ, which provide both a protocol for data access and a transport technology
  4. LDAP, using open APIs (such as OpenLDAP) or vendor’s transport technologies (e.g. Microsoft Active-Directory or ADAM)
  5. IMAP/POP3/SMTP standard protocols, accessed through a socket or through platform-specific APIs

when directly sharing resources is not feasible, we can put a lightweight proxy API in front of the resource we want to isolate. think of security issues (DMZ or firewalling rules), clustering (non functional requirements and system *-ility), and low-resource devices compatibility (e.g. for mobile devices). proxy API can be developed writing a little grammar for a protocol and then using a code-generation tool for parsing network traffic (on top of HTTP or custom sockets). otherwise, choose a standard protocol and transport:

  • SOAP and WS-* standards on HTTP, or XML/RPC on TCP, both textual protocols
  • CORBA or platform-specific standard like RMI fo Java, both binary protocols
  • REST services on HTTP, providing CRUD operations in term of HTTP methods

for more complex scenarios, we go beyond a distributed system sharing data: we need to interconnect independent applications. Enterprise Integration Patterns book shows four integration strategies: file transfer, shared database, remote procedure invocation and messaging. while for file, database and remote APIs we can reuse standards for sharing data, for messaging we need an ESB solution, built on top of existing technologies such as XML and JMS.

finally, there are a few additional services we usually need. for authentication and authorization, instead of a custom or integrated vendor sulution (login forms or SSO technologies) what about using HTTP or HTTPS? otherwise we can wrap existing transport inside SSL. also LDAP can help. then, we probably need to monitor systems and applications. again, before implementing a custom solution, consider using existing standard as (for Java) JMX or (the old one) SNMP.

and you, what’s on your toolbox?


Leave a Reply

Fill in your details below or click an icon to log in: 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

%d bloggers like this: