An all-optical bistable device and an electro-optical bistable device, with performances approaching the fundamental statistical limits, are described. In the all-optical approach, the giant nonlinearities associated with bound excitons in CdS are exploited to demonstrate the lowest-switching-energy (< 4 pJ) all-optical bistable device. The device switches in less than 1 ns and fully recovers in less than 2 ns. These times are detector limited. A switching energy of less than 1 fJ is theoretically predicted for an optimized geometry. In the electro-optical approach, an InGaAsP/InP diode laser amplifier is used to demonstrate bistability with less than 6000 photons (< 8 X 10-16 J) incident on the device. The device switches in less than 1 ns and is cascadable since it has a gain of 100. It operates at room temperature and is compatible with diode laser sources.