Skip to content

Procaseycash/cache-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache System

This service uses express-generator to scaffold the application structure which was later modified.

The API Postman documentation can be download API Documentation and the environment configuration from API Environment

Setup and Running of the app

All that is needed to be done is:

$ npm install
$ npm run start

Base Service URL

Visit http://localhost:4000/api/v1/ as the base of the service URL.

Libraries

All library usage can be found in package.json and engine setup is on

node 15.X and above
npm 7.X and above

Service Structure

bin/
src/
    configs/
    controllers/
    dtos/
    models/
    routes/
    services/
    utils/
    server.js
.env    

Scheduler

There is a schedule that clean up expired cache data from database and the in-memory db to avoid overloading the database.

Duration

Cache duration are in seconds and scheduler run every 10 seconds to take out expired data configured with durations.

Environment

Made use of environment system called .env to handle some global configuration for the server side through the dotenv library. This is added as part of the repo only for the sake of easy access.

Choice of Language

Bare Javascript is used to avoid transpile ATM but this is design on OOP concept.

Choice of setup

1. Favoured application decoupling.
2. Easy to manage, maintainability and ease for new developer to join with less work through.
3. Applied MVC pattern
4. Stay true to SOLID, KISS and DRY principles.
5. Service based approach is used to make sure segragation of concerns are met.

Choice on Storage

The use of mongodb and in-memory to handle quick reliable data access is to aid performance and in situation of service restart or the in-memory in damaged, it will rely solely on the mongo db data stored to retrieve information not found in the in-memory DB

About

This is a sample cache system development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published