After looking at the code, and given the work I've been doing with rewriting the config file endpoints, I have to say sqlx all the way. What's involved in the maintenance?
Derek On Sep 12, 2017, at 8:28 PM, Dewayne Richardson <[email protected]<mailto:[email protected]>> wrote: There has been quite a bit of discussion about how to move forward with the Traffic Ops Rewrite in terms of Golang dependencies. Currently there is only one dependency for Mocking out the database for unit testing called https://github.com/DATA-DOG/go-sqlmock. Another that we want to evaluate is https://github.com/jmoiron/sqlx for accessing Postgres to help with minimizing Golang boilerplate code. The following are the Pros and Cons are listed to he lp decide (please add any that I failed to include) Pros - Developer productivity increases (less boilerplate code) - Less Developer errors through tedious field mapping - Active Development Cons - Another dependency to maintain if it is no longer supported Performance The performance penalty is neglible (I tested the /api/1.2/servers endpoint, very loosely, in the Comcast Open Stack lab using the same VM and Apache Bench with 1000, 10000, and 10000 separate requests and the performance was +/-5% depending on the cloud resources that were active). Remember, this endpoint is still 20x faster than the Traffic Ops Perl version. So, please review the following PR's specifically noting the servers.go and servers_test.go files (also browser around to see our progress) WITH Sqlx https://github.com/dewrich/incubator-trafficcontrol/blob/4a09d4188be9dd10fb524f2320aeae6fc44e45e3/traffic_ops/traffic_ops_golang/servers.go https://github.com/dewrich/incubator-trafficcontrol/blob/4a09d4188be9dd10fb524f2320aeae6fc44e45e3/traffic_ops/traffic_ops_golang/servers_test.go WITHOUT Sqlx https://github.com/dewrich/incubator-trafficcontrol/blob/89acc848c12f45361b42c4343364dcffe8a7773a/traffic_ops/traffic_ops_golang/servers.go https://github.com/dewrich/incubator-trafficcontrol/blob/89acc848c12f45361b42c4343364dcffe8a7773a/traffic_ops/traffic_ops_golang/servers_test.go This vote will be closed by noon this Friday 9/25/2017 Thanks, -Dew
