A seed repository that contains a Go project that accepts input via a REST API and saves data to an Oracle database.
This repo is suitable for backend web development. APIs developed with this repository should live behind a proxy like APIGEE with API keys or be secured with Oauth.
The cost of an Oracle license is less than the cost of man hours that it would take to convert to another DBMS for most organizations.
That being said, this seed moduralizes the data access module to make moving to Postgres or SQL server simple.
Golang uses signficantly less resources than Java, and is optimized to be a web development language.
The cloud savings could be significant.
Build a docker image:
docker build -t go-seed .
Run the docker image:
# Modify DATA_SOURCE_NAME to contain your Oracle DSN
docker run --env DATA_SOURCE_NAME=user/pass@oracle_host:1521/orclcdb -t go-seed
Use CURL to hit an endpoint:
container_id=`docker ps | grep go-seed | cut -d " " -f 1`
ip=`docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container_id`
curl -X GET $ip:8080/person
Open this directory in VScode and install the following plugin: https://code.visualstudio.com/docs/languages/go
The developer machine must have Oracle Instant Client installed for this to work. Look at the Dockerfile for hints on what to install.
The directory ./vscode/
contains a launch file that runs this project in debug mode. This is useful for debugging and development.
launch.json must be modified to point at the correct Oracle DB instance.
To start debug mode, Press F5
with main.go open.