Database is enough

Author: Evgeny Panferov

The idea is to delegate as much work as possible to a database. I want to illustrate advantages of this idea with the working example of, touching security, scalability and performance problems.

I am going to explain how it is possible (and is easy) to implement an "application layer" in PostgreSQL procedural language (so close to data itself still keeping the idea of 3-tier architecture intact).
How to effectively use specific PostgreSQL features.

Database provides you the highest possible abstraction level.
Database is the best tool to arrange an access control scheme.
Database is the safest place to store the most sensitive secretes.
A shorter processing is always better than a longer one.