Insert, Read and Update Post custom fields from plugin

I’m new to rails and ember and also i can’t find any documentation for using post custom fields in plugin. I have added two additional fields to post composer form (using plugin outlet) like below

I need to save this two fields to post custom fields table and retrieve it. Any code sample or any existing plugin code reference will be appreciated.

I’m no plugin expert, but I did notice that several existing plugins do this, the simplest one I can think of being the links category plugin.