How to save a map route

Suppose I have an origin and a destination data stored in the database.

  1. How to convert it in a route?
  2. What is the format of a route to be stored in the database?

You could look at using the Google Maps API, and the store the result ?