Exchange: evoluzione ed estinzione della funzionalità di single-instance storage dei messaggi

Exchange è uno dei prodotti Microsoft con una lunga storia alle spalle, infatti la prima versione commercializzata l’11 giugno del 1996 fu Exchange Server 4.0, ma Exchange 4.0 altro non era l’upgrade di Microsoft Mail 3.5 la cui prima versione fu rilasciata nel 1988. Quindi in Exchange ci sono ben 23 anni di evoluzione, scelte progettuali, rivisitazioni e riprogettazione dell’infrastruttura. Per un prodotto che è legato a filo doppio con l’hardware per motivi di performance e storage dei dati questo significa assistere all’introduzione di funzionalità  nate per tamponare carenze legate ai limiti di processori, dischi e RAM che con l’evoluzione tecnologica possono poi essere abbandonate.

Una delle funzionalità nata per sopperire necessità di ridurre lo spazio necessario all’archiviazione dei messaggi e poi modificata per aumentare le performance di I/O è sicuramente la sigle-instance storage (SIS), ovvero la tecnica di referenziare all’interno del database di Exchange i messaggio tramite un puntatore per evitare di memorizzare più copie degli stessi ne caso siano duplicati (si pensi, ad esempio, al caso di una mail inviata ad un gruppo di distribuzione).

La funzionalità di SIS è implementata non solo in mail server, ma anche in file system, nella gestione dei backup e in altre soluzioni legate allo storage. Inoltre questa tecnica è stata utilizzata anche in prodotti di altri competitor (per esempio Amazon S3 e Novell GroupWise), all’interno dell’immagini ISO CD/DVD e il tools di P2P (ad esempio Bearshare a partire dalla versione 5).

Microsoft ha brevettato la Single instance storage of information il 22 settembre del 1998 e l’ha utilizzata la prima volta all’interno dei Remote Installation Services (RIS) in Windows 2000 Server. In Exchange la funzionalità di SIS ha fatto la sua comparsa nella versione 4.0, ovvero nel 1996, con l’evidente obbiettivo di risparmiare spazio si disco in quanto la dimensione massima degli HD in circolazione ancora non raggiugeva i 10 GB.

In Microsoft Exchange Server 5.5, Microsoft Exchange 2000 Server e Microsoft Exchange Server 2003 la funzionalità di SIS è stata mantenuta memorizzando una sola copia del messaggio all’interno di uno stesso database.

A riguardo si veda il seguente Understanding the Exchange Information Store:

“Exchange utilizes what Microsoft terms a single-instance message store. This single-instance message store works on a per database basis. What does this mean? If an e-mail message is sent to multiple mailboxes that are all in the same database, the message is stored once and each mailbox has a pointer to the message”

“However, if the e-mail message is sent to multiple mailboxes that are located in different databases, the message is copied to each database and written to the transaction logs for each Storage Group that contains the database with a copy of the message”

Alcune eccezioni si verificavano nel caso di migrazioni dove la funzionalità di SIS poteva venire meno, a riguardo di veda Exchange single-instance storage and its effect on stores when moving mailboxes.

In Microsoft Exchange 2007 rilasciato il 30 novembre del 2006 grazie all’aumento della capacità degli hard disk che arrivano a superare i 100 GB (+900% rispetto al 1996) viene apportata una modifica alla funzionalità di SIS. Il corpo dei messaggi viene duplicato, mentre gli allegati continuano ad essere referenziati memorizzandone una copia per database.

A riguardo si veda  Exchange 2007 Store Related Changes and Improvements:

“However, unlike previous versions of Exchange, Exchange Server 2007 no longer maintains single-instance storage of message bodies, only for attachments”

Nel post Single Instance Storage in Exchange 2007 del team di sviluppo di Exchange viene spiegato che nel 1996 un disco aveva una capacità tipica 10 GB e gestiva circa 100 IOPS (equivalenti a 10 IOPS/GB), mentre nel 2006 la capacità tipica era di circa 500 GB con 100 IOPS (equivalenti a 0.2 IOPS/GB) di conseguenza l’IOPS è sceso di 50 volte. Quindi era diventato importante operare modifiche all’infrastruttura di Exchange per ridurre il numero di IO e proprio in quest’ottica erano state implementate una serie di migliorie descritte nel seguente Understanding Exchange Server 2007 I/O improvements from 64 bit e alcune di queste hanno comportato la modifica della funzionalità di SIS.

“SIS has also diminished in importance because of the way storage hardware has evolved. Over the past 10 years, the capacity of disk drives has risen sharply, but IO performance has remained flat, leaving most Exchange customers constrained by disk IO rather than disk space. In 1996, a typical disk was 10GB in size, and delivered about 100 IOPS; or about 10 IOPS/GB. Today, a typical disk is 500 GB and delivers about 100 IOPS; or about 0.2 IOPS/GB. The IOPS per GB has dropped 50 fold. Single instancing is fundamentally about saving disk space at the expense of increased IOs. So, while trading IOs to save space was a good strategy 10 years ago, today a focus on IO reduction makes more sense.”

“Exchange 2007 included a large amount of work to reduce IO. Some of these changes affected the way that Exchange handles single-instancing of messages. In Exchange 2007, attachments are single instanced, but message bodies are not.”

Infine in Microsoft Exchange 2010 la funzionalità di SIS è stata rimossa dal momento che rispetto a Exchange 2007 l’assenza di SIS comporta un aumento massimo del 20% dello spazio occupato grazie alla nuova architettura e alle modifiche operate sullo storage e su ESE. In questo modo si è ottenuta un’ulteriore riduzione degli IO che conteggiando le varie modifiche a ESE e allo store engine (lazy view updates, space hints, page size increase, b+ tree defrag, etc) arrivano ad un 70% in meno rispetto a Exchange 2007.

Per i dettagli si veda il post Dude, Where’s My Single Instance? del team di sviluppo:

“This architecture, along with other changes to the ESE and store engines (lazy view updates, space hints, page size increase, b+ tree defrag, etc.), netted us not only a 70% reduction in IO over Exchange 2007, but also substantially increased our ability to store more items in critical path folders.”

“As a result of the new architecture and the other changes to the store and ESE, we had to deal with an unintended side effect. While these changes greatly improved our IO efficiency, they made our space efficiency worse. In fact, on average they increased the size of the Exchange database by about 20% over Exchange 2007.”