Skip to contentমূল লেখায় যান

Topic 14 · DevOps & Cloudটপিক 14 · DevOps & Cloud

Cloud Concepts

This page is about what cloud computing is, how Amazon Web Services (AWS) splits the work between itself and you, what AWS says about testing in the cloud, and the twelve-factor app, with a practice run of a tiny app on your own machine. It comes before the four AWS pages, which start with AWS Compute and Storage.

23 min read23 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 27 sources27টি সোর্স · updated Nov 2026আপডেট: Nov 2026

What it is

Cloud computing. Cloud computing is the on-demand delivery of IT resources over the Internet with pay-as-you-go pricing Source 1সোর্স 1. Instead of buying, owning, and maintaining physical data centers and servers, you can access services such as computing power, storage, and databases on an as-needed basis from a cloud provider like Amazon Web Services (AWS) Source 1সোর্স 1.

NIST describes cloud computing as a model for on-demand network access to a shared pool of configurable computing resources Source 3সোর্স 3. The resources can be rapidly provisioned and released with minimal management effort or service provider interaction Source 3সোর্স 3. The model has five essential characteristics, three service models, and four deployment models Source 3সোর্স 3.

The three service types. The three main types of cloud computing are Infrastructure as a Service, Platform as a Service, and Software as a Service Source 1সোর্স 1. AWS notes that definitions vary from company to company Source 2সোর্স 2.

TypeWhat the provider gives you
IaaS (Infrastructure as a Service)The basic building blocks for cloud IT: typically networking features, computers (virtual or on dedicated hardware), and data storage space Source 2সোর্স 2
PaaS (Platform as a Service)It removes the need to manage the underlying infrastructure (usually hardware and operating systems), so that you can focus on the deployment and management of your applications Source 2সোর্স 2
SaaS (Software as a Service)Software applications that are run and managed by the vendor; web-based email is a common example Source 2সোর্স 2

Where the app runs. A cloud-based application is fully deployed in the cloud, and all parts of it run there Source 2সোর্স 2. A hybrid deployment connects cloud-based resources with existing resources that are not in the cloud Source 2সোর্স 2. The most common hybrid method connects the cloud with existing on-premises infrastructure Source 2সোর্স 2.

Why teams use it. AWS names four benefits Source 1সোর্স 1:

  • Agility. You can quickly spin up resources as you need them Source 1সোর্স 1.
  • Elasticity. You can access as much or as little capacity as you need, and scale up and down as required with only a few minutes' notice Source 4সোর্স 4.
  • Cost savings. The cloud allows you to trade fixed expenses (such as data centers and physical servers) for variable expenses, and to pay for IT only as you consume it Source 1সোর্স 1.
  • Deploy globally in minutes. With the cloud, you can expand to new geographic regions and deploy globally in minutes Source 1সোর্স 1.

Regions and Availability Zones. AWS has the concept of a Region: a physical location around the world where AWS clusters data centers Source 5সোর্স 5. Each group of logical data centers is an Availability Zone (AZ) Source 5সোর্স 5. Each AWS Region consists of a minimum of three isolated and physically separate AZs within a geographic area Source 5সোর্স 5. An AZ is one or more discrete data centers with redundant power, networking, and connectivity in an AWS Region Source 5সোর্স 5. AZs let customers run production applications and databases that are more highly available, fault tolerant, and scalable than would be possible from a single data center Source 5সোর্স 5.

Shared responsibility. Building and operating workloads in the cloud is a shared responsibility between AWS and you Source 6সোর্স 6. AWS operates, manages, and controls the components from the host operating system and virtualization layer down to the physical security of the facilities in which the services run Source 6সোর্স 6. You assume responsibility for the guest operating system (including updates and security patches), other associated application software, and the configuration of the AWS-provided resources you use Source 6সোর্স 6. This split is commonly called responsibility of the cloud versus in the cloud Source 6সোর্স 6.

The twelve-factor app. The twelve-factor app is a methodology for building software-as-a-service apps Source 15সোর্স 15 that:

The methodology can be applied to apps written in any programming language, and which use any combination of backing services Source 15সোর্স 15.

The Well-Architected pillars. The AWS Well-Architected Framework names six pillars: operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability Source 8সোর্স 8. The reliability pillar is about making a workload perform its intended function correctly and consistently, and recover from failures with minimal impact Source 8সোর্স 8. Each pillar is organized into capabilities, or groupings of related best practices that share a common objective Source 8সোর্স 8.

সহজ English

Cloud computing. With cloud computing, you get IT resources over the Internet when you need them. You pay as you go Source 1সোর্স 1. You do not have to buy, own, and look after physical data centers and servers. You can use services such as computing power, storage, and databases as you need them, from a cloud provider like Amazon Web Services (AWS) Source 1সোর্স 1.

NIST says that cloud computing is a model for getting network access, on demand, to a shared pool of computing resources that can be configured Source 3সোর্স 3. The resources can be provided and released quickly, with very little management work or contact with the provider Source 3সোর্স 3. The model has five essential characteristics, three service models, and four deployment models Source 3সোর্স 3.

The three service types. The three main types of cloud computing are Infrastructure as a Service, Platform as a Service, and Software as a Service Source 1সোর্স 1. AWS notes that the definitions differ from company to company Source 2সোর্স 2.

TypeWhat the provider gives you
IaaS (Infrastructure as a Service)The basic building blocks for cloud IT. You typically get networking features, computers (virtual or on dedicated hardware), and space to store data Source 2সোর্স 2
PaaS (Platform as a Service)You do not have to manage the underlying infrastructure (usually hardware and operating systems). You can focus on deploying and managing your applications Source 2সোর্স 2
SaaS (Software as a Service)Software applications that the vendor runs and manages. Web-based email is a common example Source 2সোর্স 2

Where the app runs. A cloud-based application is fully in the cloud, and all of its parts run there Source 2সোর্স 2. A hybrid deployment links cloud resources with existing resources that are not in the cloud Source 2সোর্স 2. The most common kind links the cloud with existing on-premises infrastructure Source 2সোর্স 2.

Why teams use it. AWS names four benefits Source 1সোর্স 1:

  • Agility. You can quickly start up the resources that you need Source 1সোর্স 1.
  • Elasticity. You can get as much or as little capacity as you need. You can scale up and down as required, with only a few minutes' notice Source 4সোর্স 4.
  • Cost savings. You can trade fixed expenses (such as data centers and physical servers) for variable expenses. You pay for IT only as you use it Source 1সোর্স 1.
  • Deploy globally in minutes. You can expand to new geographic regions and deploy around the world in minutes Source 1সোর্স 1.

Regions and Availability Zones. AWS has Regions. A Region is a physical place in the world where AWS groups its data centers Source 5সোর্স 5. Each group of logical data centers is called an Availability Zone (AZ) Source 5সোর্স 5. Each AWS Region has at least three AZs. They are isolated and physically separate, within one geographic area Source 5সোর্স 5. An AZ is one or more discrete data centers in a Region, with redundant power, networking, and connectivity Source 5সোর্স 5. With AZs, customers can run production applications and databases that are more highly available, fault tolerant, and scalable than would be possible from a single data center Source 5সোর্স 5.

Shared responsibility. Building and running workloads in the cloud is a shared responsibility between AWS and you Source 6সোর্স 6. AWS operates, manages, and controls the parts from the host operating system and the virtualization layer down to the physical security of the facilities where the services run Source 6সোর্স 6. You are responsible for the guest operating system (including updates and security patches), other related application software, and the configuration of the AWS-provided resources you use Source 6সোর্স 6. This split is commonly called responsibility of the cloud versus in the cloud Source 6সোর্স 6.

The twelve-factor app. The twelve-factor app is a method for building software-as-a-service apps Source 15সোর্স 15. Such an app:

You can use the method for apps written in any programming language, with any combination of backing services Source 15সোর্স 15.

The Well-Architected pillars. The AWS Well-Architected Framework names six pillars: operational excellence, security, reliability, performance efficiency, cost optimization, and sustainability Source 8সোর্স 8. The reliability pillar is about making a workload do its intended job correctly and consistently, and recover from failures with minimal impact Source 8সোর্স 8. Each pillar is split into capabilities. A capability is a group of related best practices that share a common objective Source 8সোর্স 8.

বাংলা ব্যাখ্যা

Cloud computing। cloud computing-এ আপনি প্রয়োজনের সময় ইন্টারনেটের মাধ্যমে IT resource পান। আপনি pay-as-you-go পদ্ধতিতে দাম দেন Source 1সোর্স 1। physical data center আর server কেনা, নিজের মালিকানায় রাখা ও রক্ষণাবেক্ষণ করার দরকার নেই। computing power, storage আর database-এর মতো service আপনি প্রয়োজন মতো পান, Amazon Web Services (AWS)-এর মতো একটা cloud provider থেকে Source 1সোর্স 1।

NIST বলে, cloud computing হলো একটা model, যাতে configure করা যায় এমন computing resource-এর একটা shared pool-এ আপনি চাহিদা অনুযায়ী network দিয়ে প্রবেশাধিকার পান Source 3সোর্স 3। resource দ্রুত চালু আর ছেড়ে দেওয়া যায়, খুব কম management-এর কাজে বা provider-এর সঙ্গে যোগাযোগে Source 3সোর্স 3। এই model-এ পাঁচটা essential characteristic, তিনটা service model আর চারটা deployment model আছে Source 3সোর্স 3।

তিন ধরনের service। cloud computing-এর তিনটা main type হলো Infrastructure as a Service, Platform as a Service আর Software as a Service Source 1সোর্স 1। AWS বলে, সংজ্ঞা এক company থেকে আরেক company-তে আলাদা হয় Source 2সোর্স 2।

ধরনprovider আপনাকে কী দেয়
IaaS (Infrastructure as a Service)cloud IT-এর মৌলিক building block। সাধারণত networking feature, computer (virtual বা dedicated hardware) আর data রাখার জায়গা পাওয়া যায় Source 2সোর্স 2
PaaS (Platform as a Service)নিচের infrastructure (সাধারণত hardware আর operating system) আপনাকে চালাতে হয় না। আপনি app deploy আর পরিচালনায় মন দিতে পারেন Source 2সোর্স 2
SaaS (Software as a Service)software application, যা vendor চালায় ও পরিচালনা করে। web-based email একটা সাধারণ উদাহরণ Source 2সোর্স 2

app কোথায় চলে। cloud-based application পুরোপুরি cloud-এ deploy করা হয়, আর তার সব অংশ cloud-এ চলে Source 2সোর্স 2। hybrid deployment cloud-এর resource-কে এমন বিদ্যমান resource-এর সঙ্গে যুক্ত করে, যা cloud-এ নেই Source 2সোর্স 2। সবচেয়ে প্রচলিত hybrid পদ্ধতিতে cloud যুক্ত হয় বিদ্যমান on-premises infrastructure-এর সঙ্গে Source 2সোর্স 2।

কেন দলগুলো এটা ব্যবহার করে। AWS চারটা সুবিধার নাম বলে Source 1সোর্স 1:

  • Agility। আপনার দরকারি resource আপনি দ্রুত চালু করতে পারেন Source 1সোর্স 1।
  • Elasticity। আপনার যতটা capacity দরকার, ততটাই পান, কম হোক বা বেশি। প্রয়োজন মতো scale up আর scale down করা যায়, মাত্র কয়েক minute-এর নোটিশে Source 4সোর্স 4।
  • Cost savings। স্থির খরচ (যেমন data center আর physical server) বদলে পরিবর্তনশীল খরচ নেওয়া যায়। আপনি IT-র জন্য শুধু যতটা ব্যবহার করেন, ততটার দাম দেন Source 1সোর্স 1।
  • Deploy globally in minutes। আপনি নতুন geographic region-এ ছড়িয়ে পড়তে আর কয়েক minute-এ সারা বিশ্বে deploy করতে পারেন Source 1সোর্স 1।

Region আর Availability Zone। AWS-এ Region নামে একটা ধারণা আছে। Region হলো পৃথিবীর একটা physical জায়গা, যেখানে AWS তার data center জড়ো করে Source 5সোর্স 5। logical data center-এর প্রতিটা দলকে বলে Availability Zone (AZ) Source 5সোর্স 5। প্রতিটা AWS Region-এ অন্তত তিনটা AZ থাকে। সেগুলো একটা geographic এলাকার মধ্যে আলাদা ও physically পৃথক Source 5সোর্স 5। একটা AZ হলো একটা Region-এর এক বা একাধিক আলাদা data center, যাতে redundant power, networking আর connectivity আছে Source 5সোর্স 5। AZ থাকলে customer এমন production application ও database চালাতে পারে, যা একটামাত্র data center থেকে সম্ভব হতো না, এত বেশি highly available, fault tolerant আর scalable Source 5সোর্স 5।

ভাগ করা দায়িত্ব। cloud-এ workload তৈরি ও চালানো AWS আর আপনার মধ্যে ভাগ করা দায়িত্ব Source 6সোর্স 6। AWS host operating system আর virtualization layer থেকে শুরু করে service যে facility-তে চলে তার physical নিরাপত্তা পর্যন্ত সব অংশ চালায়, পরিচালনা করে ও নিয়ন্ত্রণ করে Source 6সোর্স 6। guest operating system (update আর security patch-সহ), অন্য সংশ্লিষ্ট application software, আর আপনার ব্যবহার করা AWS-এর দেওয়া resource-এর configuration-এর দায়িত্ব আপনার Source 6সোর্স 6। এই ভাগকে সাধারণত বলা হয় responsibility of the cloud versus in the cloud Source 6সোর্স 6।

twelve-factor app। twelve-factor app হলো software-as-a-service app বানানোর একটা পদ্ধতি Source 15সোর্স 15। এমন app:

  • setup automate করতে declarative format ব্যবহার করে, যাতে প্রজেক্টে নতুন developer-দের জন্য সময় ও খরচ কম লাগে Source 15সোর্স 15;
  • underlying operating system-এর সঙ্গে একটা পরিষ্কার contract রাখে, তাই এক execution environment থেকে আরেকটায় সহজে নেওয়া যায় Source 15সোর্স 15;
  • আধুনিক cloud platform-এ deploy করার উপযোগী, তাই server আর systems administration লাগে না Source 15সোর্স 15;
  • development আর production-কে আলাদা হয়ে যেতে দেয় না, যাতে continuous deployment সম্ভব হয় Source 15সোর্স 15;
  • এবং tooling, architecture বা development practice-এ বড় বদল ছাড়াই scale up করতে পারে Source 15সোর্স 15।

এই পদ্ধতি যেকোনো programming language-এ লেখা app-এর জন্য, আর backing service-এর যেকোনো সমন্বয়ের সঙ্গে ব্যবহার করা যায় Source 15সোর্স 15।

Well-Architected-এর pillar। AWS Well-Architected Framework ছয়টা pillar-এর নাম বলে: operational excellence, security, reliability, performance efficiency, cost optimization আর sustainability Source 8সোর্স 8। reliability pillar-এর কাজ হলো একটা workload যেন তার উদ্দিষ্ট কাজ সঠিকভাবে ও ধারাবাহিকভাবে করে, আর ব্যর্থতা থেকে ন্যূনতম প্রভাবে সেরে ওঠে Source 8সোর্স 8। প্রতিটা pillar capability-তে ভাগ করা। capability হলো সম্পর্কিত best practice-এর একটা দল, যাদের একটা অভিন্ন লক্ষ্য আছে Source 8সোর্স 8।

How it works

How the pieces sit. The diagram is the tutorial's own sketch, not an AWS drawing:

AWS Cloud
└── Region                    a physical location
    ├── Availability Zone A   one or more discrete data centers
    ├── Availability Zone B   (each AZ has its own power, cooling,
    └── Availability Zone C    and physical security)

Each AZ has independent power, cooling, and physical security and is connected via redundant, ultra-low-latency networks Source 5সোর্স 5. All AZs in an AWS Region are interconnected with high-bandwidth, low-latency networking Source 5সোর্স 5. All traffic between AZs is encrypted Source 5সোর্স 5.

What each side does. AWS is responsible for protecting and operating the infrastructure that runs all of the services offered in the AWS Cloud Source 6সোর্স 6. That infrastructure is composed of the hardware, software, networking, and facilities that run AWS Cloud services Source 6সোর্স 6. The tutorial's own sketch of the two sides:

you (in the cloud)    the guest operating system and its updates and patches,
                      your application software, the configuration of the
                      AWS-provided resources that you use
-------------------------------------------------------------------------------
AWS (of the cloud)    the host operating system, the virtualization layer,
                      and the hardware, software, networking, and facilities

Your side depends on the services that you choose Source 6সোর্স 6. Amazon EC2 is categorized as Infrastructure as a Service, and so it requires the customer to perform all of the necessary security configuration and management tasks Source 7সোর্স 7. Customers who deploy an EC2 instance are responsible for the guest operating system (including updates and security patches), any application software or utilities that they install on the instance, and the configuration of the AWS-provided firewall, called a security group, on each instance Source 7সোর্স 7.

Some controls are shared. For patch management, AWS patches and fixes flaws within the infrastructure, and customers patch their guest OS and applications Source 7সোর্স 7. For configuration management, AWS maintains the configuration of its infrastructure devices, and a customer configures their own guest operating systems, databases, and applications Source 7সোর্স 7. Customer responsibility varies with the AWS services and Regions that a customer chooses, the integration of those services into their IT environment, and the laws and regulations that apply Source 7সোর্স 7.

The twelve factors. The home page of the methodology lists them. Each factor has its own page. The table gives the rule, and one sentence from the factor's page.

FactorThe ruleOne sentence from its page
I. CodebaseOne codebase tracked in revision control, many deploys Source 15সোর্স 15There is only one codebase per app, but there will be many deploys of the app Source 16সোর্স 16
II. DependenciesExplicitly declare and isolate dependencies Source 15সোর্স 15A twelve-factor app never relies on implicit existence of system-wide packages Source 17সোর্স 17
III. ConfigStore config in the environment Source 15সোর্স 15The twelve-factor app stores config in environment variables Source 18সোর্স 18
IV. Backing servicesTreat backing services as attached resources Source 15সোর্স 15A backing service is any service the app consumes over the network as part of its normal operation Source 19সোর্স 19
V. Build, release, runStrictly separate build and run stages Source 15সোর্স 15The twelve-factor app uses strict separation between the build, release, and run stages Source 20সোর্স 20
VI. ProcessesExecute the app as one or more stateless processes Source 15সোর্স 15Twelve-factor processes are stateless and share-nothing Source 21সোর্স 21
VII. Port bindingExport services via port binding Source 15সোর্স 15The web app exports HTTP as a service by binding to a port, and listening to requests coming in on that port Source 22সোর্স 22
VIII. ConcurrencyScale out via the process model Source 15সোর্স 15Adding more concurrency is a simple and reliable operation Source 23সোর্স 23
IX. DisposabilityMaximize robustness with fast startup and graceful shutdown Source 15সোর্স 15The processes are disposable, meaning they can be started or stopped at a moment's notice Source 24সোর্স 24
X. Dev/prod parityKeep development, staging, and production as similar as possible Source 15সোর্স 15The app is designed for continuous deployment by keeping the gap between development and production small Source 25সোর্স 25
XI. LogsTreat logs as event streams Source 15সোর্স 15Each running process writes its event stream, unbuffered, to stdout Source 26সোর্স 26
XII. Admin processesRun admin/management tasks as one-off processes Source 15সোর্স 15One-off admin processes should be run in an identical environment as the regular long-running processes of the app Source 27সোর্স 27

From code to a running deploy. A codebase is transformed into a deploy through three stages Source 20সোর্স 20:

codebase --build--> build --(+ config)--> release (unique ID) --run--> processes

Every release should always have a unique release ID Source 20সোর্স 20. A release cannot be mutated once it is created, and any change must create a new release Source 20সোর্স 20.

Processes and scaling. The twelve-factor app is executed as one or more processes Source 21সোর্স 21. Any data that needs to persist must be stored in a stateful backing service, typically a database Source 21সোর্স 21. The app never assumes that anything cached in memory or on disk will be available on a future request or job Source 21সোর্স 21. To handle different workloads, each type of work gets a process type: HTTP requests may be handled by a web process, and long-running background tasks by a worker process Source 23সোর্স 23.

Starting and stopping. Processes should strive to minimize startup time Source 24সোর্স 24. Processes shut down gracefully when they receive a SIGTERM signal from the process manager Source 24সোর্স 24. For a web process, graceful shutdown is achieved by ceasing to listen on the service port, allowing any current requests to finish, and then exiting Source 24সোর্স 24. A twelve-factor app is architected to handle unexpected, non-graceful terminations Source 24সোর্স 24.

Config and logs. An app's config is everything that is likely to vary between deploys (staging, production, developer environments, etc) Source 18সোর্স 18. Env vars are easy to change between deploys without changing any code Source 18সোর্স 18. Logs are the stream of aggregated, time-ordered events collected from the output streams of all running processes and backing services Source 26সোর্স 26. A twelve-factor app never concerns itself with routing or storage of its output stream Source 26সোর্স 26. In staging or production, the execution environment captures the stream of each process and routes it to one or more final destinations Source 26সোর্স 26.

সহজ English

How the pieces sit. The diagram is the tutorial's own sketch, not an AWS drawing:

AWS Cloud
└── Region                    a physical location
    ├── Availability Zone A   one or more discrete data centers
    ├── Availability Zone B   (each AZ has its own power, cooling,
    └── Availability Zone C    and physical security)

Each AZ has independent power, cooling, and physical security. It is connected by redundant, ultra-low-latency networks Source 5সোর্স 5. All AZs in an AWS Region are interconnected with high-bandwidth, low-latency networking Source 5সোর্স 5. All traffic between AZs is encrypted Source 5সোর্স 5.

What each side does. AWS is responsible for protecting and operating the infrastructure that runs all of the services in the AWS Cloud Source 6সোর্স 6. That infrastructure is made of the hardware, software, networking, and facilities that run AWS Cloud services Source 6সোর্স 6. The tutorial's own sketch of the two sides:

you (in the cloud)    the guest operating system and its updates and patches,
                      your application software, the configuration of the
                      AWS-provided resources that you use
-------------------------------------------------------------------------------
AWS (of the cloud)    the host operating system, the virtualization layer,
                      and the hardware, software, networking, and facilities

Your side depends on the services that you choose Source 6সোর্স 6. Amazon EC2 is Infrastructure as a Service, and so the customer has to do all of the necessary security configuration and management tasks Source 7সোর্স 7. Customers who deploy an EC2 instance are responsible for the guest operating system (including updates and security patches), any application software or utilities that they install on the instance, and the configuration of the AWS-provided firewall, called a security group, on each instance Source 7সোর্স 7.

Some controls are shared. For patch management, AWS patches and fixes flaws within the infrastructure, and customers patch their guest OS and applications Source 7সোর্স 7. For configuration management, AWS maintains the configuration of its infrastructure devices, and a customer configures their own guest operating systems, databases, and applications Source 7সোর্স 7. Customer responsibility varies with the AWS services and Regions that a customer chooses, how those services fit into their IT environment, and the laws and regulations that apply Source 7সোর্স 7.

The twelve factors. The home page of the method lists them. Each factor has its own page. The table gives the rule, and one sentence from the factor's page.

FactorThe ruleOne sentence from its page
I. CodebaseOne codebase tracked in revision control, many deploys Source 15সোর্স 15There is only one codebase per app, but there will be many deploys of the app Source 16সোর্স 16
II. DependenciesExplicitly declare and isolate dependencies Source 15সোর্স 15A twelve-factor app never relies on system-wide packages that happen to exist Source 17সোর্স 17
III. ConfigStore config in the environment Source 15সোর্স 15The twelve-factor app stores config in environment variables Source 18সোর্স 18
IV. Backing servicesTreat backing services as attached resources Source 15সোর্স 15A backing service is any service that the app uses over the network as part of its normal operation Source 19সোর্স 19
V. Build, release, runStrictly separate build and run stages Source 15সোর্স 15The app keeps the build, release, and run stages strictly separate Source 20সোর্স 20
VI. ProcessesExecute the app as one or more stateless processes Source 15সোর্স 15The processes are stateless and share-nothing Source 21সোর্স 21
VII. Port bindingExport services via port binding Source 15সোর্স 15The web app offers HTTP as a service by binding to a port, and listening for requests that come in on that port Source 22সোর্স 22
VIII. ConcurrencyScale out via the process model Source 15সোর্স 15Adding more concurrency is a simple and reliable operation Source 23সোর্স 23
IX. DisposabilityMaximize robustness with fast startup and graceful shutdown Source 15সোর্স 15The processes are disposable: they can be started or stopped at a moment's notice Source 24সোর্স 24
X. Dev/prod parityKeep development, staging, and production as similar as possible Source 15সোর্স 15The app is designed for continuous deployment, because the gap between development and production is kept small Source 25সোর্স 25
XI. LogsTreat logs as event streams Source 15সোর্স 15Each running process writes its event stream, unbuffered, to stdout Source 26সোর্স 26
XII. Admin processesRun admin/management tasks as one-off processes Source 15সোর্স 15One-off admin processes should run in an environment identical to the one of the regular long-running processes Source 27সোর্স 27

From code to a running deploy. A codebase becomes a deploy through three stages Source 20সোর্স 20:

codebase --build--> build --(+ config)--> release (unique ID) --run--> processes

Every release should always have a unique release ID Source 20সোর্স 20. A release cannot be changed once it is created, and any change must create a new release Source 20সোর্স 20.

Processes and scaling. The twelve-factor app runs as one or more processes Source 21সোর্স 21. Any data that needs to persist must be stored in a stateful backing service, typically a database Source 21সোর্স 21. The app never assumes that anything kept in memory or on disk will still be there for a future request or job Source 21সোর্স 21. For different workloads, each type of work gets its own process type. A web process may handle HTTP requests, and a worker process may handle long-running background tasks Source 23সোর্স 23.

Starting and stopping. Processes should try to keep their startup time short Source 24সোর্স 24. Processes shut down gracefully when they get a SIGTERM signal from the process manager Source 24সোর্স 24. A web process does this by ceasing to listen on the service port, letting any current requests finish, and then exiting Source 24সোর্স 24. A twelve-factor app is designed to handle unexpected, non-graceful terminations too Source 24সোর্স 24.

Config and logs. An app's config is everything that is likely to differ between deploys (staging, production, developer environments, etc) Source 18সোর্স 18. Env vars are easy to change between deploys without changing any code Source 18সোর্স 18. Logs are the stream of events, in time order, collected from the output streams of all running processes and backing services Source 26সোর্স 26. A twelve-factor app never deals with the routing or storage of its output stream Source 26সোর্স 26. In staging or production, the execution environment captures the stream of each process and routes it to one or more final destinations Source 26সোর্স 26.

বাংলা ব্যাখ্যা

অংশগুলো কীভাবে বসে। নিচের diagram টিউটোরিয়ালের নিজের আঁকা নকশা, AWS-এর আঁকা ছবি নয়:

AWS Cloud
└── Region                    a physical location
    ├── Availability Zone A   one or more discrete data centers
    ├── Availability Zone B   (each AZ has its own power, cooling,
    └── Availability Zone C    and physical security)

প্রতিটা AZ-এর নিজস্ব power, cooling আর physical নিরাপত্তা আছে। সেটা redundant, ultra-low-latency network দিয়ে যুক্ত Source 5সোর্স 5। একটা AWS Region-এর সব AZ high-bandwidth, low-latency networking দিয়ে একে অপরের সঙ্গে যুক্ত Source 5সোর্স 5। AZ-গুলোর মধ্যে সব traffic encrypted Source 5সোর্স 5।

কোন পক্ষ কী করে। AWS cloud-এর সব service যে infrastructure-এ চলে তা রক্ষা ও পরিচালনার দায়িত্বে Source 6সোর্স 6। সেই infrastructure তৈরি AWS Cloud service চালানোর hardware, software, networking আর facility দিয়ে Source 6সোর্স 6। দুই পক্ষের টিউটোরিয়ালের নিজের আঁকা নকশা:

you (in the cloud)    the guest operating system and its updates and patches,
                      your application software, the configuration of the
                      AWS-provided resources that you use
-------------------------------------------------------------------------------
AWS (of the cloud)    the host operating system, the virtualization layer,
                      and the hardware, software, networking, and facilities

আপনার দিকের দায়িত্ব নির্ভর করে আপনি কোন service বেছে নেন তার ওপর Source 6সোর্স 6। Amazon EC2 হলো Infrastructure as a Service, তাই প্রয়োজনীয় সব security configuration আর management-এর কাজ customer-কেই করতে হয় Source 7সোর্স 7। যে customer একটা EC2 instance deploy করে, সে guest operating system (update আর security patch-সহ), instance-এ নিজে বসানো যেকোনো application software বা utility, আর প্রতিটা instance-এর AWS-এর দেওয়া firewall-এর (যার নাম security group) configuration-এর দায়িত্বে Source 7সোর্স 7।

কিছু control ভাগ করা। patch management-এ AWS infrastructure-এর ত্রুটি patch ও ঠিক করে, আর customer নিজের guest OS ও application patch করে Source 7সোর্স 7। configuration management-এ AWS নিজের infrastructure device-এর configuration রাখে, আর customer নিজের guest operating system, database ও application configure করে Source 7সোর্স 7। customer-এর দায়িত্ব বদলায় সে কোন AWS service ও Region বেছে নেয়, সেই service তার IT environment-এ কীভাবে মেশে, আর কোন আইন ও বিধি প্রযোজ্য, তার ওপর Source 7সোর্স 7।

বারোটা factor। পদ্ধতিটার home page সেগুলো তালিকাভুক্ত করে। প্রতিটা factor-এর নিজের page আছে। table-এ আছে নিয়মটা, আর factor-এর page থেকে একটা বাক্য।

Factorনিয়মতার page থেকে একটা বাক্য
I. CodebaseOne codebase tracked in revision control, many deploys Source 15সোর্স 15প্রতিটা app-এর একটাই codebase, কিন্তু app-এর অনেক deploy থাকবে Source 16সোর্স 16
II. DependenciesExplicitly declare and isolate dependencies Source 15সোর্স 15twelve-factor app system-wide package আছে বলে ধরে নেওয়ার ওপর কখনো ভরসা করে না Source 17সোর্স 17
III. ConfigStore config in the environment Source 15সোর্স 15twelve-factor app config রাখে environment variable-এ Source 18সোর্স 18
IV. Backing servicesTreat backing services as attached resources Source 15সোর্স 15backing service হলো এমন যেকোনো service, যা app তার স্বাভাবিক কাজের অংশ হিসেবে network দিয়ে ব্যবহার করে Source 19সোর্স 19
V. Build, release, runStrictly separate build and run stages Source 15সোর্স 15app build, release আর run stage কঠোরভাবে আলাদা রাখে Source 20সোর্স 20
VI. ProcessesExecute the app as one or more stateless processes Source 15সোর্স 15process-গুলো stateless আর share-nothing Source 21সোর্স 21
VII. Port bindingExport services via port binding Source 15সোর্স 15web app একটা port-এ bind করে আর সেই port-এ আসা request শোনে, এভাবে HTTP service হিসেবে দেয় Source 22সোর্স 22
VIII. ConcurrencyScale out via the process model Source 15সোর্স 15আরও concurrency যোগ করা একটা সহজ ও নির্ভরযোগ্য কাজ Source 23সোর্স 23
IX. DisposabilityMaximize robustness with fast startup and graceful shutdown Source 15সোর্স 15process-গুলো disposable: মুহূর্তের নোটিশে সেগুলো চালু বা বন্ধ করা যায় Source 24সোর্স 24
X. Dev/prod parityKeep development, staging, and production as similar as possible Source 15সোর্স 15app continuous deployment-এর জন্য তৈরি, কারণ development আর production-এর ফারাক ছোট রাখা হয় Source 25সোর্স 25
XI. LogsTreat logs as event streams Source 15সোর্স 15প্রতিটা চলমান process তার event stream, unbuffered, stdout-এ লেখে Source 26সোর্স 26
XII. Admin processesRun admin/management tasks as one-off processes Source 15সোর্স 15one-off admin process চালানো উচিত app-এর নিয়মিত দীর্ঘ-চলা process-এর মতো অভিন্ন environment-এ Source 27সোর্স 27

code থেকে চলমান deploy। একটা codebase তিনটা stage পেরিয়ে একটা deploy হয় Source 20সোর্স 20:

  • build stage একটা code repo-কে এমন executable bundle-এ বদলায়, যার নাম build Source 20সোর্স 20।
  • release stage build-কে deploy-এর বর্তমান config-এর সঙ্গে মেলায় Source 20সোর্স 20।
  • run stage app-কে execution environment-এ চালায়, বেছে নেওয়া একটা release-এর বিপরীতে app-এর কিছু process চালু করে Source 20সোর্স 20।
codebase --build--> build --(+ config)--> release (unique ID) --run--> processes

প্রতিটা release-এর সবসময় একটা অনন্য release ID থাকা উচিত Source 20সোর্স 20। একটা release তৈরি হওয়ার পর বদলানো যায় না, আর যেকোনো বদল একটা নতুন release তৈরি করতে হবে Source 20সোর্স 20।

Process আর scaling। twelve-factor app এক বা একাধিক process হিসেবে চলে Source 21সোর্স 21। যে data টিকিয়ে রাখা দরকার, তা একটা stateful backing service-এ রাখতে হবে, সাধারণত একটা database-এ Source 21সোর্স 21। app কখনো ধরে নেয় না যে memory বা disk-এ cache করা কিছু ভবিষ্যতের কোনো request বা job-এর জন্য থাকবে Source 21সোর্স 21। ভিন্ন ভিন্ন workload-এর জন্য প্রতিটা ধরনের কাজ পায় নিজের process type। web process HTTP request সামলাতে পারে, আর worker process দীর্ঘ-চলা background কাজ Source 23সোর্স 23।

চালু আর বন্ধ করা। process-এর উচিত startup time কম রাখার চেষ্টা করা Source 24সোর্স 24। process manager থেকে SIGTERM signal পেলে process gracefully বন্ধ হয় Source 24সোর্স 24। web process এটা করে service port-এ শোনা থামিয়ে, চলমান request-গুলো শেষ হতে দিয়ে, তারপর বেরিয়ে গিয়ে Source 24সোর্স 24। twelve-factor app অপ্রত্যাশিত, non-graceful বন্ধ হওয়াও সামলাতে তৈরি Source 24সোর্স 24।

Config আর log। একটা app-এর config হলো সেই সবকিছু, যা deploy-এর মধ্যে (staging, production, developer environment ইত্যাদি) বদলানোর সম্ভাবনা থাকে Source 18সোর্স 18। env var এক deploy থেকে আরেক deploy-এ কোনো code না বদলেই বদলানো সহজ Source 18সোর্স 18। log হলো সব চলমান process আর backing service-এর output stream থেকে জড়ো করা, সময় অনুযায়ী সাজানো event-এর স্রোত Source 26সোর্স 26। twelve-factor app নিজের output stream-এর routing বা storage নিয়ে কখনো মাথা ঘামায় না Source 26সোর্স 26। staging বা production-এ execution environment প্রতিটা process-এর stream ধরে আর এক বা একাধিক চূড়ান্ত গন্তব্যে পাঠায় Source 26সোর্স 26।

Try it

The tutorial ran these steps on 2026-11-18 on Linux, with Python 3.14.9, curl 8.18.0, and bash 5.3.9. The app and the shell commands (python3, curl, kill, wait, sleep) are the tutorial's own choice, not from a source. The steps need no cloud account. The output is from the tutorial's run.

1. Save the app. Save this file as app.py. It is the tutorial's own code, about 30 lines, and it uses only the standard library of Python:

# app.py: the tutorial's own tiny app (not from a source).
import os
import signal
from http.server import BaseHTTPRequestHandler, HTTPServer

PORT = int(os.environ.get("PORT", "8080"))
GREETING = os.environ.get("GREETING", "hello")
hits = 0  # lives in this process only
stopping = False


class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        global hits
        hits += 1
        body = f"{GREETING} #{hits}\n".encode()
        self.send_response(200)
        self.send_header("Content-Length", str(len(body)))
        self.end_headers()
        self.wfile.write(body)
        print(f"GET {self.path} -> 200, hits={hits}", flush=True)

    def log_message(self, *args):
        pass  # the app prints its own event lines


def stop(signum, frame):
    global stopping
    stopping = True


signal.signal(signal.SIGTERM, stop)
server = HTTPServer(("127.0.0.1", PORT), Handler)
server.timeout = 0.2
print(f"listening on 127.0.0.1:{PORT}, greeting={GREETING!r}", flush=True)
while not stopping:
    server.handle_request()
server.server_close()
print("SIGTERM received: stopped listening, exiting", flush=True)

The app shows five of the factors:

  • III. Config. It reads PORT and GREETING from environment variables. The twelve-factor app stores config in environment variables Source 18সোর্স 18.
  • VII. Port binding. It binds to a port and listens for requests. The web app exports HTTP as a service by binding to a port Source 22সোর্স 22.
  • VI. Processes. It keeps a counter in the memory of the process. Twelve-factor processes are stateless and share-nothing Source 21সোর্স 21.
  • XI. Logs. It prints one line for each event to stdout, unbuffered. Each running process writes its event stream, unbuffered, to stdout Source 26সোর্স 26.
  • IX. Disposability. It stops listening and exits when it gets SIGTERM. Processes shut down gracefully when they receive a SIGTERM signal from the process manager Source 24সোর্স 24.

2. Start one deploy, and call it. A deploy is a running instance of the app Source 16সোর্স 16. The first command starts a deploy in the background and sends its stream to a file. The next lines keep its process ID in A, wait a second for the app to start, and call it three times:

GREETING=hello PORT=8081 python3 app.py > deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hello #1
hello #2
hello #3

Each call raised the count, because the count lives in the process.

3. Start a second deploy with other config. Both deploys run the same codebase, and the codebase is the same across all deploys Source 16সোর্স 16. Only the config differs: the second deploy has another GREETING and another PORT. Then call the second deploy, and the first one again:

GREETING=hallo PORT=8082 python3 app.py > deploy-b.log &
B=$!
sleep 1
curl -s http://127.0.0.1:8082/
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hallo #1
hello #4

The second deploy started at #1, and the first one went on at #4. Each process has its own count. Twelve-factor processes are stateless and share-nothing Source 21সোর্স 21.

4. Stop the first deploy with SIGTERM. Processes shut down gracefully when they receive a SIGTERM signal from the process manager Source 24সোর্স 24. Here the tutorial plays the process manager: it sends the signal with kill -TERM and reads the exit status of the process with wait. The last command calls the stopped deploy:

kill -TERM $A
wait $A; echo "exit status: $?"
curl -s --max-time 2 http://127.0.0.1:8081/; echo "curl exit status: $?"

Output of the tutorial's run:

exit status: 0
curl exit status: 7

The app exited with status 0. The call to port 8081 then failed: curl exited with status 7 and printed nothing.

5. Start the first deploy again. The tutorial appended the stream to the same log file with >>:

GREETING=hello PORT=8081 python3 app.py >> deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hello #1

The count started again at #1. The old count was in the memory of the old process, and the new process did not have it. Any data that needs to persist must be stored in a stateful backing service, typically a database Source 21সোর্স 21.

6. Read the event streams. Each process writes its event stream, unbuffered, to stdout Source 26সোর্স 26. The tutorial sent stdout to files. The event stream can be routed to a file, or watched via realtime tail in a terminal Source 26সোর্স 26.

cat deploy-a.log
cat deploy-b.log

Output of the tutorial's run:

listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
GET / -> 200, hits=2
GET / -> 200, hits=3
GET / -> 200, hits=4
SIGTERM received: stopped listening, exiting
listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
listening on 127.0.0.1:8082, greeting='hallo'
GET / -> 200, hits=1

The file deploy-a.log shows the first start (listening and four GET lines), the stop (SIGTERM received), and the second start (listening and one GET line, with hits=1). The file deploy-b.log belongs to the second deploy.

7. Stop both deploys.

kill -TERM $A $B
wait

Both processes stopped. After the tutorial's run, nothing listened on ports 8081 and 8082. The two log files stay in your folder; delete them when you do not need them.

সহজ English

The tutorial ran these steps on 2026-11-18 on Linux, with Python 3.14.9, curl 8.18.0, and bash 5.3.9. The app and the shell commands (python3, curl, kill, wait, sleep) are the tutorial's own choice. No source gives them. You do not need a cloud account. The output is from the tutorial's run.

1. Save the app. Save this file as app.py. It is the tutorial's own code, about 30 lines, and it uses only the standard library of Python:

# app.py: the tutorial's own tiny app (not from a source).
import os
import signal
from http.server import BaseHTTPRequestHandler, HTTPServer

PORT = int(os.environ.get("PORT", "8080"))
GREETING = os.environ.get("GREETING", "hello")
hits = 0  # lives in this process only
stopping = False


class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        global hits
        hits += 1
        body = f"{GREETING} #{hits}\n".encode()
        self.send_response(200)
        self.send_header("Content-Length", str(len(body)))
        self.end_headers()
        self.wfile.write(body)
        print(f"GET {self.path} -> 200, hits={hits}", flush=True)

    def log_message(self, *args):
        pass  # the app prints its own event lines


def stop(signum, frame):
    global stopping
    stopping = True


signal.signal(signal.SIGTERM, stop)
server = HTTPServer(("127.0.0.1", PORT), Handler)
server.timeout = 0.2
print(f"listening on 127.0.0.1:{PORT}, greeting={GREETING!r}", flush=True)
while not stopping:
    server.handle_request()
server.server_close()
print("SIGTERM received: stopped listening, exiting", flush=True)

The app shows five of the factors:

  • III. Config. It reads PORT and GREETING from environment variables. The twelve-factor app stores config in environment variables Source 18সোর্স 18.
  • VII. Port binding. It binds to a port and listens for requests. The web app exports HTTP as a service by binding to a port Source 22সোর্স 22.
  • VI. Processes. It keeps a counter in the memory of the process. Twelve-factor processes are stateless and share-nothing Source 21সোর্স 21.
  • XI. Logs. It prints one line for each event to stdout, unbuffered. Each running process writes its event stream, unbuffered, to stdout Source 26সোর্স 26.
  • IX. Disposability. It stops listening and exits when it gets SIGTERM. Processes shut down gracefully when they get a SIGTERM signal from the process manager Source 24সোর্স 24.

2. Start one deploy, and call it. A deploy is a running instance of the app Source 16সোর্স 16. The first command starts a deploy in the background and sends its stream to a file. The next lines keep its process ID in A, wait a second for the app to start, and call it three times:

GREETING=hello PORT=8081 python3 app.py > deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hello #1
hello #2
hello #3

Each call raised the count, because the count lives in the process.

3. Start a second deploy with other config. Both deploys run the same codebase, and the codebase is the same across all deploys Source 16সোর্স 16. Only the config differs: the second deploy has another GREETING and another PORT. Then call the second deploy, and the first one again:

GREETING=hallo PORT=8082 python3 app.py > deploy-b.log &
B=$!
sleep 1
curl -s http://127.0.0.1:8082/
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hallo #1
hello #4

The second deploy started at #1, and the first one went on at #4. Each process has its own count. Twelve-factor processes are stateless and share-nothing Source 21সোর্স 21.

4. Stop the first deploy with SIGTERM. Processes shut down gracefully when they get a SIGTERM signal from the process manager Source 24সোর্স 24. Here the tutorial plays the process manager: it sends the signal with kill -TERM and reads the exit status of the process with wait. The last command calls the stopped deploy:

kill -TERM $A
wait $A; echo "exit status: $?"
curl -s --max-time 2 http://127.0.0.1:8081/; echo "curl exit status: $?"

Output of the tutorial's run:

exit status: 0
curl exit status: 7

The app exited with status 0. The call to port 8081 then failed: curl exited with status 7 and printed nothing.

5. Start the first deploy again. The tutorial appended the stream to the same log file with >>:

GREETING=hello PORT=8081 python3 app.py >> deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/

Output of the tutorial's run:

hello #1

The count started again at #1. The old count was in the memory of the old process, and the new process did not have it. Any data that needs to persist must be stored in a stateful backing service, typically a database Source 21সোর্স 21.

6. Read the event streams. Each process writes its event stream, unbuffered, to stdout Source 26সোর্স 26. The tutorial sent stdout to files. The event stream can be routed to a file, or watched via realtime tail in a terminal Source 26সোর্স 26.

cat deploy-a.log
cat deploy-b.log

Output of the tutorial's run:

listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
GET / -> 200, hits=2
GET / -> 200, hits=3
GET / -> 200, hits=4
SIGTERM received: stopped listening, exiting
listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
listening on 127.0.0.1:8082, greeting='hallo'
GET / -> 200, hits=1

The file deploy-a.log shows the first start (listening and four GET lines), the stop (SIGTERM received), and the second start (listening and one GET line, with hits=1). The file deploy-b.log belongs to the second deploy.

7. Stop both deploys.

kill -TERM $A $B
wait

Both processes stopped. After the tutorial's run, nothing listened on ports 8081 and 8082. The two log files stay in your folder; delete them when you do not need them.

বাংলা ব্যাখ্যা

টিউটোরিয়াল এই ধাপগুলো 2026-11-18 তারিখে Linux-এ চালিয়েছে, Python 3.14.9, curl 8.18.0 আর bash 5.3.9 দিয়ে। app আর shell command-গুলো (python3, curl, kill, wait, sleep) টিউটোরিয়ালের নিজের বেছে নেওয়া, কোনো source এগুলো দেয় না। কোনো cloud account লাগে না। output টিউটোরিয়ালের run থেকে নেওয়া।

1. app-টা save করুন। এই file-টা app.py নামে save করুন। এটা টিউটোরিয়ালের নিজের code, প্রায় ৩০ লাইনের, আর শুধু Python-এর standard library ব্যবহার করে:

# app.py: the tutorial's own tiny app (not from a source).
import os
import signal
from http.server import BaseHTTPRequestHandler, HTTPServer

PORT = int(os.environ.get("PORT", "8080"))
GREETING = os.environ.get("GREETING", "hello")
hits = 0  # lives in this process only
stopping = False


class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        global hits
        hits += 1
        body = f"{GREETING} #{hits}\n".encode()
        self.send_response(200)
        self.send_header("Content-Length", str(len(body)))
        self.end_headers()
        self.wfile.write(body)
        print(f"GET {self.path} -> 200, hits={hits}", flush=True)

    def log_message(self, *args):
        pass  # the app prints its own event lines


def stop(signum, frame):
    global stopping
    stopping = True


signal.signal(signal.SIGTERM, stop)
server = HTTPServer(("127.0.0.1", PORT), Handler)
server.timeout = 0.2
print(f"listening on 127.0.0.1:{PORT}, greeting={GREETING!r}", flush=True)
while not stopping:
    server.handle_request()
server.server_close()
print("SIGTERM received: stopped listening, exiting", flush=True)

app-টা পাঁচটা factor দেখায়:

  • III. Config। এটা PORT আর GREETING পড়ে environment variable থেকে। twelve-factor app config রাখে environment variable-এ Source 18সোর্স 18।
  • VII. Port binding। এটা একটা port-এ bind করে request শোনে। web app একটা port-এ bind করে HTTP service হিসেবে দেয় Source 22সোর্স 22।
  • VI. Processes। এটা process-এর memory-তে একটা counter রাখে। twelve-factor process stateless আর share-nothing Source 21সোর্স 21।
  • XI. Logs। এটা প্রতিটা event-এর জন্য stdout-এ একটা করে লাইন ছাপে, unbuffered। প্রতিটা চলমান process তার event stream, unbuffered, stdout-এ লেখে Source 26সোর্স 26।
  • IX. Disposability। SIGTERM পেলে এটা শোনা থামায় আর বেরিয়ে যায়। process manager থেকে SIGTERM signal পেলে process gracefully বন্ধ হয় Source 24সোর্স 24।

2. একটা deploy চালু করুন, আর তাকে call করুন। deploy হলো app-এর একটা চলমান instance Source 16সোর্স 16। প্রথম command একটা deploy background-এ চালু করে আর তার stream একটা file-এ পাঠায়। পরের লাইনগুলো তার process ID A-তে রাখে, app চালু হওয়ার জন্য এক সেকেন্ড অপেক্ষা করে, আর তাকে তিনবার call করে:

GREETING=hello PORT=8081 python3 app.py > deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/
curl -s http://127.0.0.1:8081/

টিউটোরিয়ালের run-এর output:

hello #1
hello #2
hello #3

প্রতিটা call count বাড়িয়েছে, কারণ count থাকে process-এর মধ্যে।

3. অন্য config দিয়ে দ্বিতীয় একটা deploy চালু করুন। দুই deploy-ই একই codebase চালায়, আর সব deploy-এ codebase একই Source 16সোর্স 16। শুধু config আলাদা: দ্বিতীয় deploy-এর GREETING আর PORT অন্য। তারপর দ্বিতীয় deploy-কে call করুন, আর আবার প্রথমটাকে:

GREETING=hallo PORT=8082 python3 app.py > deploy-b.log &
B=$!
sleep 1
curl -s http://127.0.0.1:8082/
curl -s http://127.0.0.1:8081/

টিউটোরিয়ালের run-এর output:

hallo #1
hello #4

দ্বিতীয় deploy শুরু হয়েছে #1 থেকে, আর প্রথমটা চলেছে #4-এ। প্রতিটা process-এর নিজের count আছে। twelve-factor process stateless আর share-nothing Source 21সোর্স 21।

4. SIGTERM দিয়ে প্রথম deploy বন্ধ করুন। process manager থেকে SIGTERM signal পেলে process gracefully বন্ধ হয় Source 24সোর্স 24। এখানে টিউটোরিয়াল নিজেই process manager সাজে: সে kill -TERM দিয়ে signal পাঠায় আর wait দিয়ে process-টার exit status পড়ে। শেষ command বন্ধ হয়ে যাওয়া deploy-কে call করে:

kill -TERM $A
wait $A; echo "exit status: $?"
curl -s --max-time 2 http://127.0.0.1:8081/; echo "curl exit status: $?"

টিউটোরিয়ালের run-এর output:

exit status: 0
curl exit status: 7

app status 0 দিয়ে বেরিয়েছে। তারপর port 8081-এ call ব্যর্থ হয়েছে: curl status 7 দিয়ে বেরিয়েছে আর কিছু ছাপেনি।

5. প্রথম deploy আবার চালু করুন। টিউটোরিয়াল >> দিয়ে stream-টা একই log file-এর শেষে যোগ করেছে:

GREETING=hello PORT=8081 python3 app.py >> deploy-a.log &
A=$!
sleep 1
curl -s http://127.0.0.1:8081/

টিউটোরিয়ালের run-এর output:

hello #1

count আবার #1 থেকে শুরু হয়েছে। পুরোনো count ছিল পুরোনো process-এর memory-তে, আর নতুন process-টার কাছে তা ছিল না। যে data টিকিয়ে রাখা দরকার, তা একটা stateful backing service-এ রাখতে হবে, সাধারণত একটা database-এ Source 21সোর্স 21।

6. event stream পড়ুন। প্রতিটা process তার event stream, unbuffered, stdout-এ লেখে Source 26সোর্স 26। টিউটোরিয়াল stdout file-এ পাঠিয়েছে। event stream একটা file-এ পাঠানো যায়, বা terminal-এ realtime tail দিয়ে দেখা যায় Source 26সোর্স 26:

cat deploy-a.log
cat deploy-b.log

টিউটোরিয়ালের run-এর output:

listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
GET / -> 200, hits=2
GET / -> 200, hits=3
GET / -> 200, hits=4
SIGTERM received: stopped listening, exiting
listening on 127.0.0.1:8081, greeting='hello'
GET / -> 200, hits=1
listening on 127.0.0.1:8082, greeting='hallo'
GET / -> 200, hits=1

deploy-a.log file-এ আছে প্রথম চালু হওয়া (listening আর চারটা GET লাইন), বন্ধ হওয়া (SIGTERM received), আর দ্বিতীয়বার চালু হওয়া (listening আর একটা GET লাইন, hits=1-সহ)। deploy-b.log file দ্বিতীয় deploy-এর।

7. দুটো deploy-ই বন্ধ করুন।

kill -TERM $A $B
wait

দুটো process-ই বন্ধ হয়েছে। টিউটোরিয়ালের run-এর পর port 8081 আর 8082-এ কিছু শুনছিল না। log file দুটো আপনার folder-এ থেকে যায়; দরকার না হলে মুছে ফেলুন।

How a tester uses it

সহজ English

বাংলা ব্যাখ্যা

  • চাহিদা মতো test environment। AWS cloud-এর ব্যবহারের তালিকায় software development ও testing রাখে Source 1সোর্স 1। cloud computing environment-এ নতুন IT resource মাত্র একটা click দূরে। তাতে developer-দের কাছে resource পৌঁছাতে সময় সপ্তাহ থেকে নেমে আসে মাত্র কয়েক minute-এ Source 4সোর্স 4।
  • একটা build, অনেক environment। সব deploy-এ codebase একই, যদিও প্রতিটা deploy-এ আলাদা version সক্রিয় থাকতে পারে Source 16সোর্স 16। release হলো একটা build, যার সঙ্গে একটা deploy-এর config মেলানো, আর প্রতিটা release-এর সবসময় একটা অনন্য release ID থাকা উচিত Source 20সোর্স 20। একটা release তৈরি হওয়ার পর বদলানো যায় না Source 20সোর্স 20।
  • code বদলের বদলে config। config-এ আছে database ও অন্য backing service-এর resource handle, আর per-deploy মান, যেমন canonical hostname Source 18সোর্স 18। একটা deploy যেন app-এর code না বদলেই একটা local MySQL database বদলে তৃতীয় পক্ষের পরিচালিত একটা database নিতে পারে, যেমন Amazon RDS Source 19সোর্স 19। শুধু config-এর resource handle বদলাতে হয় Source 19সোর্স 19।
  • parity একটা test result-কে অর্থবহ করে। backing service-এর মধ্যে পার্থক্য মানে ছোট ছোট অসামঞ্জস্য দেখা দেয়। এগুলোর কারণে যে code development বা staging-এ চলেছে আর test পাস করেছে, তা production-এ ব্যর্থ হয় Source 25সোর্স 25। সব deploy-এ প্রতিটা backing service-এর একই type আর version ব্যবহার করা উচিত Source 25সোর্স 25। scalability আর performance test নিয়ে AWS-এর নির্দেশনা চায় এমন একটা test environment, যা production-কে ঘনিষ্ঠভাবে অনুকরণ করে, যাতে ফল বাস্তব আচরণের পূর্বাভাস দেয় Source 10সোর্স 10।
  • pass বা fail-সহ load test। service-level objective (SLO) থেকে শুরু করুন Source 10সোর্স 10। SLO এমন কিছুর লক্ষ্য ঠিক করে, যা মাপা যায়, যেমন throughput, latency percentile বা error rate Source 10সোর্স 10। SLO প্রতিটা load test-কে একটা পরিষ্কার pass বা fail ফল দেয় Source 10সোর্স 10। delivery pipeline-এর অংশ হিসেবে চলা load test release-এর আগেই performance regression ধরে Source 10সোর্স 10।
  • শুধু কাজ নয়, ব্যর্থতাও test করুন। resilience-এর জন্য ডিজাইন করা workload আর প্রমাণিতভাবে resilient workload এক জিনিস নয় Source 9সোর্স 9। testing সেই ফাঁক পূরণ করে, যা আপনার ডিজাইন করা resilience আর আপনার আসল resilience-এর মধ্যে থাকে Source 9সোর্স 9। chaos engineering একটা system-এ নিয়ন্ত্রিত ত্রুটি ঢোকায়, যাচাই করতে যে system বাস্তব বিঘ্ন সহ্য করে ও তা থেকে সেরে ওঠে Source 11সোর্স 11। সফল experiment স্বয়ংক্রিয় regression test হয়ে যায় Source 11সোর্স 11। game day হলো একটা নির্ধারিত অনুশীলন, যেখানে দল production-এর মতো একটা environment-এ একটা simulated ব্যর্থতায় সাড়া দেয় Source 12সোর্স 12।
  • provider-এর testing নিয়ম জানুন। AWS customer Permitted Services হিসেবে তালিকাভুক্ত service-এর জন্য আগাম অনুমোদন ছাড়াই নিজের AWS infrastructure-এর security assessment বা penetration test চালাতে পারে Source 13সোর্স 13। তালিকায় আছে Amazon EC2 instance, WAF, NAT Gateway, Elastic Load Balancer আর AWS Lambda function Source 13সোর্স 13। Command and Control (C2) আছে এমন সব security testing-এর আগাম অনুমোদন লাগে Source 13সোর্স 13। যে customer network stress test চালাতে চায়, তার Stress Test policy দেখে নেওয়া উচিত Source 13সোর্স 13। EC2 থেকে একটা network stress test চালালে AWS-এর ভেতরে থাকা endpoint স্থানীয় AWS Region-এ থাকা উচিত Source 14সোর্স 14।
  • event stream থেকে প্রমাণ। log একটা চলমান app-এর আচরণ দেখতে দেয় Source 26সোর্স 26। একটা log indexing ও analysis system অতীতের নির্দিষ্ট event খুঁজে পেতে পারে Source 26সোর্স 26।
  • one-off কাজ। one-off admin কাজের মধ্যে আছে database migration চালানো আর app-এর repo-তে commit করা এককালীন script চালানো Source 27সোর্স 27। সেগুলো চলে একটা release-এর বিপরীতে, ওই release-এর বিপরীতে চলা যেকোনো process-এর মতো একই codebase আর config নিয়ে Source 27সোর্স 27।

Common mistakes

সহজ English

বাংলা ব্যাখ্যা

  • code-এ config। app কখনো কখনো config constant হিসেবে code-এ রাখে, আর এতে twelve-factor-এর নিয়ম ভাঙে Source 18সোর্স 18। একটা সহজ পরীক্ষা: কোনো credential ঝুঁকিতে না ফেলে codebase-টা যেকোনো মুহূর্তে open source করা যেত কি না Source 18সোর্স 18। এর বদলে config রাখুন environment variable-এ Source 18সোর্স 18।
  • নামওয়ালা environment-এ ভাগ করা config। environment-এর নাম ধরে config ভাগ করা পরিষ্কারভাবে scale করে না Source 18সোর্স 18। deploy বাড়লে staging বা qa-র মতো নতুন নাম লাগে, আর config একটা combinatorial explosion হয়ে যায় Source 18সোর্স 18। twelve-factor app-এ env var ছোট, আলাদা নিয়ন্ত্রণ, প্রতিটা deploy-এর জন্য আলাদাভাবে পরিচালিত Source 18সোর্স 18।
  • test-এ আলাদা backing service। twelve-factor developer development আর production-এ আলাদা backing service ব্যবহারের লোভ সামলায়, এমনকি adapter পার্থক্য লুকিয়ে রাখার কথা থাকলেও Source 25সোর্স 25। locally SQLite আর production-এ PostgreSQL ব্যবহার করা docs-এর উদাহরণ Source 25সোর্স 25।
  • process বা disk-এ state। sticky session twelve-factor-এর নিয়ম ভাঙে, আর কখনো ব্যবহার বা নির্ভর করা উচিত নয় Source 21সোর্স 21। session data রাখার ভালো জায়গা এমন datastore, যেটা সময় পেরোলে data মেয়াদোত্তীর্ণ করে, যেমন Memcached বা Redis Source 21সোর্স 21।
  • app-এর লেখা log file। twelve-factor app-এর logfile লেখা বা পরিচালনা করার চেষ্টা করা উচিত নয় Source 26সোর্স 26। এর বদলে প্রতিটা চলমান process তার event stream, unbuffered, stdout-এ লেখে Source 26সোর্স 26।
  • security AWS-এর ওপর ছেড়ে দেওয়া। guest operating system-এর দায়িত্ব customer-এর, তার update আর security patch-সহ Source 6সোর্স 6। একটা EC2 instance-এ customer আরও দায়ী নিজে বসানো application software ও utility-র জন্য, আর AWS-এর দেওয়া firewall-এর (যার নাম security group) configuration-এর জন্য Source 7সোর্স 7।
  • production-এর সঙ্গে না মেলা test environment। একটা প্রচলিত anti-pattern হলো size বা configuration-এ production-এর সঙ্গে না মেলা environment-এ test করা Source 10সোর্স 10।
  • একবারের load test, pass বা fail ছাড়া। load testing-এর দুটো anti-pattern: এটা একবারের কাজ, delivery pipeline-এর অংশ নয় Source 10সোর্স 10, আর performance-এর চাহিদা অনির্ধারিত, তাই test-এর কোনো pass বা fail মাপকাঠি নেই Source 10সোর্স 10।
  • ডিজাইন করা, কিন্তু কখনো test না করা resilience। দলগুলো resilience-এর জন্য ডিজাইন করে, কিন্তু ত্রুটি ঘটলে পুরো workload কেমন আচরণ করে তা কখনো যাচাই করে না Source 11সোর্স 11। দলগুলো recovery procedure লিখে রাখে, কিন্তু কখনো তা অনুশীলন করে না Source 12সোর্স 12। শুধু engineer নিয়ে game day technology test করে, কিন্তু বাস্তব incident-এ যে সমন্বয়, সিদ্ধান্ত নেওয়া আর যোগাযোগ লাগে তা বাদ পড়ে Source 12সোর্স 12।
  • EC2 থেকে DDoS test। volumetric network-based DDoS simulation Amazon EC2 platform-এ স্পষ্টভাবে নিষিদ্ধ Source 14সোর্স 14। যে test ইচ্ছে করে flooding attack দিয়ে target-কে ঠেসে ধরতে চায়, তা network stress test নয় Source 14সোর্স 14। customer-এর test-এর কারণে AWS বা অন্য AWS customer-এর যেকোনো ক্ষতির দায় customer-এর Source 13সোর্স 13।

What a tester can check

Tutorial advice

This list is the tutorial's own advice for a tester whose app runs in the cloud.

  • Ask where each environment gets its config, and who can change it.
  • Ask which release each test environment runs, and write it in the test report.
  • Compare the backing services of test and production: the same type, and the same version.
  • Restart a process in the middle of a test, and check that nothing that matters is lost.
  • Find out where the logs of each environment go, and how long they are kept.
  • Ask who patches the operating system, and who owns the firewall rules, on each machine.
  • Before a load or security test on AWS, read the AWS testing policies, and ask AWS for approval when a policy requires it.
  • Ask for the SLOs before you design a load test, and write the pass or fail line from them.
  • Ask when the team last made a failure happen on purpose, and what it learned.
  • Delete the test resources when a run ends, and look at what the account is billed for.

সহজ English

Tutorial advice

This list is the tutorial's own advice for a tester whose app runs in the cloud.

  • Ask where each environment gets its config, and who can change it.
  • Ask which release each test environment runs, and write it in the test report.
  • Compare the backing services of test and production. They should be the same type and the same version.
  • Restart a process in the middle of a test, and check that nothing important is lost.
  • Find out where the logs of each environment go, and how long they are kept.
  • Ask who patches the operating system on each machine, and who owns its firewall rules.
  • Before a load or security test on AWS, read the AWS testing policies. Ask AWS for approval when a policy requires it.
  • Ask for the SLOs before you design a load test. Write the pass or fail line from them.
  • Ask when the team last made a failure happen on purpose, and what it learned.
  • Delete the test resources when a run ends, and look at what the account is billed for.

বাংলা ব্যাখ্যা

Tutorial advice

এই তালিকা টিউটোরিয়ালের নিজের পরামর্শ, এমন একজন tester-এর জন্য যার app cloud-এ চলে।

  • জিজ্ঞেস করুন প্রতিটা environment তার config কোথা থেকে পায়, আর কে সেটা বদলাতে পারে।
  • জিজ্ঞেস করুন প্রতিটা test environment কোন release চালায়, আর সেটা test report-এ লিখে রাখুন।
  • test আর production-এর backing service মেলান: একই type, একই version।
  • একটা test-এর মাঝখানে একটা process restart করুন, আর দেখুন গুরুত্বপূর্ণ কিছু হারায় কি না।
  • জেনে নিন প্রতিটা environment-এর log কোথায় যায়, আর কতদিন রাখা হয়।
  • জিজ্ঞেস করুন প্রতিটা machine-এ operating system কে patch করে, আর firewall-এর নিয়মের মালিক কে।
  • AWS-এ load বা security test চালানোর আগে AWS-এর testing policy পড়ুন, আর policy চাইলে AWS-এর অনুমোদন নিন।
  • load test ডিজাইনের আগে SLO চান, আর সেগুলো থেকে pass বা fail-এর রেখা লিখুন।
  • জিজ্ঞেস করুন দলটা শেষবার কবে ইচ্ছে করে একটা ব্যর্থতা ঘটিয়েছিল, আর কী শিখেছিল।
  • একটা run শেষ হলে test resource মুছে ফেলুন, আর account-এ কিসের বিল হচ্ছে তা দেখুন।

Key words

TermMeaning
Cloud computingThe on-demand delivery of IT resources over the Internet with pay-as-you-go pricing
IaaSInfrastructure as a Service: the basic building blocks for cloud IT, typically networking features, computers, and data storage space
PaaSPlatform as a Service: it removes the need to manage the underlying infrastructure, so that you focus on your applications
SaaSSoftware as a Service: software applications that are run and managed by the vendor
RegionA physical location around the world where AWS clusters data centers
Availability Zone (AZ)One or more discrete data centers with redundant power, networking, and connectivity in an AWS Region
Shared responsibilityBuilding and operating workloads in the cloud is shared between AWS and you; commonly called responsibility of the cloud versus in the cloud
Guest operating systemThe operating system whose updates and security patches the customer is responsible for on EC2
Twelve-factor appA methodology for building software-as-a-service apps
DeployA running instance of the app
ConfigEverything that is likely to vary between deploys; the twelve-factor app stores it in environment variables
Backing serviceAny service the app consumes over the network as part of its normal operation
Build, release, runThe three stages that turn a codebase into a running deploy
ReleaseA build combined with the config of a deploy; it should always have a unique release ID and cannot be mutated once it is created
Stateless processTwelve-factor processes are stateless and share-nothing; data that needs to persist goes into a stateful backing service
SIGTERMThe signal that a process manager sends; a twelve-factor process shuts down gracefully when it receives it
Event streamThe stream of events that each running process writes, unbuffered, to stdout
SLOA service-level objective: a target for a measurable output such as throughput, a latency percentile, or an error rate
Chaos engineeringInjecting controlled faults into a system to verify that it withstands and recovers from real-world disruptions
Game dayA scheduled exercise where a team responds to a simulated failure in a production-like environment

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

Show 5 more reelsআরও 5টি রিল দেখান
  1. [1]
    What is cloud computing?

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  2. [2]
    Types of cloud computing

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  3. [3]
    SP 800-145, The NIST Definition of Cloud Computing

    NIST · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  4. [4]
    Six advantages of cloud computing

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  5. [5]
    AWS Global Infrastructure: Regions and Availability Zones

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  6. [6]
    Shared responsibility

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  7. [7]
    Shared Responsibility Model

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  8. [8]
    Cloud Workloads

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  9. [9]
    Test reliability

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  10. [10]
    REL12-BP03 Test scalability and performance requirements

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  11. [11]
    REL12-BP04 Test resilience using chaos engineering

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  12. [12]
    REL12-BP05 Conduct game days regularly

    AWS Documentation · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  13. [13]
    Penetration Testing

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  14. [14]
    Amazon EC2 Testing Policy

    Amazon Web Services · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  15. [15]
    The Twelve-Factor App

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  16. [16]
    I. Codebase

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  17. [17]
    II. Dependencies

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  18. [18]
    III. Config

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  19. [19]
    IV. Backing services

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  20. [20]
    V. Build, release, run

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  21. [21]
    VI. Processes

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  22. [22]
    VII. Port binding

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  23. [23]
    VIII. Concurrency

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  24. [24]
    IX. Disposability

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  25. [25]
    X. Dev/prod parity

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  26. [26]
    XI. Logs

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18

  27. [27]
    XII. Admin processes

    12factor.net · accessed 2026-11-18দেখা হয়েছে: 2026-11-18