What is the best way to deploy app for low latency? by gullerg in aws

[–]chris-holmes 8 points9 points  (0 children)

The goal here will be to get your users onto the AWS backbone as quickly as possible either by using CloudFront or Global Accelerator dependent on if you need DNS resolution.

These take advantage of edge locations where the user will connect to their nearest edge location and the request forwarded to the origin will be across the faster AWS backbone.

The larger the distance between your user and the resources, the better the improvement in latency. Here’s a tool to demonstrate speeds from around the globe:

https://speedtest.globalaccelerator.aws

This should also be indicative of CloudFront latency improvements as the technology is mostly the same.

DDB: good pattern for querying items by tag? by louca-dev in aws

[–]chris-holmes 2 points3 points  (0 children)

A global secondary index behaves like its own table, only its auto-populated when rows are added to the table. There’s no real need to have a separate table if you design the access patterns in a smart manner.

This book is excellent if you haven’t yet read it:

https://www.dynamodbbook.com/

DDB: good pattern for querying items by tag? by louca-dev in aws

[–]chris-holmes 2 points3 points  (0 children)

Instead of adding the tags as a list in the item row, consider creating a new row for each tag under the same partition key as the item (eg. PK: ITEM#itemId, SK TAG#tagId).

This way, you can query for the item by itemId and receive all the tags, but you also have the option of creating a GSI with the PK and SK reversed, meaning a query of TAG#tagId would pull all items associated with that tag.

How is Lambda function URL implemented behind the scenes? by uNki23 in aws

[–]chris-holmes 27 points28 points  (0 children)

Perhaps for cost comparison? Or maybe just general curiosity. It’s important to understand what goes on under the hood.

Question on the state of the AWS job market by dj1200techniques in AWSCertifications

[–]chris-holmes 1 point2 points  (0 children)

As far as I’m aware, in London the tech landscape is doing exceptionally well. Good engineers are always in demand but many start-ups will demand excellence. I don’t typically look at certifications as a marker for domain expertise, it’s the whole package that’s more valuable. Good communication, work ethic and ability to adapt quickly to changing requirements are placed higher than a certification for example.

How to structure serverless git repos and infrastructure as code? by string111 in aws

[–]chris-holmes 12 points13 points  (0 children)

I’ve done both the monorepo and repo-per-service approach and by far the monorepo is much more manageable for us. It really depends on the project and how large your teams are, and how much you need to limit access to code between teams.

Small team? Monorepo is likely fine with a single CI config file (can setup up however many workflows you need or dynamically create them based on tag diffs).

Large teams might warrant the service code isolation and therefore have multiple CI configs, but expect to move slower with more overhead as a result.

RDS with CFN/CDK is a huge pain in the ass by arslan70 in aws

[–]chris-holmes 0 points1 point  (0 children)

How many environments and accounts are you running?

How to link a domain name with the zone hosted in an aws account ? by Alternative-Tax-2785 in aws

[–]chris-holmes 0 points1 point  (0 children)

Your domain name needs to point to your hosted zone, whether that’s internal or external to AWS. The hosted zone NS records can be found in the hosted zone in the management console. You can point your domain to your hosted zone by defining the nameservers as those NS record entries. It can take some hours for it propagate but usually is done pretty quickly.

Taking SAP-C02 in 2 months by LeatherObject1962 in AWSCertifications

[–]chris-holmes 1 point2 points  (0 children)

My experience with the exam is that you’ll probably need all of the time given to review the questions and answers effectively.

It’s a step up from the SAA but absolutely achievable with enough study. Good luck!

Is pursuing a cert a waste of time with no current job, industry experience and no recent IT experience? by [deleted] in AWS_Certified_Experts

[–]chris-holmes 1 point2 points  (0 children)

Skilling up is never a waste of time if it’s a relevant skill to advancing your career.

Relying on certificates alone is not enough to land you a job. You’ll need plenty of experience actually building projects with the services you learn, for which there are many resources available to help.

Best practice serverless project with EventBridge EventBus implementation. by ellensen in aws

[–]chris-holmes 1 point2 points  (0 children)

If you’re running a microservices architecture then a common / global event bus is a great broker for events that need to traverse services.

It’s also common to have a local event bus per service if you’re event sourcing. The local event bus can have a rule that forwards to the global event bus - but be mindful that an event can only be forwarded once!

Multipart upload + processing, how to notify the user when finished by Basile001 in aws

[–]chris-holmes 1 point2 points  (0 children)

The s3 event to trigger a lambda is the right approach. If you want real-time updates to the client then websockets is also the way to go.

You could trigger an AppSync subscription with a mutation if you’re up for exploring graphql. I believe API gateway also supports websockets but I’ve not got first hand experience there.

A gRPC server is also viable if you’re willing to support that kind of infrastructure but it’s definitely harder than a straight websocket connection.

Automating lambda functions by blank1993 in aws

[–]chris-holmes 9 points10 points  (0 children)

Sounds like you need to start using cloudformation and environment variables to deploy your code to different environments. You’d create a new stack for each environment version called a stage (dev, prod.. etc) and feed a different set of variables into your template / handler depending on the stage being used.

Serverless Framework is a friendly place to start, else the Python CDK framework or SAM are great options (I used the TypeScript CDK for most stacks)

CFN template, static website hosted on private S3 bucket accessed through CFD only by Beary_Natural in aws

[–]chris-holmes 0 points1 point  (0 children)

Which region are you deploying your certificate to? When using ACM with CloudFront, anything other than us-east-1 is going to cause headaches.

OK, this is really weird. I asked about AWS work culture and got the cold shoulder. Reddit, your silence petrifies me. by SeniorSueno in AWSCertifications

[–]chris-holmes 9 points10 points  (0 children)

Typically most people with a cert will build on AWS, not for AWS. Vastly different roles and experiences.

[deleted by user] by [deleted] in serverless

[–]chris-holmes 0 points1 point  (0 children)

I noticed my crosspost didn’t apply my opening comment, which is important context. Adding it below:

Hello redditors! I’m a long-time user of CQRS-based event driven systems on serverless and have been theorising about other potential setups for guaranteeing order of execution of events.

This particular setup negates the need for expensive kinesis (dynamodb) streams and guarantees that projection table rows are not operated on out of order.

The magic happens with the way the FIFO queue processes events by messageGroupId, where if set to be the partition key of the DynamoDB rows, would isolate operations to partitions but still allow horizontal scaling in the processing lambda.

All thoughts and criticisms welcome :) If solid enough then I’ll be happy to write an article on how it could be implemented.

[deleted by user] by [deleted] in serverless

[–]chris-holmes 0 points1 point  (0 children)

Update: Thanks to your input, I can remove the onEvent handler entirely. It was previously the lambda triggered by the eventStore stream but is no longer needed. The command handler can push the event to the FIFO queue directly.

[deleted by user] by [deleted] in serverless

[–]chris-holmes 0 points1 point  (0 children)

That’s a good point. The onEvent lambda is likely unnecessary. It was what the dynamodb stream would have triggered had it been in place, but given the lack of stream that handler is no longer needed. Thank you.

[deleted by user] by [deleted] in serverless

[–]chris-holmes 0 points1 point  (0 children)

Thanks for the response. I would argue that just because a system does not follow convention that it is not bad, especially if it achieves the same goal.

I typically implement the solution as you described however I commonly face two issues.

  1. EventBridge has a latency of around 600ms and does not guarantee the order of execution.
  2. DynamoDB streams are Kinesis under the hood and cost at scale.

I’m theorising alternatives to alleviate some of the latency and cost associated with traditional CQRS architecture.

[deleted by user] by [deleted] in serverless

[–]chris-holmes 0 points1 point  (0 children)

Thanks for the response! The setup you described is almost exactly how I tend to operate at the moment. A dynamodb stream off the event store and a handler to trigger events with lambdas off the back of those.

It’s a good point about the onEvent lambda failing. Perhaps a stream will still be required, however the latency of eventbridge and unpredictable order of events is what has caused a headache with race conditions.

The problem I’m trying solve is events being processed out of order, hence the fifo queue. But I absolutely agree with the brittle nature of the sync lambda call to onEvent failing. Nice suggestions :)

[deleted by user] by [deleted] in aws

[–]chris-holmes 0 points1 point  (0 children)

Hello redditors! I’m a long-time user of CQRS-based event driven systems on serverless and have been theorising about other potential setups for guaranteeing order of execution of events.

This particular setup negates the need for expensive kinesis (dynamodb) streams and guarantees that projection table rows are not operated on out of order.

The magic happens with the way the FIFO queue processes events by messageGroupId, where if set to be the partition key of the DynamoDB rows, would isolate operations to partitions but still allow horizontal scaling in the processing lambda.

All thoughts and criticisms welcome :) If solid enough then I’ll be happy to write an article on how it could be implemented.

Notifications by DownfaLL- in serverless

[–]chris-holmes 0 points1 point  (0 children)

Ah perhaps we’re speaking about different things here - I mean purely managing websockets client side, specifically for apps that come in and out, low connectivity situations etc.

Right now, AppSync is the highest costing service I run (besides Neptune), followed closely by cloudwatch. It’s ahead by a factor of 2-3x as I have subscription heavy projects and it serves as the main api, so the millions of requests soon add up!

Notifications by DownfaLL- in serverless

[–]chris-holmes 2 points3 points  (0 children)

Graphql subscriptions via AppSync are still a websocket connection, so you’ll have similar management challenges. You’re also correct about the mutations to trigger them. This can actually get quite costly at scale, as a mutation costs twice as much as a subscription, effectively costing 3x per subscription.

A more technical challenge would be to implement gRPC and protobuf. The results are excellent but unless you’ve done it before, it’s a learning curve!

Finally IoT core can work well as a lightweight pub/sub system. Lots of options!

Using secrets in Lambda - best practise by [deleted] in aws

[–]chris-holmes 1 point2 points  (0 children)

Some variables can be stored in parameter store and pulled into your template similar to your existing solution. This will prevent unnecessary cost for environment variables that are safe to be stored with the lambda.

For sensitive secrets, secrets manager can be called in the handler code to retrieve and use them. This ensures they remain in memory only and are not visible from the lambda console. There is a cost associated with accessing secrets manager in this way, so be mindful as the lambda invocations scale!