[bind10-dev] multiple datasources with the new API

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Tue Oct 11 07:09:45 UTC 2011


At Thu, 06 Oct 2011 16:00:09 +0200,
Jelte Jansen <jelte at isc.org> wrote:

> As decided on the call, I'd start a discussion here about how to handle
> multiple datasources.

[...]

> So one option is to do it directly; given the datasources configured,
> simply make a list of them and go through them one by one and pick the
> right answer, possibly using some caching or hints about which zones
> they know about to not have to try all of them every time we need
> something that isn't in the hotspot cache. This can be done directly,
> transparently through a meta datasource, or explicitely.

My slight-to-middle preference is to provide a separate interface to
return the data source to be used for the given name from a list of
data sources (more accurately per the API, return the data source
client from a list of available clients), rather than introducing the
notion of "meta class".

On one hand, providing the unified interface with the concept of
"meta" may look simpler and cleaner.  But I'm afraid that approach can
easily lead to a "leaky abstraction".  One simple example is that if
we introduce a "MetaDataSourceClient" class, it cannot handle multiple
RR classes at the same time (aside from whether we want to do it)
because the abstract class assumes that a concrete client class is
specific to a single RR class.  This particular issue may be addressed
in some way, but as we try to extend the basic interface, I suspect
the fundamental difference between the meta and others (meta is a
collection; others generally represent a single physical data source)
will cause more such issues, and we'd end up dealing with them in
not-so-clean way, such as adding more and more "not implemented"
cases, breaking the abstract interfaces, or changing the abstract
interface just for the sake of the meta class.

That said, at least for the current client interfaces a "Meta" client
class would probably be able to provide reasonably compatible behavior
(as long as we restrict the use of it for a single RR class).  This
type of design choice is often a matter of philosophy, so if others
want to go with a meta, I can probably live with that, too.

---
JINMEI, Tatuya



More information about the bind10-dev mailing list