MDS or Oracle Metadata Services is one of the most unknown and misunderstood features on Oracle FMW. For most folks it is a black box. But now I want to clarify what it is about and how you can take advantage of it.
Being really simplistic, MDS is a repository that contains all metadata related to your customizable application. Those customizations could be:
- Seeded customization. This one happens at deployment time. All customizations are carried inside a MAR file on your artifact.
- User personalization.
- Design time at Runtime, aka, Composer, aka, Business Dictionary.
- SOA composite application.
At runtime, all your customizations are retrieved by MDS and applied to the base application, revealing the final customized app.
A customizable application can have multiple customization layers. For instance: retail_stores and electronic_stores. Each layer can also have multiple layer values. For instance, electronic_stores can have the following values: BestBuy and Frys. Usually, we only apply one of those values at a time in runtime. Inside a
Customization class we could check whether the user is a BestBuy or Fry's employee and apply the appropriate look and feel to the website. I promise I'll get into more details in a future post.
MDS Structure
MDS can be a file-based or database-based repository. On development environment, to avoid waste of resources, you should use the file-based version. And on production environment, Oracle strongly recommends to use a database-based version to take advantage of the many added features such as versioning and atomic transaction.
By default, WebCenter comes with 2 MDS repositories already setup, one for OWSM and the other for Spaces. If you are deploying a new application, in my personal opinion, it's a good practice to
create a new MDS repository and
register it on Enterprise Manager. Let's talk about 2 important concepts before moving to deployment:
partition and
label.
Partition
Partition is an independent logical repository inside an MDS repository. A single MDS repository can have multiple partitions and each partition can be associated with more than one application. I do not recommend this approach, because it can make your life harder while managing application's metadata. Try to keep "1 app equals 1 partition". You can create, delete, clone, import and even export a partition to move the metadata from one environment to the other (test to production).
Label
A label represents a metadata state. Inside a partition you can have many labels. If you create a new label you basically take a snapshot of your current metadata state. You can also delete labels and promote them, making an old label the current version.
Deployment
As a predeployment task you choose which MDS repository schema and partition will host your application metadata. Once you have your application successfully deployed, a label gets automatically created. It should look like this:
postDeployLabel_MyWebCenterApp_1170408561. If you change any customization values, such as a web service endpoint, those changes do not adhere to the current label. So, a new label needs to be created to hold the current state of the application metadata.
If something unexpected occurs there is alway a chance of getting back to the previous version. Remember, that MDS has a version control mechanism. The only thing you have to do is to
promote back the previous label.
For more detailed information please read
Managing the Oracle Metadata Repository.