How do I save the custom route with waypoints and then re-create it back?

I created a map where user can plot his routes with start point, end point and 8 defaults waypoints in between. 

```
(won't bother with the code- it is pretty generic)

```

My current issue is that I can't figure out how to save this custom route to the database and re-create it back when needed? Route can be separated into chunks and those chunks can be saved; but it is too many of them and I don't even know how would google handle it. 

Wondering if there is any way to achieve my goal.