A horizontally slotted photonic crystal nanobeam cavity with an embedded active nanopillar structure is proposed for ultrafast direct modulation. By designing the thicknesses of both the nanobeam and the horizontal slot layer, the quality factor (Q factor) and the mode volume (Vn) of the proposed cavity can be engineered independently. As a result, the spontaneous emission (SpE) rate is enhanced with a small Vn of 2.4 while the SpE rate and the cavity photon lifetime have an optimal Q factor of ∼ 1000. In our simulation, the modulation bandwidth could be enhanced up to 170 GHz with different emission linewidths of the active nanopillar.