# Goroutines in Servers ![rw-book-cover](https://api.boot.dev/v1/static/course_image/learn-http-servers-golang) ## Metadata - Author: [[Boot.dev]] - Full Title: Goroutines in Servers - Category: #articles - Summary: Go uses lightweight goroutines to handle many requests fast, even with heavy CPU work. Node.js servers run on one core and work well for waiting tasks but slow down with CPU-heavy jobs. Overall, Go is faster and better for performance, especially with complex processing. - URL: https://www.boot.dev/lessons/cf100efc-f582-4435-accb-c8f862635f3d ## Highlights - Go's goroutines are a great fit for web servers because they're lighter weight than operating system threads, but still take advantage of multiple cores. ([View Highlight](https://read.readwise.io/read/01k0qeegb1c9efab10phnj4mgj)) - In JavaScript land, servers are typically single-threaded. A [Node.js](https://nodejs.org/en/) server (often using the [Express](https://expressjs.com/) framework) only uses one CPU core at a time. It can still handle many requests at once by using an [async event loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Event_loop). That just means whenever a request has to wait on I/O (like to a database), the server puts it on pause and does something else for a bit. ([View Highlight](https://read.readwise.io/read/01k0qecmdkz7fycxyzdgttq9pr)) - ![](https://storage.googleapis.com/qvault-webapp-dynamic-assets/course_assets/bmsOkiQ-1280x530.png) ([View Highlight](https://read.readwise.io/read/01k0qedg7zwrabdks1r3r522qr)) - This might sound *horribly* inefficient, but it's not *too* bad. Node servers do just fine with the I/O workloads associated with most CRUD apps (Where processing is offloaded to the Database). You only start to run into trouble with this model when you need your server to do CPU-intensive work. ([View Highlight](https://read.readwise.io/read/01k0qed8pccky3y1bhykqeqj6q))