Skip to content

Instantly share code, notes, and snippets.

@halitbatur
Created February 1, 2024 15:01
Show Gist options
  • Save halitbatur/02a95934761f14b3ab4f6f0474964b87 to your computer and use it in GitHub Desktop.
Save halitbatur/02a95934761f14b3ab4f6f0474964b87 to your computer and use it in GitHub Desktop.
Cron and Redis

Redis, Websockets and cron Discussion

Write your answers in the comment section below:

  • What is Redis? Mention one use case of Redis.
  • What type of database is Redis and where does it hold its data?
  • What is Websocket and what is it used for?
  • Explain 3 use cases for CRON jobs.
  • What are the 3 types of design patterns in Nodejs?
@JanaAbuHaltam
Copy link

Jana AbuHaltam, Noor Alrai, Lujain Mansour, Mohamad Alchehabi

Q1
Redis offers a fast, in-memory data store to power live streaming use cases. Redis can be used to store metadata about users' profiles and viewing histories, authentication information/tokens for millions of users, and manifest files to enable CDNs to stream videos to millions of mobile and desktop users at a time.
it's an open source in-memory data store that can be used as a database, cache, or message broker. It's often used for caching web pages and reducing the load on servers. Redis also has some features that make it attractive for use as a database, such as support for transactions and publish/subscribe messaging.

Q2
Redis is a type of database that's commonly referred to as No SQL or non-relational, t holds its data primarily in memory, making it highly efficient for read and write operations. However, Redis also has the capability to persist data to disk, providing durability and backup options. This combination of in-memory storage and optional disk persistence enables Redis to deliver fast data access and manipulation while still ensuring data integrity and protection.

Q3
WebSocket is a technology that allows quick back-and-forth communication between a website (like a game or chat app) and a server. It's great for things that need constant, real-time updates, like chatting or online gaming. WebSocket makes this communication fast and efficient.

Q4.
1- Scheduled backups or data synchronization between different systems.
2-Regular system maintenance tasks like log rotation or database cleanup.
3-Periodic data aggregation or reporting tasks.
4-Automated scaling of resources based on time-specific requirements

Q5
1- Creational Patterns: These patterns provide ways to create objects while hiding the creation logic, creating a separation of concerns. Examples of creational patterns include the Singleton pattern, Factory pattern, and Constructor pattern.

2- Structural Patterns: Structural design patterns deal with how objects are composed to form larger structures. Examples in Node.js include the Module pattern, Decorator pattern, and Facade pattern.

3- Behavioral Patterns: Behavioral design patterns focus on how objects communicate and interact with each other. In Node.js, examples include the Observer pattern, Pub/Sub pattern, and Promises pattern.

@belalninja
Copy link

belalninja commented Feb 1, 2024

Room 1: Yassin, Mohammad smadi, Musab, Belal

1. What is Redis? Mention one use case of Redis.

2. What type of database is Redis and where does it hold its data?


Redis is an open-source in-memory data store that works really well as a cache or message broker, It offers excellent performance, with the ability to quickly read and write data to memory.
An in-memory database is a type of database that stores data entirely in main memory (RAM) rather than on disk.
image
It can be used in cases where Real-time analytics are required, or in social media cases for ad personalisation.

3. What is WebSocket and what is it used for?


Websocket API is a realtime technology that's used to open a two-way interactive communication session between the user's browser and a server. it's like a constantly opened tunnel between two parties that can be used to pass data back and forth until one of the parties terminates the connection
image

4. Explain 3 use cases for CRON jobs.


  1. Data backup: we can set a scheduled task to backup specific data from a database every set time.
  2. Server status: it can be used to check the status of the server constantly
  3. Sending automated reports: Generating and sending reports on a scheduled basis.

5. What are the 3 types of design patterns in Nodejs?


  1. Creational Design Pattern
  2. Structural Design Pattern
  3. Behavioral Design Pattern

@ramah-madi
Copy link

ramah-madi commented Feb 1, 2024

Najwan Shawareb, Abdullah Alawad, Ramah Madi

Q1. Redis is an open-source (BSD licensed), in-memory data structure store used as a database, cache, message broker, and streaming engine.
Redis can be used to store metadata about users' profiles and viewing histories, authentication information/tokens for millions of users, and manifest files to enable CDNs to stream videos to millions of mobile and desktop users at a time.

Q2. Open-source (BSD licensed), in-memory data structure store.

Q3. WebSockets are a protocol for bi-directional, real-time communication between a client and a server over a single, long-lived connection. Unlike traditional HTTP requests, which are unidirectional and require a new connection for each request, WebSockets allow for continuous communication between the client and server.

Q4. Scheduled backups or data synchronization between different systems.
Regular system maintenance tasks like log rotation or database cleanup.
Periodic data aggregation or reporting tasks.

Q5. 1. the Factory pattern.
2. the Revealing Constructor pattern, the Builder pattern.
3. the Builder pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment