A system comprising: a database system; at least one application; and a database interface; and wherein the database system comprises: a shared database container that includes a first read-only table for storing data shared by multiple tenants including a first tenant; and a first tenant database container for storing tenant-specific data for the first tenant, the first tenant database container comprising: a first writable table storing writable data for the first tenant; and a union view for providing unified access to the first read-only table and the first writable table; wherein a key pattern describes a pattern for keys of records that are included in the first writable table and a complement of the key pattern describes a pattern for keys of records in the first read-only table; wherein the at least one application is configured to submit read and write queries using the name of the union view to the database interface; wherein the database interface is configured to: provide access to the at least one application to the database system; receive a first query from the at least one application; determine that the first query is associated with the union view; determine whether the first query is a read query or a write query; in response to determining that the first query is a read query, process the first query using the union view; and in response to determining that the first query is a write query: if the first query is inconsistent with the key pattern, reject the first query; if the first query is consistent with the key pattern, modify the first query to use the first writable table; and process the first query using the writable table. a database system; at least one application; and a database interface; and wherein the database system comprises: a shared database container that includes a first read-only table for storing data shared by multiple tenants including a first tenant; and a first tenant database container for storing tenant-specific data for the first tenant, the first tenant database container comprising: a first writable table storing writable data for the first tenant; and a union view for providing unified access to the first read-only table and the first writable table; a shared database container that includes a first read-only table for storing data shared by multiple tenants including a first tenant; and a first tenant database container for storing tenant-specific data for the first tenant, the first tenant database container comprising: a first writable table storing writable data for the first tenant; and a union view for providing unified access to the first read-only table and the first writable table; a first writable table storing writable data for the first tenant; and a union view for providing unified access to the first read-only table and the first writable table; wherein a key pattern describes a pattern for keys of records that are included in the first writable table and a complement of the key pattern describes a pattern for keys of records in the first read-only table; wherein the at least one application is configured to submit read and write queries using the name of the union view to the database interface; wherein the database interface is configured to: provide access to the at least one application to the database system; receive a first query from the at least one application; determine that the first query is associated with the union view; determine whether the first query is a read query or a write query; in response to determining that the first query is a read query, process the first query using the union view; and in response to determining that the first query is a write query: if the first query is inconsistent with the key pattern, reject the first query; if the first query is consistent with the key pattern, modify the first query to use the first writable table; and process the first query using the writable table. provide access to the at least one application to the database system; receive a first query from the at least one application; determine that the first query is associated with the union view; determine whether the first query is a read query or a write query; in response to determining that the first query is a read query, process the first query using the union view; and in response to determining that the first query is a write query: if the first query is inconsistent with the key pattern, reject the first query; if the first query is consistent with the key pattern, modify the first query to use the first writable table; and process the first query using the writable table. if the first query is inconsistent with the key pattern, reject the first query; if the first query is consistent with the key pattern, modify the first query to use the first writable table; and process the first query using the writable table.