DSL – Domain Specific Language – for business analysts

How to provide a tool for business analysts to write logic in simple English? So that it can be used by underlying software without any changes or rewriting.
Answer: DSL – Domain Specific Language

If required we need to develop DSL from scratch for a given domain.
So that BAs can write rules and that should be easy to integrate with code.

wiki: https://en.wikipedia.org/wiki/Domain-specific_language
DZone: https://dzone.com/articles/domain-specific-languages-for-business-application

https://tomassetti.me/domain-specific-languages/
DSL
(Image from https://tomassetti.me/domain-specific-languages/)

https://www.pythonmembers.club/2018/09/03/how-to-create-your-own-dsldomain-specific-language-in-python/
https://www.braintreepayments.com/blog/a-dsl-in-5-languages/
https://dbader.org/blog/writing-a-dsl-with-python
https://enotuniq.org/ – Python as DSL

—-
Optimization Algorithms
https://developers.google.com/optimization/


DROOLS Expert Page with DSL
https://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch05.html

Advertisements

Connection marked as broken because of SQLSTATE(08003)

Problem Statement: Customer is restarting PostgreSQL database every night. Long running jobs are failing from after DB restart.

https://github.com/brettwooldridge/HikariCP/issues/198

Address this:
https://github.com/brettwooldridge/HikariCP/issues/1056
Just to save the trouble of scanning through the PostgreSQL driver release notes, the Connection.setNetworkTimeout() was released in version 42.2.0 of the driver (https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.0)

Available properties
https://stackoverflow.com/questions/26490967/how-do-i-configure-hikaricp-in-my-spring-boot-app-in-my-application-properties-f/51079239#51079239

Check when database was restarted
https://yongitz.wordpress.com/2013/12/05/getting-postgresql-servers-start-time-and-uptime/
To get the start time, execute the query below:
psql -c “SELECT pg_postmaster_start_time();”

To get the uptime, execute the query below:
psql -c “SELECT now() – pg_postmaster_start_time();”

Exception Handling for guaranteed write:

boolean writeStatus = false;
while(!writeStatus)
{
try{
write to database;
writeStatus = true;
}catch (Exception ex)
{
print exception;
sleep for 30 seconds;
//Hope for db to recover.
}
}

Dev, QA, Prod Monitoring Tools

Problem Statement: We need to monitor services on Dev, QA, and Prod.
Customer doesn’t want to sponsor the monitoring project.

Solution:
Step 1: Monitor & Alert
Monitor service endpoints using JMeter or Python.
Write output to CSV files day wise.
Send EMails or Slack messages for given thresholds

Step 2: Aggregate Numbers
Setup Jupyter Notebook
Mount all files as input with read-only access
Write a script to tabulate and visualize data.
Protect system with id/password
https://jupyter-notebook.readthedocs.io/en/stable/public_server.html

-o-