Skip to content

App (Scheduled Job)

Mohamed Hassan (JOSEPH) edited this page Apr 27, 2023 · 15 revisions

If you have enough theoretical background, then you can utilize this component to generate necessary analytics from large data volumes if needed and other techniques to save disk storage and separate data-read from data-write with minimal possible cost. Just use it in another time like 00.00 where there is no live traffic (distribute CPU load over the data storage server) from the end users on the system to do the data-read and data-write on the data storage, OR send emails to end users, preparing reports asynchronously or other use cases [just use your bloody hell brain 🧠 sweet heart 😘]


Hint:

  • Replication is NOT ALLOWED with this component. Just 1 replica fits the business need besides it is effective and efficient πŸ‘Œ, so we conclude from that this component type is not subject to horizontal-scaling

  • Saving disk storage πŸ’° like manual discarding of paper archives after 10 years or so, according to Business need and rules after getting the necessary analytics from them, so you will avoid wasting land space πŸ₯³ by installing more servers and brining a country's infrastructure down πŸ’£πŸ’₯πŸŒ‹β˜’οΈβ˜£οΈ by consuming a bloody hell electricity [just use your bloody hell brain 🧠 sweet heart 😘]


Mail server: Considered as another system outside your system's boundary. Think of it as another black box who has interface for integration


Examples:

  • Divide emails into batches, then iterate over each batch. On each iteration launch a batch request to the mail server. Check their APIs docs first or even contact them to maximize the effectiveness and efficiency. Sleep the main thread for 5 secs Hint: Thread.sleep(5000) between each batch request (lighten the load over the mail server) to avoid something like DDOS attack on the mail server because it'll bring the mail server down

  • Reporting and Analytics

    • Accept report request via frontend channels =>
    • Mark the report status as in progress =>
    • Prepare it asynchronously at another time, Mark the report status as completed as the report status is changed =>
    • Then the user can read the raw data using frontend channels =>
    • Then format the report according to a suitable user experience [determined via the UI/UX Designer]

Usage: 1 component per business function. Just follow SRP. Keep it always clean and follow KISS.

Clone this wiki locally