What are you trying to accomplish?
UV sterilizers are good for killing algea in the water and killing desease causing micro organisms. They will not kill algea stuck to surfaces in/on your tank. I consider them like insurance. When choosing a UV unit, take bulb replacement cost into consideration. Prices vary wildly for replacement bulbs.
Diatom filters are good for polishing the water and removing (not killing) through filtration desease causing micro organisms. A diatom filter will also not remove algea stuck to surfaces in your tank. A disadvantage (for me anyway) is the frequent cleaning of the filter element.
So, they both do the same thing but in different ways. The UV kills things dead while the Diatom removes them by micro filtration. For my needs, a UV sterilizer was the answer to keeping the water clear and keeping the fishes healthy. I chose a 36 watt Coralife Turbo Twist. It is virtually maintenance free other than changing the bulb when it goes out.
You must have a pump to push water through the UV sterilizer. Flow rate is important here. You must choose a pump that pumps slowly enough to kill micro organisms and is still fast enough to move enough water to be effective. Most UV manufacturers will give an optimum gph for their unit.