Papiha Joharapurkar

developer exam takeaways

I had my AWS Certified Developer Associate exam scheduled a few days ago and unfortunately... I am now fully qualified to implement load balancing with a fair share of data sharding, encryption (envelope method only!) with automatic key rotation, and API Gateway caching, especially for rather simplistic applications such as a to-do app.

All jokes aside, although I don't see certifications as being uber-useful in this day where you can search up anything and application > theory, as someone coming from a non-DevOps background, being mandated to take this exam by my workplace meant that I was getting paid to learn about what it takes to run applications in production. I think as companies are creating ambitious roadmaps and plans for the development of AI products, they are looking inwards at talent to identify ways they can grow and track their workforce's talents so the workforce is capable of building. The exam would be one such way. Even though there are a ton of AWS-specific products and tools I had to learn about, overall I did gain a good understanding application development practices.

I'll try to summarize as best I can but I want to emphasize that this is not a comprehensive exam review. It's just a summary and key takeaways.

The exam covers 4 overall sections and I'll go over the main learnings from these 4 sections: 1) Development with AWS services 2) Security 3) Deployment 4) Troubleshooting and Optimizations

*Development with AWS services* When creating an application, you want it to be highly available, which means it's accessible in case there are failures as well as scalable which means the application is accessible to users - regardless of the amount of users. There are a ton of AWS-specific services such as Lambda which is serverless (don't need to manage server, microVM's run in the background) and it runs your code when triggered by events or asynchronously. S3 is storage services - there's different tiers and you can create event notifications so if something is uploaded to an S3, it could trigger an event. The event could go into SNS (simple notification service) and a subscriber, such as Lambda could receive the events. Alternatively, the event could go into a SQS (simple queue service) which the Lambda could poll. EC2 refers to virtual servers in the EC2 (Elastic Compute Cloud), and these are used to run applications. API Gateways are a front-door that expose the backend services such as AWS services.

DynamoDB is a horizontally-scalable NoSQL database where you can query based on partition + sort-key combination. The advantage of this database over a relational database (RDS) is that it scales horizontally compared to RDS which is better when you have many joins/complex queries. If needing to query based on other keys, you could look into creating local secondary index or global secondary index depending on the keys you are looking at. With learning about DynamoDB, I learned about optimistic locking which is to prevent overwriting if there are two parallel writes at the same time, where the second write is rejected. Idempotency I also learned about which is to ensure that regardless of number of attempts, the end result should be the same. This concept is important especially when retries may be possible so you want to prevent any case of duplicate actions. This is especially helpful for financial transactions where you do not want duplicate withdrawals (duplicate payments would be nice though).

*Security* AWS has their own tooling for identity access management. Usually, if you need to access a resource to trigger an event, the caller needs an identity based policy which is attached to your role i.e. developer or your user (however best practices are to attach to roles instead of specific users). Alternatively, the resource can have a resource policy attached e.g. S3 bucket access policy for reading. You can also connect your applications to Cognito for user pools for authenticating users or for identity pools, to exchange credentials for authorization by receiving AWS credentials.

I also learned about encryption methods such as the symmetric method where you encrypt your data with a single-key, and then that key can be stored. Asymmetric encryption uses a key pair instead of one shared key. The public key encrypts and can be shared freely whereas the private key decrypts and is never shared. Envelop encryption involves using both a plain data key and encrypted key. You encrypt your data with a plain data key, and then discard the plain key. You store the data with the encrypted-key and then when it is time to de-encrypt, the encrypted key is sent to the key management store which then returns the plain-data key and that is used to decrypt your data.

*Deployment* Learned lots about traffic shifting and the various methods of updating applications in this section. For instance, to update applications, you can do it all-at-once which is good for testing/development but in production, you may want to instead use rolling with additional batches which means new instances with new application versions are created and although this could increase costs temporarily, you prevent downtime as the existing application versions still exist. There's also rolling which is updating instances a few at a time, or the Immutable approach which involves creating a new auto-scaling group with the new instances and then removing the old instances if deployment is successful. Blue green involves creating a new environment entirely and then swapping the URL's when ready. There's a ton of AWS specific services i.e. CloudFormation, SAM, CDK can help with managing the infrastructure as code and there's CI/CD tooling specific to AWS as well for the build/deployment steps such as CodeBuild, CodeDeploy, CodePipeline.

*Troubleshooting and Optimizations* In this section, there are lots of AWS specific services to cover! You can create metrics or alarms and review past historical insights with CloudWatch and trace bugs with X-Ray. CloudTrail is for auditing. If encountering throttling errors which is when many requests are trying your service, you can implement retries with exponential back-off (exponential time waiting until re-trying) or caching. Caching is something you can do to optimize your application. You can set up caches in front of databases such as DynamoDB for recent-queries but also cache results from S3 through CloudFront (content delivery network) and you can set this up globally so results can be accessed from the cache if it has been accessed which is known as a cache-hit, else the result can be served from the actual service and then stored in the cache for future requests. Caching can also be set up in front of API gateways.

Overall, it's great to understand these topics at a high-level and although the exam was super AWS-specific, I'm walking away with a better idea of what it takes to run an application in production and will definitely be carrying this understanding into the products I build next.

(notes while studying for exam!)

All daily logs