In order to design tougher materials, it is crucial to understand the relationship between their composition and their resistance to fracture. To this end, we investigate the fracture toughness of usual sodium silicate glasses (NS) and complex calcium--silicate--hydrates (CSH), the binding phase of cement. Their atomistic structure is described in the framework of the topological constraints theory, or rigidity theory. We report an analogous rigidity transition, driven by pressure in NS and by composition in CSH. Relying both on simulated and available experimental results, we show that optimally constrained isostatic systems show improved fracture toughness. The flexible to stressed--rigid transition is shown to be correlated to a ductile-to-brittle transition, with a local minimum of the brittleness for isostatic system. This fracture toughening arises from a reversible molecular network, allowing optimal stress relaxation and crack blunting behaviors. This opens the way to the discovery of high-performance materials, designed at the molecular scale.