A method comprising: storing a database as a plurality of database shards in a distributed database grid comprising a plurality of grid elements; wherein a mid-tier contains at least a subset of the plurality of grid elements; wherein each grid element of the subset of the plurality of grid elements comprises an in-memory database system; wherein the data set is distributed in accordance with a distribution scheme; receiving, by an application process executing in a same address space as the in-memory database system of a first grid element of the subset of the plurality of grid elements, a service request from a presentation tier; in response to receiving said service request, executing, by the application process in direct mode, a first database transaction; wherein the first database transaction comprises a commit operation and at least one database operation on specific data stored in a first database shard that belongs to the first grid element, said application process performing said at least one database operation; wherein the first database transaction is committed by the application process without participation of another grid element of the plurality of grid elements; the first grid element and a second grid element of the subset of the plurality of grid elements participating in a distributed database transaction, wherein the distributed database transaction requires access to a plurality of database shards that includes a database shard that does not belong to the first grid element; performing, by multiple grid elements of the plurality of grid elements, the distributed database transaction; the first grid element and second grid element participating in a two-phase commit protocol to commit said distributed database transaction. storing a database as a plurality of database shards in a distributed database grid comprising a plurality of grid elements; wherein a mid-tier contains at least a subset of the plurality of grid elements; wherein each grid element of the subset of the plurality of grid elements comprises an in-memory database system; wherein the data set is distributed in accordance with a distribution scheme; receiving, by an application process executing in a same address space as the in-memory database system of a first grid element of the subset of the plurality of grid elements, a service request from a presentation tier; in response to receiving said service request, executing, by the application process in direct mode, a first database transaction; wherein the first database transaction comprises a commit operation and at least one database operation on specific data stored in a first database shard that belongs to the first grid element, said application process performing said at least one database operation; wherein the first database transaction is committed by the application process without participation of another grid element of the plurality of grid elements; the first grid element and a second grid element of the subset of the plurality of grid elements participating in a distributed database transaction, wherein the distributed database transaction requires access to a plurality of database shards that includes a database shard that does not belong to the first grid element; performing, by multiple grid elements of the plurality of grid elements, the distributed database transaction; the first grid element and second grid element participating in a two-phase commit protocol to commit said distributed database transaction.