Posts

Showing posts from January, 2021

Error with No Exception Thrown When Transferring Data from Amazon Elasticsearch Service to Amazon DocumentDB

We all wish our application performs as fast as possible and to do that sometimes we need to slow down. I have a project in which I have to get data from Amazon Elasticsearch, process the data and save the result into Amazon DocumentDB. I processed the data asynchronously so my processing application performed really fast. Since the result accuracy is important, I deleted the result and rerun the process just to make sure the same input will produce the same result. However, the results are different and no error nor any exception is thrown. After few hours of troubleshooting, I noticed that the data were not immediately available right after inserting them into DocumentDB. Since DocumentDB separate storage and compute, it took a bit of time to store the data and make them available.  In my code, I need to immediately queried the inserted data. That means, sometimes, it saved the data fast enough that the data are available and sometimes they are not. So my solution is putting a sl...

Running Express JS Application via Plesk in Mocha Host Windows Hosting

Image
Nowadays, to run an application balancing best practices and ease of use need tons number of different technology. That means documentations are scattered too. I have an Express JS application that I need to be hosted and since I have active plan under Mocha Host, I decided to host it there. My hosting server is Windows and it supports Node.JS. Looking into the settings, it is as simple as enabling Node.JS. However, after managing to deploy the application, it doesn't run as expected as it returns 404 for known url. When I finally managed to solve the running issue, there are many steps that I need to configure to get my application working. Step 1 I'm using Express JS version 4 generated via express-generator, so the starting script is not app.js, but /bin/www . So following the instruction in the article below: https://www.plesk.com/blog/product-technology/node-js-plesk-onyx/ I created a new entry file called service.js. The content is simple as follow: const app = require(...