Performance
Access control overhead
Mongalayer is not intended for high-performance write and complex query scenarios. Both read and write operations incur overhead due to access control checks.
insert operations are the least affected, as they check the inserted document itself against the access filters without needing to read from the database first. Unless one access definition specifies a alternative collection for role resolution, in that case an additional read is performed on that insert operation and thus incurs more overhead.
update and delete operations perform an additional read to resolve access roles before executing the actual write.
find and aggregate operations are transformed and also incur some overhead. They are rewritten to aggregations to include the access filters, which can lead to more complex queries and thus slower execution times, especially if there are many access definitions or complex filters.