Search
11 results for “ec2”
Search results
When would you choose AWS Lambda over EC2 for a workload?
Lambda fits event-driven, short-lived work, an API request, a file landing in S3, a queue message, where you want to pay only for actual invocation time and never manage a server at all; a function can run for at most 15 minutes and has no state between invocations. EC2 fits workloads that need to run continuously, need OS-level control, exceed Lambda's execution-time or memory ceiling, or need to retain in-process state between requests. The decision is about execution model and constraints, not maturity, a long-running stateful service is a worse fit for Lambda regardless of how "serverless-first" a team wants to be.
What does an EC2 Auto Scaling Group actually manage, and why does the scaling metric choice matter?
An Auto Scaling Group keeps a fleet of EC2 instances at a desired size, launching or terminating instances automatically based on configured scaling policies, and replacing instances that fail health checks, so nobody is manually adding or removing servers as load changes. The scaling metric determines whether that automation actually tracks the real bottleneck: scaling purely on CPU utilization looks like "autoscaling is working" on a dashboard while a memory-bound or queue-depth-bound workload keeps falling behind, because the metric driving the scaling policy never reflected the actual constraint. Choosing a metric (or combination of metrics, including custom CloudWatch metrics) that matches the workload's real bottleneck is what makes the automation actually correct rather than just present.
Why are IAM roles preferred over long-lived access keys for workloads running on EC2 or Lambda?
A long-lived access key is a static secret that must be stored somewhere, an environment variable, a config file, a secrets manager, and rotated manually or via automation; if it leaks, it remains valid until someone notices and revokes it. An IAM role attached to an EC2 instance profile or a Lambda execution role is assumed automatically by the AWS SDK, yielding short-lived credentials that are rotated transparently and expire on their own even if never explicitly revoked. This removes the entire class of "leaked long-lived credential" risk for workloads that run on AWS compute, which is why roles are the default recommendation over access keys whenever the workload runs inside AWS.
AWS Compute
How EC2, Lambda, ECS, and EKS trade control for convenience differently, and how to actually choose between them instead of defaulting to whichever one you already know.
What is the difference between ECS and EKS?
Both are managed container orchestrators, but ECS is AWS's own native orchestration model (task definitions, services, clusters) with no separate control-plane fee, while EKS runs an actual, standard, upstream Kubernetes control plane that AWS manages for you, and Amazon EKS charges a per-cluster fee specifically for that managed control plane, on top of whatever compute the worker nodes cost. Both can run workloads on EC2 instances you manage, or offload node/workload compute to AWS via Fargate or, on EKS specifically, EKS Auto Mode, so "serverless containers" is available either way; the real choice is whether you want Kubernetes's API and ecosystem (EKS) or a simpler, AWS-native model with less portability (ECS).
What is the difference between an IAM user and an IAM role?
An IAM user is a long-term identity with its own credentials, a password for console access, or access keys for programmatic access, typically representing a human or a legacy application that needs standing access. An IAM role has no long-term credentials of its own; it is assumed, by a user, an application, or an AWS service, and yields short-lived, automatically-expiring temporary credentials via AWS STS. Roles are the preferred identity for anything running on AWS compute (EC2, Lambda, ECS) precisely because there is no long-lived secret to leak or rotate.
What is the difference between S3, EBS, and EFS?
S3 is object storage accessed entirely through an HTTP(S) API, not mounted as a filesystem, built for unstructured data at virtually unlimited scale. EBS is block storage that attaches to exactly one EC2 instance at a time (Multi-Attach for io1/io2 is the narrow exception) and must live in the same Availability Zone as that instance, functioning as its persistent virtual hard disk. EFS is a fully managed NFS file system that is regional by default, replicated across multiple Availability Zones, and can be mounted concurrently by many instances at once. The choice comes down to access pattern: S3 for API-driven object access, EBS for a single instance's own low-latency block storage, EFS for a shared network file system across many instances.
Why would you use EFS instead of EBS for a given workload?
EBS attaches to a single EC2 instance and lives in one Availability Zone, which is exactly right for a database's own local-feeling disk but doesn't work at all when more than one instance needs to read and write the same files concurrently. EFS is designed for exactly that case: a regional, NFS-mountable file system that many EC2, ECS, or Lambda-backed clients can mount and use at the same time, with strong consistency across them. The trigger for reaching for EFS instead of EBS is almost always "does more than one compute resource need to share this data," not a performance decision alone.
For a sorted list [1, 2, 2, 2, 3], what index does bisect_left(2) return versus bisect_right(2), and why are they different?
`bisect_left` returns 1, the insertion point before every existing 2, so inserting there keeps all 2s together immediately after it. `bisect_right` returns 4, the insertion point after every existing 2, keeping all 2s together immediately before it. They differ because they define the insertion point by a different partition rule, `bisect_left` guarantees everything before the returned index is strictly less than the target, `bisect_right` guarantees everything before the returned index is less than or equal to it, so the choice determines whether a new equal-valued element gets inserted before or after existing equal elements, not just where "some 2" is found.
What is the practical difference between 2NF and 3NF?
2NF removes partial dependencies: every non-key column must depend on the whole primary key, not just part of a composite key. 3NF goes further and removes transitive dependencies: a non-key column cannot depend on another non-key column. A classic 3NF violation is storing both zip_code and city on an orders table, where city is really determined by zip_code, not by the order itself, city belongs in its own lookup table.
Managing Active Directory: Create OUs, Groups, and Users on Windows Server 2019 (Hyper-V Lab)
After deploying Active Directory Domain Services (AD DS) on a Windows Server 2019 virtual machine using Hyper V, the next logical step is to configure core Active Directory objects that reflect a real enterprise environment. This lab focuses on Organizational Units (OUs), Groups, and Users, which f…