My storm sorcerer avoids melee whenever possible. Sometimes I will cast a first level spell or higher just the get the free 10 feet of movement without chance of a reaction when combat gets too close. Melee and sorcerers generally don't mix.
As for optimization, take a look at the guides on Enworld for optimization advice. Even tough I play a Storm sorcerer, Draconic has a slight edge on it for the AC 13 natural armor you get plus the extra damage later on to attacks of one element type. The biggest thing to worry about with being a Sorcerer is the limited spells known, so selecting the right spells at each level is important.
If you are open to multi-classing, a 2 or 3 level dip in Warlock gets you the best attack cantrip in the game along with a few other benefits as well. The devil sight invocation along with the Tiefling's free Darkness once a day can be a potent combination.
That said, play what seems the most fun to you. There is more to D&D than getting the maximum damage output you can from your character. Also, spell selection is game specific. For instance my character just turned level 9 and I'm taking the Teleportation Circle spell as my new spell. Most guides rate the usefulness of this spell as low. However, in our game world, teleportation circles are setup in all major cities and also near a remote potential base our group found earlier. We had a couple of situations where the ability to teleport the whole group to a safe location would have gotten us out of some deadly situations. We also don't have a Wizard in our group, so taking it makes sense in our game. Likewise, our game is horror based and we end up encountering a lot of undead. Spells that do necrotic damage are useless most of the time, so taking any of those, even if they are highly rated, make no sense for the game I'm in.