Wednesday, September 22, 2021
Home Blog

21 Google Cloud tools in 2 minutes or less

0

Pretty cool post from Google’s Blog to quickly view 21 services in a series of short videos.

Some essential videos

Anthos – essential for Hybrid Cloud app modernization

Firestore – NoSQL document database at scale

Cloud Data Fusion – fully managed, cloud-native, enterprise data integration service

You can find the full set of videos in the original post on Google’s Blog.

The Reference Architecture Disappointment

0

There is a “phenomenon” that I have experienced through my career that I like to call the “Reference Architecture Disappointment”.

Some people would experiment with a similar effect when they go to the MDยดs consultation with several symptoms to find out that they may have a common cold. No frenzy at the Hospital, no crazy consultations, no House MDยดs TV scenes. Just paracetamol, water and rest!

So many years of Medicine School just to prescribe that?

Well, yes. The MD recognised a common cold between dozen of illnesses with the same set of symptoms and prescribed the simplest and best treatment. The question is, would you be able to do it?

Same thing when a Solutions Architect deals with a set of requirements. The “Architect” will select the best architecture that solves a business problem, most simply and efficiently possible. Sometimes, that means to use the “Reference Architecture” for that particular problem, with the necessary changes.

Those architectures emerge from practical experience and encompass patterns and best practices. Usually, reinventing the wheel is not a good idea.

Keep it simple and Rock On!

Synthetic Canaries for API Gateway – I

0

Last February, AWS added support for creating canaries for API Gateway to Cloudwatch Synthetics, which I’ve been using lately to monitor some REST APIS successfully.

Let’s review some technical concepts first:

  • Canaries: Node scripts that run on schedule to monitor endpoints, following the action path of your users. Basically, canaries create Lambda functions using Node.js as a library, working with HTTP/HTTPS.
  • CloudWatch Synthetics: allow to create canaries without coding, just using templates without writing any code. It’s really easy to implement, and you can use, and you should, use Cloudformation.

Canary Dashboard, by MNUBE.org

Problem to solve

After some hard work, now we have our brand new Serverless App deployed and ready to be tested, comprised of a REST API and a Microfrontend – Cloudfront + S3.

Serverless App, by MNUBE.org

We need to monitor our endpoints for latency and resiliency; how do we do it right away? I have already answered the question: creating a synthetic canary.

Implementing a Canary

You can find the Canaries dashboard in the AWS console:

Cloudwatch > Insights > Application monitoring > Synthetic canaries

Image by MNUBE.org

Creating a canary for API gateway from the console it’s really straightforward; you are given two options: select an API Gateway API and stage or a Swagger template.

Image by MNUBE.org

We are presented then with a series of options:

  • Selection of the API-Gateway in the present Account/Region
  • Selection of Stage
Image by MNUBE.org

The endpoint URL should be populated automatically:

Image by MNUBE.org

The next step, adding a HTTP request, is also straightforward. The configuration – parameters, headers – depends on the method that is being tested:

Image by MNUBE.org

Now you can finalize the creation of the canary:

  • Runtime version: you can leave the default version.
  • We are shown the generated code of the Lambda function implementing the canary.
  • Enviroment variables: variables to pass to the Lambda function.
  • Schedule: different ways to execute the canary. In this case, we choose Run continuosly.
Image by MNUBE.org

In the following screen, we can see the canary that has been created and have been in execution for a while:

Image by MNUBE.org

Finally, a few metrics are shown: Duration, Errors (4xx), Faults (5xx).

As promised, canaries are really easy to implement.

Final Architecture

Serverless Web App + Canary

Fast DynamoDB Pagination using Python

0

DynamoDB is the fastest NoSQL database at scale from AWS, operating within the key-value and document-based models. I’m not going to delve into the basics because I’m sure I don’t need to explain them to you – as you have arrived here :). Anyways, if you’d need a quick introduction, please check out the following links:

Pagination Architecture is not a trivial affair

If you have ever implemented a pagination component, you already know that it is not a really easy thing to do, especially in a clean and performant way.

Furthermore, DynamoDB adds its own set of challenges because of the way it works. The resultset is divided into sets or pages of data up to 1 MB in size if you execute a Query. So you’d need to find out if there are some remaining results to return after that first query. Also, you’d likely need to return a fixed number of results, which adds a few nice edge cases to the mix.

If you use Scan, instead of Query, things get worse because it reads up the whole table, exhausting the assigned RCUS very quickly. I produced a first quick version using Scan; it works, but it’s not optimal for pagination, especially when you have a huge number of records – and expensive too.

Not all is gloom and doom, though. The Queryobject contains an element, LastEvaluatedKey, that points to the last processed record. We can use this element to build a cursor we can pass back and forth – in the response and request – to build our pagination component. When there are no elements left, this element is null, and therefore, we have reached the end of the resultset.

LastEvaluatedKey is a Map type object that contains the PK of the Table. We shouldn’t pass it like that, as we would be exposing our model to the world. A standard and better way to do this is passing the element using Base64 encoding. You can use the python module base64:

import base64

cursor_ascii = cursor.encode("ascii")
base64_bytes = base64.b64encode(s)
#we convert the bytes into a string or whatever we'd need

The first thing we have to do is to retrieve the cursor from the request, if it exists, and execute a first query. Then we assign the cursor – the decoded LastEvaluatedKey from the previous pagination – to the field ExclusiveStartKey. In this example, I’m retrieving a set of user’s data using the id as a filter.

#get cursor from the request
exclusiveStartKey = decode_base64(cursor)

if exclusiveStartKey is not None:
        response = table.query(
                KeyConditionExpression=Key('id').eq(userId),
                ExclusiveStartKey=exclusiveStartKey
            )


Now, we find out if there are some remaining records – remember the 1 MB limit – until the element LastEvaluatedKey is present in the result object, or we have reached our imposed limit. Finally, we have to keep track of the LastEvaluatedKey to pass and encode it in the response.

lastEvaluatedKey = None
    while 'LastEvaluatedKey' in response:
        key = response['LastEvaluatedKey']
        lastEvaluatedKey = key

        response = table.query(
                KeyConditionExpression=Key('id').eq(userId),
                ExclusiveStartKey=key
            )
    ............

cusor = encode_base64(cursor)     

I hope this helps to build your own pagination component ๐Ÿ™‚

DynamoDB New Console

0

What a surprise!

I was writing a piece about a component for DynamoDB – that I’ve produced for a PoC -when the console completely changed!

Updated console – image was taken by the author

The new console looks like the rest of the updated services; the experience gets more cohesive between all services.

Includes three new sections: Items, PartiQL Editor and Export to S3.

So far, so good!

Official announcement

AWS Certified Advanced Networking, 2021 Revision and Beyond

0

I’ve recertified at the time of writing this post – June 2021 – and wanted to share a bit of the experience and preparation for this one because it has been peculiar, to say the least.

My preparation is very particular because I tend to prepare my own materials using mostly my experience and the official resources available, which are quite good in general. So I checked out the certification site and the digital readiness training. It was almost the same as the last time. I took the sample questions; they were new but similar to the old ones, nothing really new there, except for Cloudwatch Insights.

My 2018 hard copy – completely worn out

I started preparing using the official guide – I bought it in London in 2018 – the docs, some videos from the digital readiness course and my notes from different projects that I’d been working on; I couldn’t help but thinking that the exam needed a refresh. After all, three years in “cloud-years” are a lot, maybe x2, due to the pace of current innovation. Also, many services were missing from the guide and exam outline, including Transit Gateway, AWS RAM, Global Accelerator … all very relevant for modern architectures.

Well, what do you know? I got an invitation to provide input on the new content outline of the exam!

The Certification

I’m sure that you are aware that AWS Certified Advanced Networking is regarded as one of the most challenging certifications, if not the most. It’s certainly very subjective, depending on many personal factors. In addition, the subject matter is complex, and the official guide it’s not for beginners. It doesn’t hold hands – no funny stories about pets or people – and there is no official practice exam, except for the ones provided with the official guide. Finally, the exam doesn’t take any prisoners; it’s really tough.

As with the other Specialties, you might get questions solely about the subject matter at hand, but many of them will be cross-domain: Security, Architecture, Cost, Compliance, DevOps … It’s not an exam for beginners, and you should hold, at the very least, an associate certification or the equivalent experience.

Don’t forget this exam – and the rest of the certifications – tests experience, not only technical knowledge, so if you don’t have it, you will need to make up for it.

The Exam

Sixty-five questions, multichoice, three hours – you know the drill.

A good surprise was waiting for me. I was expecting a new set of questions – one of my connections on LinkedIn mentioned it – and I got them. But I wasn’t expecting the exam to be so up-to-date! Really surprising, because I’d just finished a survey about the contents of the new revision of the exam.

Luckily, that wasn’t a problem because I prepare comprehensively, and networking seems to a big part of any project I work on.

The current revision goes beyond the official guide and updates services and scenarios. I have to say that the quality of the questions is higher than in previous incarnations: clearer and better wording and common real-life scenarios. Actually, I had faced most of them, so no unique special cases to trick you. However, that doesn’t mean they are easy. They are not. Some are lengthy, with similar responses, multi-choice …

The sample questions are very relevant, but (mostly) they don’t refer to the new services.

Sample question – Image property of aws.com

Happily, I passed and improved my score massively from last time, which it’s always nice ๐Ÿ™‚

After the exam, I went online and found a post on the AWS certification blog about the exam, discussing the contents, from April’ 21. So I’d guess this update is quite recent.

Areas of Study

I got the outlines from the original post by Nigel Harris – kudos, mate ๐Ÿ™‚ The contents are absolutely relevant for the exam. I’m adding my personal notes – in cursive – but check the original post for resources and the comments from the original author.

1. Edge network services

AWS LambdaLambda@Edge, Amazon CloudFront – Cloudfront is key; understand how it works with different origins. Remember, the RTMP distribution has been deprecated – mostly outdated content on the official guide – expand and review with other resources.

2. AWS global infrastructure and how to deploy foundational network elements

AWS Global Cloud Infrastructure, Virtual Private Cloud (VPC)

Dynamic Host Configuration Protocol (DHCP) configurations, route tables, network-access control lists (NACLs), and security groups.

NAT gateways (NGW), internet gateways (IGW), egress-only internet gateways (EIGW), and virtual gateways (VGW).

All basic stuff, you should know all that by heart if you are attempting the examโ€”good content on the official guide, but expand with other resources.

3. Hybrid network-connectivity options

VPNs, AWS Direct Connect – everything about them: technical specifications, scenarios, cost … good content on the official guide, but expand with other resources.

4. Inter-VPC connectivity options

VPC peering, AWS Transit Gateway – everything about them: technical specifications, scenarios, cost … outdated content on the official guide – expand and review with other resources. You should know about Transit VPC’s, though. It still appears on the exam, and you may have to deal with it in some project. If you don’t have real-life experience with the services, you should get some through laboratories or actual projects.

5. Automate network management using AWS CloudFormation

CloudFormation – got a few questions about it – good content on the official guide, but expand with other resources.

6.  Integrate VPC networks with other AWS services

AWS PrivateLink, Gateway Endpoints, Interface endpoints – everything about them: technical specifications, scenarios, cost … good content on the official guide, but expand with other resources. If you don’t have real-life experience with the services, you should get some through laboratories or actual projects.

7. Security and compliance

CloudFront and AWS Web Application Firewall (WAF)

IPAA, EU/US Privacy Shield, and PCI.

Mostly outdated content on the official guideexpand and review with other resources.

8. Methods to simplify network management and troubleshooting

VPC flow logs, access logs for your application load balancer, and CloudFront logs.

Traffic Mirroring

Mostly outdated content on the official guideexpand and review with other resources.

9.   Network configuration options for high performance applications

Placement groups, jumbo frames, and elastic network adapters.

Good content on the official guide, but expand with other resources.

10. Designs for reliability

AWS Well Architected Framework

Amazon Route 53 and AWS Global Accelerator 

Amazon VPC  AWS Elastic Load Balancing

Amazon CloudWatch

Mostly outdated content on the official guide, so expand with other resources. All those services are key, so make sure to get some real-life experience with them through laboratories or actual projects.

AWS Network Firewall, one of the latest additions – Image property of aws.com

New Revision is Coming

As I mentioned previously, while I was preparing for the recertification, I got an invitation to a survey about the contents of the new revision of the exam.

The thing is, the exam it’s updated. However, the official guide is not. So I’d guess this will be an opportunity to deliver a new guide and training content.

The new contents seem similar to the present incarnation, reducing the domains from five to four, adding new services, increasing security content, networking performance, reliability and monitoring. Potentially, there might be laboratories as well. The exam’s not getting any easier, that’s for sure ๐Ÿ˜‰

I’d guess we may get a beta at the end of the year, looking forward to it!

Virtual Days 2021 – Migrating Apps to AWS

0

Last Wednesday, 19/05/2021, I attended one of AWS’s Virtual Days that are being organized regularly. This time was about Migrations, which it’s a hot topic in the Enterprise right now. Sometimes it feels like everything is about Machine Learning or other sideline subjects. Still, in reality, most big projects are about migrating apps from on-premises environments to the cloud.

The Virtual Day was organised about the following subjects:

  • Re:host and Re:platform
  • Migration of Analytics workloads from on-premises.
  • Data Migration Service.
  • Migration of SAP workloads.

Image property of aws.com

I wanted to share some takeaway points from Day II, as I missed Day I, which I can only presume was about Lift & Shift tools and operations, which AWS has extensively covered. Services like AWS Application Migration Service – console version of Cloud Endure – or AWS Migration Hub are extremely comprehensive and cutting edge, on tops of classic services like Storage Gateway or the Snow family.

The takeaways points are very personal, so if you have additional questions, you can send me an e-mail from the contact page.

  • APP2Container
Image property of aws.com

A handy tool for analyzing and containerizing Java and .NET apps. My experience with the tool it’s very positive and can really accelerate the migration of existing applications as it generates several artefacts for services like ECS and Kubernetes.

  • Data Analytics

This part of the webinar was really technical and covered a wide range of topics – I can’t complain, though ๐Ÿ™‚

Image property of aws.com

I’m going to highlight two services: AWS Lake Formation and AWS Glue Studio.

Lake Formation is an interesting service that I think has a lot of potential for the future. Actually, new features are on the way; we’ll see the direction that it takes.

At the moment, the most interesting feature is the centralized granular set of permissions to manage the data sets securely. It took me some time to get around it, but after that worked very well.

AWS Glue Studio looks interesting, but I haven’t used it just yet.

  • Database Migration Service

Very well known service and interesting webinar. The only point to highlight is the extensive catalogue of sources and destinations.

  • SAP Workloads

My experience in SAP workloads is minimal, so I was really impressed with AWS’s coverage of the subject. Exciting webinar.

Image property of aws.com

Impressions about the Google Professional Cloud Architect Beta – and other ramblings

0

The past 15th of March, I sat down at Google’s Professional Cloud Architect Beta, so I’d like to share some of my thoughts now that some time has passed.

If you haven’t taken any Google’s certification before, let me tell you that this test could be very different from your expectations. This is not a highly technical exam-focused, just on architecture scenarios. To understand it better and get a contrast, let’s explore another vendor’s version of the test first.

AWS’s version

You are presented with seventy-five questions-scenarios, highly technical and mostly based on their tech. It’s a challenging test, where you need to know many of the platform’s technical intricacies. As with Google’s, I think it reflects the culture and their idea of architecture; in this case, highly specialized in the vendor’s technologies; don’t get me wrong, it’s challenging and a lot of fun. I allocated around nine months to take on that certification, and I had experience with the platform since 2010. The thing is, working for AWS probably’s like that. I had some experienced with them last year, and they were highly specialized in certain areas and technologies.

What’s the problem with that approach? I think that type of certification is confusing many. AWS is very clear, though; you’d need “Two or more years of hands-on experience designing and deploying cloud architecture on AWS”. This is a professional test and means that you should back that certification with professional experience because the exam is only a highly abstract version of the job’s technical side. You are supposed to have the soft skills, broad experience in different technologies and industries, and the intuition that comes with the job to succeed in real life.

Most architectures don’t live in a vacuum, and any change requires a lot of technical work – usually integrating with other technologies. But no company or customer it’s going to take your proposal at face value. Still, a lot of discussions with different teams, questions, presentations, budgets, validations, certifications will happen even before you could do any change … in a few words, it’s not all about knowing the technical side of things; sometimes, it’s the easiest part.

I get many messages from people from other fields and even other industries – Finance, Entertainment, Hospitality – that reversed the process. They took the certification with little experience in Cloud or Architecture, and now they can’t find a job. Why? Because you are missing many other skills, and some you’d need to get at the job. It’s an organic process.

Google’s version

I’m discussing the Beta version of the test, but I don’t think the final version will be very different, at least in the core values. I think this test pushes you to show the experience as an Architect as a whole, not just the technical side of things. So it can be a more difficult exam than AWS’s, even though it could be seen as easier on the surface as you don’t get that many complex scenarios with multi-choice answers that look very similar.

  • You will get questions reflecting Google’s SRE culture. Some of them just about that with not other aspects involved. I was surprised to find questions delivered in that way in an Architect test.
  • You will get questions including other technologies and, of course, about Open Source, again reflecting the vendor’s culture: Istio, Terraform, Vault, Github,Kubernetes and Google’s offering, GKE, are always present, and this test is no exception. This relates directly with my main complaint about AWS’s take, which leaves containers underrepresented in their certifications, not only Kubernetes – non-existent – but also with their own technologies, meaning Fargate or EKS, which are very cool.
  • You will get typical questions about classic Computing and Storage, nothing really stands up there as extremely difficult.
  • You will get many questions about Networking, Security, Compliance, APIS, Serverless and their no-ops container offering Cloud Run. Definitely, a step-up in complexity and scope. Without a good knowledge of Networking and Security, I think this test could be challenging to pass.
  • You will get questions about Data Analytics, Machine Learning and tools: Tensorflow, AI Platform, DataFlow, Pub/Sub, DataPrep, DataStudio … not many and not especially difficult. I was expecting more questions of this type, to be honest.
  • You will get questions about the case studies. There are now four of them, two new and two up-to-dated. In the beta, there were like 20 to 25 questions, and they were really challenging. Don’t expect a simple selection between technologies. They are questions related to certain aspects of the system, technical or business, and are not straightforward. It could be Security, Networking, SRE, Compliance, Computing … In my case, I struggled because I got the two up-to-dated scenarios linked to the old spec; I guess that was a glitch in the beta exam. So I picked up questions based on the best possible answer to the related scenario using what I remembered. In any case, it’s the most difficult part of the test – at least in the beta.

Conclusion

Overall, I think it’s a good and challenging update that now ranks high in terms of difficulty and reflects a bit better the Architect’s job – and Google’s take on it.

AWS Innovate – AI/ML Edition Takeaways

0

The past 24th of February, I attended the AWS Innovate – AI/ML Edition, Technical Decision Maker Track; it was an exciting event, so I’d like to share some quick takeaways:

๐Ÿ“Œ Scaling ML as a Journey; 7 fundamentals steps: Culture, Team Enablement, Data Strategy, PoC, Repeatability, Scale, Evolution.

๐Ÿ“Œ S3 strong after-read-consistency: was introduced at last re:Invent, but now I had time to check it out properly. It’s an essential feature for migrations or Data Lakes to ensure having the latest version of documents or files.

๐Ÿ“Œ New AWS AI Services such as Amazon Lookout for Vision: also introduced at last re:Invent; again, now I had the chance to try it. It seems very appropriate for industrial applications, such as finding defective parts.

๐Ÿ“Œ The proper way to architect AWS ML Apps: ML Lens

๐Ÿ“Œ Secure Machine Learning for Regulated Industries: I especially enjoyed this presentation, quite hand-on and lots of RL security practices for Sagemaker.

I’m still going through the other tracks, so expect a full post in the coming weeks.

Image property of aws.com

GCP – Introducing GKE Autopilot

0

It’s no secret the huge revolution that Kubernetes has ignited for the Industry since Google introduced it back in 2014, so I’d guess we don’t need to go there.

The GCP offering for Kubernetes is GKE, which provides a fully managed environment for orchestrating and deploying containers in the cloud.

Image property of gcp.com

GKE now is offering two operation modes:

The Standard operation mode is managed, but the infrastructure is configured and handled by the customer: needs configuration for scaling and node provisioning – provides a lot of flexibility.

Image captured from the console by the author

Autopilot mode has been introduced to provide a full and streamlined NoOps experience: GKE fully manages the infrastructure. The nodes provisioning and the scaling are automatically handled for you – no more worries about the master and working nodes. You’d lose some flexibility, though, but that’s the usual compromise.

Autopilot Cluster – Image property gcp.com

Creating a cluster with Autopilot

Image captured from the console by the author

I initially created a cluster in europe-north-1, but I got some problems deploying the pods to the cluster, so I changed it to usa-north, and it worked – guess some region limitations at the moment some transient problems.

Image captured from the console by the author

The cluster has been created, now we need to deploy some pods – Image captured from the console by the author

After creating the cluster, I deployed a basic web container with a web service but no node configuration, which speeds and simplifies the provisioning.

Per the documentation, Autopilot applies the following values for the pod’s resources:

Finally, I created a service to expose the endpoint to the world. I selected the balancer type because Autopilot doesn’t allow ExternalIps; alternatively, you could use an Ingress service.

Working cluster, 3 nodes + balancer – Image captured from the console by the author

And that’s all; our web app is ready. Autopilot provisioned automatically three nodes using e2-medium machines. After invoking the service a few times, the allocated resources were low, as shown in the image above.

I need to do load testing – and cost calculation – with a complex application and see how the autoscaling behaves. But my initial impression it’s excellent: it can’t be easier to provision a Kubernetes cluster. Read more about it in the GCP’S blog.

error: