Skip to content

kyeung2/example-nodejs-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-NodeJs-service

A simple NodeJs service to compare with various backend technologies.

Blog post: comparing execution model of various backend technologies

A single endpoint which retrieves data from a Mongo

curl -X GET http://localhost:8080/books

Stack:

  • NodeJs
  • Express
  • Mongoose

Setup Mongo

You can also setup a local Mongo running from a local Docker image. Pull the Mongo image and run remembering to use the -p option to the port. e.g:

docker run -p 27017:27017 --name some-mongo mongo

NodeJs features

  • event-loop execution model:
    • asynchronous and non-blocking IO
    • single threaded
    • different styles to unblock event loop, callbacks, promises and async/await
  • notes:
    • dont-block-the-event-loop
    • parallelism by multiple processes
    • Node excels for I/O-bound work, but for expensive computation it might not be the best option.

About

A simple NodeJs service to compare with different frameworks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published