As you know OpenLayers is based on JavaScript with 0 server-side scripting languages (PHP,Python) used. you cannot directly read a database.
For option 1: (database)
you can use db in OpenLayers indirectly. you need to have a OGC WFS-T implementation. you can use lightweight libs such as tinyOWS or heavy ones such as GeoServer and MapServer. setup Postgis and create the layer in db.
Now OpenLayers can access those layers from db using your WFS service.
You can get a nice tutorial to setup postGIS and use OpenLayers to render the layer using tinyOWS here.
Rendering GML is pretty easy and you can find direct examples on openlayers.org. As I stated in the first line OpenLayers's Javascript nature force it to load all features from the map on client side. So if you have "big data" this will be a problem in both cases(GML/postGIS), but OpenLayers provides some strategy for rendering.
In my opinion OpenLayers is perfect for rendering WMS and small vector layers. To help with large data they are using strategies.
You can check for JS xml parser for parsing gml. By the way, GML is a standard so most of the parsers follow a similar method. OpenLayers have a class called see API documentation for docs/files/OpenLayers/Format/GML-js.html. You dont need to have a custom parser if its a standard GML file. OpenLayers will read and provide you access to features and geometry in the layer.