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.
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.