Multi-tenancy in cloud computing describes the extent to which resources can be shared while guaranteeing isolation among components (tenants) using these resources. There are three multi-tenancy patterns: shared, tenant-isolated and dedicated component patterns. These patterns have not previously been formally specified. So how do we choose an appropriate multi-tenancy pattern for a multi-tenant application? To address this question, we have created a formalized description of each multi-tenancy pattern in Z language. We formalize the multi-tenancy pattern using fixed semantics, firstly, to verify each of the patterns, secondly, to provide a precise interpretation of the pattern and finally, to choose a suitable multi-tenancy pattern for a multi-tenant application. We then empirically evaluate each pattern using the data-tier of a cloud hosted distributed content management application, WordPress, deployed in a Docker container. Experimental results show that the dedicated pattern performed best with varying tenant needs while shared and tenant-isolated patterns performed variably the same depending on how much data were involved. Based on the empirical evaluation, we provide a selection algorithm to choose suitable multi-tenancy pattern for software deployment.