Based on this function, the node.js newrelic driver allows multiple application names. Why does it allow this?
Newrelic allows you to use up to three names per application so that you can create groupings that are meaningful to your troubleshooting and environment.
This is explained in the node.js agents config
Also in New Relic's documentation here and here.
Related
I am looking to use GCP for a micro-services application. After comparing AWS and GCP I have decided to go with Google because one major requirement for the project is to schedule tasks to run in the future (Cloud Tasks) which AWS does not seem to offer an equivalent of.
I am planning on containerizing my services and deploying to GCP using Cloud Run with a Redis cluster running as well for caching.
I understand that you cannot have multiple Firestore instances running in one project. Does this mean that all if my services will be using the same database?
I was looking to follow a model (possible on AWS) where each service had its own database instance that it reached out to.
Is this pattern possible on GCP?
Firestore indeed is for the moment limited to a single database instance per project. For performance that is usually not a problem, but for isolation such as your use-case, that can indeed be a reason to look elsewhere.
Firebase's original Realtime Database does allow multiple instances per project, and recently added a REST API for provisioning database instances. Since each Google Cloud Project can be toggled to also be a Firebase project, you could consider that.
Does this mean that all if my services will be using the same database?
I don't know all details of your case. Do you think that you can deploy a "microservice" per project? Not ideal, especially if they are to communicate using PubSub, but may be an option. In that case every "microservice" may get its own Firestore if that is a requirement.
I don't think one should consider GCP project as some kind of "hard boundaries". For me they are just another level of granularity - in addition to folders, etc.
There might be some benefits for "one microservice - one project" appraoch as well. For example, less dependent lifecycles, better (more accurate) security, may be simpler development workflows...
I want to create a modular node.js application stack containing a set of applications. The idea is that app1, app2, etc can use the controllers and models.
Inside each app folder, I can have app specific package.json, app.js, etc.
I am using express.
I have two issues:
Is it possible to have that structure?
Why I'm not able to deploy such an app set on GCP? When I try It throws 500 internal server error.
enter image description here
To create a similar architecture, even if I didn't find a way to have the same, you should use services. According to the official GAE doc:
Use services in App Engine to factor your large apps into logical
components that can securely share App Engine features and communicate
with one another. Generally, your App Engine services behave like
microservices. Therefore, you can run your whole app in a single
service or you can design and deploy multiple services to run as a set
of microservices.
Does this work for your use case?
Regarding question 2, you didn't provide any information about your current process, so I cannot help you. Please edit the question adding the deployment configuration (app.yaml, etc.) and how is it performed. Please delete any sensitive information before posting it.
I'm intending to host an online portfolio and I have several node.js projects I'd like to host.
So I'd like to host one project on domain.net/project1 and the other on domain.net/project2
Do I need to use a single nodejs process to do this, or is it possible to have each of my separate nodejs projects running independently?
Is it possible to assign a nodejs process to each subdomain?
A better approach will be to host your NodeJS projects independently and then use the domain(hosted and provided by platform) to Custom Sub-Domain(created by you) pointing to point each of your projects to custom subdomains like project1.mydomain.com. This will provide you the flexibility to deploy your node applications on Heroku, AWS or any other hosting environment.
Thus you get freedom of choosing your own hosting platform and can have as many projects hosted as needed. I have attached an architecture diagram for the same and the link to the original draw.io document. Also please note that this is just a sample, and your design may vary as per your specific requirements
You can refer this Arc diagram for more details.
You can use nginx or apache http for host each project or create a path that contains sub paths for each one.
Here come references:
Apache http
nginx hosting
I want to purchase shared hosting with node js support. Can you provide us company name which support nodejs on shared server.
Thanks in advance.
You have many options out there. It depends on what you want to do but I would go for:
Heroku: It has a free option and it's compatible with integration testing tools like Travis. You can easily configure databases and also create environment variables easily
Glitch: It's also for free and you can just start programming because the server is already configured. I usually use this service when I want to try some small projects on node.js and I need a server to share what I'm doing.
There are multiple node services currently deployed and running through pm2 in aws environment.
Difficulty(in terms of maintenance) I see in my current code base is that each of these node services have a a separate configuration file (config\app.json) - Though, most of the properties in these configuration files are common for all the services, each of the property is mentioned in each individual service in code. If there is a change is any of these properties, I will have to modify the change in multiple places.
I would like to centralise the configurations across multiple node services. Is there a way to do that? Expectation is to have a centralised place for maintaining configurations. Any references would help.
I am not sure how your architecture is but if you do not mind creating a small library or microservice, which will just fetch you configurations from a small NoSQL database such as Redis which stores key-value pairs, then it will provide you with configurations at a centralized place.
Now the only configuration remains here is of redis which you can add while building the service by providing it's configuration as an environment variable using some thing like yargs.
Then in every service you'll have to make only one API call to fill up your config json in your case config/app.json