What is the optimal solution?
Per our empirical experience, certain projects don't require a QA team or separate test engineers, since your cross-functional team is capable of fulfilling the needs of a project – MVP phases, small apps and sites, a small audience – or low cost of failure in production. If it's cheap for you to fix bugs identified by your users, you probably don't need to worry much.
But if this is not true, a mix of developers and QA on your project makes your skill sets and productivity set to a maximum. The key is the right integration of the QA. Devs and testers should share knowledge and cross-train each other. A tester who understands the code base will find loose ends earlier – and will break the system successfully. A developer who understands how to build better tests will implement better feature and product.
You uncover the problems fast. It keeps the team members focused on their desired job. And most importantly, it saves your budget.