I want to create a database thing when a certain number of things are reached on a different database

Is there any way for to achieve this? for example when 20 things are created in Orders database I want to create 2 new things on a different DB each with 10 orders. Where i am stuck is creating this condition where I want to trigger this event with every order then on 10th order it should run.