Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stack Problems

Bodo Kaiser
September 16, 2014

Stack Problems

Node.js and Google Go and a lot of problems regarding which stack to choose.

Bodo Kaiser

September 16, 2014
Tweet

More Decks by Bodo Kaiser

Other Decks in Programming

Transcript

  1. My Attempts to solve them Mongoose -> SQL SQL ->

    Mongoose Mongoose -> Monk & Joi Monk & Joi -> Mongoose Node -> Java Node -> Go Go -> Node
  2. My Attempt to Go III 1. Rewrote REST service 2.

    Problems with MongoDB 3. Moved to mysql 4. Moved to mariadb 5. Bloated SQL layer
  3. In Node I var cache = []; crawl(new Page('http://nodejs.org')); function

    crawl(page) { request(page.origin, function(err, res, body) { if (err) return; var $ = cheerio.load(body); $('a').each(function(index, element) { var href = $(element).attr('href'); if (href &amd;&amd; !page.hasRefer(href)) { page.addRefer(href); } }); page.refers.forEach(function(refer) { if (!~cache.indexOf(refer)) {
  4. In Go I package main import "github.com/bodokaiser/crawler" func main() {

    req, err := crawler.NewRequest("http://golang.org") if err != nil { return } channel := make(chan *crawler.Request) c := crawler.New() c.Do(req) c.Run(100) go wait(request, channel) for req := range channel { for _, url := range req.Refers {
  5. Where Node is Fun Rapid Development Responsive Web Apps REST

    APIs* * when data consistency does not matter