Resources
Introduction
This module helps you manage resources in your environment. Resources are used by databases and their configuration differs between environments. They contain the configuration that your client drivers need to communicate with databases, servers, CDN or systems such as: Mongo - ElasticSearch - MySQL - SQL Server, Oracle, AWS, Rackspace, nginx, Apache, .... etc.
The usage is straight forward, upon opening the module you see the list of already configured resources by categories(Cluster, server, CDN, system and other). You can add your own and manage the existing ones.
1. Resources explanation
SOAJS gives you the ability to configure resources of the following type: cluster - CDN - server - system and other.
System
You can only create a system like Logstash for now. The deployment is coming soon!!
2. Resources usage
Cluster
Clusters alone are useless at this stage. You still need to assign which databases are using them so you can acquire them while writing your code.
However, the Dashboard Cluster is another story because it contains the information needed to connect the core database of SOAJS.
When you deploy a service/daemon, the later needs to connect to the core database and ask for the registry information of the environment it was instructed to use. SOAJS will load that information and give it back to the service and the service will then start.
This means you need to have a profile that contains information about the core database location, and this profile should be handed to the service so it can use it.
SOAJS core database uses mongo and the profile used is tailored to work with mongo. Click here to lean more about Profiles.
Before deploying a service, you need to specify the environment it is running in.
You do that via the dashboard Clouds & Deployments Module if you are running using container based deployment.
Or you specify environment variables before you start the service if you are running using manual deployment.
Both resolve to the same step which is to specify environment variables before running the service and among these variables is the location of the Profile to use to connect to SOAJS core database.
This is why the content of the Profile should have the same configuration of the Dashboard Cluster.
If you are deploying manually, make sure you create a profile with the correct schema.
In case you are using container deployment, SOAJS will generate the profile for you using the information from Dashboard Cluster then it will point out this profile as an environment variable before it starts the service ( all this is automated using the SOAJS deployer inside the SOAJS Docker image)
Now that you know what the cluster stands for, go ahead and create databases for it.
Server
Nginx is an HTTP server also used for upstream arriving requests to the controllers of the environment it operates in.
Make sure to choose a different name than any created Nginx!!
Make sure to choose a different port than any created Nginx!!
CDN
CDN servers are a set of geographically distributed network of servers that contain multiple copies of the same data and make it possible to deliver it to multiple end users across the globe requesting the same data/content. They cache the static content like script files, CSS, images, text and so on.
You can access the CDN by using "req.soajs.registry.cdn". Add your driver and start adding or retrieving data from the server.