Functions in data structures
Wed Jun 18 08:24:26 CEST 2003
From: "Joachim Durchholz" <>
> Anyway, I have decided to send just plain data, no functions. Code will
> be sent in the form of software upgrades, just the way that people
> expect things to work. (Sending functions implies all sorts of security
> hassles anyway.)
You may want to include a version indicator in the messages going
between nodes. There are currently a few things that can mess up
certain code upgrades:
- record structures are compile-time dependent
- mnesia can not have multiple simultaneous versions of the schema
Thus, if you send records in messages between nodes, and have a
fully distributed database, it is a bit more difficult to upgrade code
one node at a time (an otherwise attractive option).
The issue of mnesia can be overcome by not mixing in too much
into one upgrade, and taking care to build a stable data model.
That is, if your upgrade doesn't contain schema changes, you can
upgrade one node at a time.
The issue of messages between nodes is a bit trickier. I don't think
there are any good guidelines about how to do this. Distribution
transparency is very nice (_very_ nice), but it does make in-service
upgrade a bit more difficult. UBF may offer some relief... The general
recommendation is to exercise more care in communication that
goes across node boundaries -- treat it as a set of formal interfaces.
The main reason for this rambling is that you need to spend some
time rather early thinking about what your upgrade requirements are,
and how they affect your design choices.
More information about the erlang-questions