Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stack Problems
Search
Bodo Kaiser
September 16, 2014
Programming
0
42
Stack Problems
Node.js and Google Go and a lot of problems regarding which stack to choose.
Bodo Kaiser
September 16, 2014
Tweet
Share
More Decks by Bodo Kaiser
See All by Bodo Kaiser
The Walking Node
bodokaiser
0
260
WebSockets - Today, in the Past, in Future and in Production.
bodokaiser
2
160
Other Decks in Programming
See All in Programming
Activities at Cairo Library
cairolibrary720
0
1.2k
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
生成AIをkintoneに連携してみた
hideg
0
230
TiDB Serverless ~理想のServerless DBを考える~
soso_15315
1
160
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
1
450
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.3k
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
なぜ宣言的 UI は壊れにくいのか / Why declarative UI is less fragile
uenitty
29
13k
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
【Go言語】golangci-lintの使い方
tomo1227
0
270
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
262
13k
Web development in the modern age
philhawksworth
203
10k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
How STYLIGHT went responsive
nonsquared
93
5k
Git: the NoSQL Database
bkeepers
PRO
423
64k
How GitHub Uses GitHub to Build GitHub
holman
471
290k
Designing the Hi-DPI Web
ddemaree
276
34k
GraphQLとの向き合い方2022年版
quramy
36
13k
The Cult of Friendly URLs
andyhume
75
5.9k
Clear Off the Table
cherdarchuk
89
320k
Building Your Own Lightsaber
phodgson
101
5.9k
Why Our Code Smells
bkeepers
PRO
332
56k
Transcript
Stack Problems Node.js Meetup #6, September 16
Let's hear a Story
How I felt first with Node
My Problems with Node Model Validation Business Logic Language Guidance
My Attempts to solve them Mongoose -> SQL SQL ->
Mongoose Mongoose -> Monk & Joi Monk & Joi -> Mongoose Node -> Java Node -> Go Go -> Node
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
How I felt after these Failures
Let's write a Web Crawler
... at Web Scale
Basics
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)) {
In Node II
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 {
In Go II
It's Rating Time
Where Go is Fun Concurrent Software Custom Software Writing Libraries
Where Node is Fun Rapid Development Responsive Web Apps REST
APIs* * when data consistency does not matter
Conclusion Use the right tool for the right job!