Needs advice
on
DockerDockerNode.jsNode.js
and
ReactReact

Hello everyone, I want a solution for an app that I want to build and scale but I'm unable to design this app(not familiar with the technologies required to do it).

Basically when the user starts a session then he should have his own isolated instance where the output of this isolated instance is redirected to front end application. I'm aware using VMs and containers for this job and I feel using VMs would be overkill since they are heavy and container could do this job better. After a limited time let's say 30min all the containers associated with the user shall be deleted and based on the demand of the users new containers should be created.

This is what I felt I should do. Should this application require knowledge of Kubernetes or Docker is enough? or is my approach itself wrong to tackle this problem? do let me know. and yes I'm relatively new to programming (2-3 years ) and it would be greatly appreciated if the answer is in layman's terms!

READ LESS
7 upvotes·25.3K views
Replies (2)

To achieve your goal of providing isolated instances for each user session and automatically deleting them after a limited time, you're on the right track with the idea of using containers. Containers are lightweight, isolated environments that can run applications and services.

Docker is a popular containerization platform that allows you to create and manage containers easily. It provides a way to package your application, its dependencies, and configurations into a container image. You can then run multiple instances of this image as separate containers.

Using Docker, you can create a container for each user session. Each container will have its own isolated environment where the application runs. The output of the container can be redirected to your front-end application.

Regarding the limited time requirement, you can set a timer or utilize a scheduling mechanism to automatically delete containers after 30 minutes. This ensures that the resources are freed up and available for new users.

Now, when it comes to managing a large number of containers and scaling them based on demand, Kubernetes is a popular orchestration platform. Kubernetes helps automate the deployment, scaling, and management of containers across multiple hosts.

While Docker alone can handle the basic requirements of your app, as you scale and manage a significant number of containers, Kubernetes becomes beneficial. It simplifies the management of container clusters, ensures high availability, and provides features like auto-scaling based on demand.

To summarize, Docker is sufficient to create and manage containers for each user session, but as your app scales, Kubernetes can help with effective container orchestration and management.

Remember, as a relatively new programmer, it's always good to start small and gradually learn and adopt more complex technologies like Docker and Kubernetes as your app evolves and your needs grow.

Define App Requirements: Clearly outline the requirements and functionalities of your app, including user authentication, session management, isolated instances, and the specific features users can interact with.

Design the GUI: Create wireframes or mockups of your app's graphical user interface. Decide on the layout, components, and visual elements that will be part of the user interface. Consider using design tools or frameworks that simplify GUI development.

Choose a Technology Stack: Identify the technologies you'll use to build your app. Since you're already considering Docker and Kubernetes, ensure you have a good understanding of these technologies. For the front-end GUI, you can choose frameworks like React, Angular, or Vue.js.

Implement Front-end: Start building the front-end of your application using your chosen framework. Focus on creating the GUI components, user interactions, and integrating with the back-end APIs or services.

Containerize the App: Once the front-end is ready, containerize your application using Docker. Create a Dockerfile that specifies the dependencies, configuration, and instructions to build your app's container image.

Deploy Containers: Set up a container orchestration platform like Kubernetes. Deploy your containerized app to the Kubernetes cluster, which will handle the management, scaling, and high availability of your containers.

Implement Session Management: Develop the logic for user session management. This involves handling user authentication, generating unique session identifiers, and associating each session with a separate container instance.

Configure Time-based Deletion: Implement a mechanism to track and delete containers after the specified time limit (e.g., 30 minutes). This can be achieved through a combination of timers, background processes, or Kubernetes job configurations.

Test and Iterate: Thoroughly test your application to ensure proper GUI functionality, session management, and container lifecycle. Collect feedback, iterate on the design, and make necessary improvements based on user testing and experience.

Monitor and Scale: Implement monitoring and logging to track the health and performance of your app. As your user base grows, monitor the demand and scale your container instances accordingly using Kubernetes auto-scaling features.

READ MORE
5 upvotes·21.2K views
IT-Architect at GFT Technologies SE·

I am not sure what you a trying to achieve here. Why isn't a normal web session enough? Why does every user need their own container? Even with containers (instead of VMs) this would not scale well. If you need workers running in the background and doing some longer running stuff, I would try to use services.

READ MORE
5 upvotes·21K views
Avatar of 114 Sunil