David Kearney went over twice in as many minutes, New Zealanders Nathan White and Leo Auva'a both touched down and Ian Madigan also breached the Cardiff defence as Joe Schmidt's men went top of the RaboDirect PRO12 table.
Ferris' scores came at key moments in the game, his first just before half-time and the second arriving four minutes after the hour.
But Ulster had to withstand a tricky final 10 minutes after prop Adam Macklin was binned moments after coming on, allowing Scarlets to score their only points of the second half from Kieran Murphy's try and Stephen Jones' conversion, which earned them a losing bonus point.
Edinburgh continued their run of impressive form as they racked up seven tries to win 50-10 against RaboDirect PRO12 basement side Aironi at Murrayfield.
Home winger Tim Visser bagged a hat-trick and there was one apiece for Dave Denton, Nick De Luca, Lee Jones and Chris Leck, while Greig Laidlaw booted 13 points and Phil Godman also contributed with the boot.
George Biagi and Filippo Ferrarini had a try each for the outclassed visitors.
Treviso ground out their third away victory in this season's RaboDirect PRO12, frustrating Connacht to down them 15-13 in a wet and windy Galway.
The sluggish home side gave the Italians a 15-0 headstart as full-back Ludovico Nitoglia and winger Tommaso Iannone crossed the whitewash.
A terrific individual effort from David McSharry closed the deficit to eight points by half-time, taking advantage of Fabio Semenzato's sin-binning.