Posts

Showing posts from November, 2021

AWS Lamdba spinning up a nodsjs microservice with persistence

Image
  AWS Lamdba serverless is pretty cool. Deploy services and code easily without having to provision and manage servers.  My previous employer has it's own data center and infrastructure so we don't get to work hands on configuring and using aws services usually. So I'm creating my own AWS Lamdba microservice to manage appointments and store in DynamoDB nosql key value database. I'm using serverless framework cli integration for aws. There are steps I followed to setup a nodejs service: Create a new aws user for this service. Follow instructions on aws site to install cli locally. I followed command line install. run `aws configure` cli using new user id and secret (created in step 1) install npm serverless locally you can bootstrap a serverless config file using template create, but in next step I do manually create serverless.yml (or js/ts) for your service and handler functions the handler in the serverless config file must match an exported function name and the fil

Javascript Engine

 Interpreted vs Compiled js is considered an interpreted language (not compiled).  there is no executable to be deployed such as a jar file and each line is read and then processed and executed  but a lot is going on under the hood when javascript code is processed by the javascript engine some of which is very "compiler like" Let's look at this code example. The 3rd line is an error but if code was truly interpreted then would see the console.log() and then error. But that does not happen, we see the error without any log. Why? Example 1: let sayHi = 'hello'; console.log(sayHi) sayHi = ."hi"; Let's look at another example.....same thing we see the error before any log. Why? Example 2: console.log("Howdy"); saySomething("Hello","Hi"); function saySomething(greeting,greeting) {     //"use strict";     console.log(greeting); } At a high level, the javascript engine is making multiple passes over