Codekrypt Compiler

Are you googling the questions “How to create a compiler in Java?”, “Tiny compiler in Java?”, “AST to Java bytecode”. Then you are in the right place. The word Tiny is subjective. But yeah, the code is simple enough to understand the end-to-end flow of compiler development.

There you go: Codekrypt Compiler Github

  1. Visitor Pattern
  2. Java ASM
  1. Lexical Analysis [String → Token ]
  2. Syntactic Analysis (ie Parsing) [ Token → AST ]
  3. Semantic Analysis [Validating AST]
  4. Optimization (Optional)
  5. Code Generation [AST → Java bytecode]

To keep it dead simple, we will be using the below grammar.

  • Our Program will…


API Gateway with Cognito

This is the second part of the series. Make sure you have read the first. Here we will see how to deploy API-Gateway and best use Open API Spec.

API-Gateway

  1. Get the Swagger Document (V2 or V3) for the service to be exposed.
  2. Create API → REST API (Import) → Paste the swagger document → Import
  1. If you find any issues like

Request header “Content-Type” is not being sent with request #1361

Try adding

2. Try verifying the Swagger Document by pasting it in the swagger editor.

  1. Create a VPC Link for the NLB created earlier. …


ECS Service via API Gateway

Today, let's see how to expose ECS Service via API Gateway. If you are looking for a simpler solution to expose your service via HTTPS Authorized endpoint, please read Integrate Spring Boot Resource Server with Cognito Identity Provider.

This will be two-part series, where I will talk about

  1. Setting up the AWS ECS Services with NLB
  2. Using Open API spec to publish API-Gateway and more.

Without further ado, let's dive in.

Pre-Requisite:

This is written under an assumption, that you have some experience in AWS services like ECS, CFT, VPC, API-Gateway, Cognito etc.

Spring Boot Service:

  1. Ensure that you have added health check dependency…


Appsync + Amplify

We will be learning how to integrate Appsyn with an Angular 7 App using Amplify. In the previous tutorial, I have shared some insights on Appsync subscriptions. Let's get started.

Download:

Please fork the complete project from my Github.

Project Structure


Appsync Subscription using WS

The major reason for trying out Appsync was to understand the benefits of Appsync realtime updates. In the previous article, we explore the Appsync AWS configurations in detail.

Background

We have already learned how to set up a subscription function which subscribes to updateVehicleLocation call. This subscription function accepts a particular ID and subscribes to the mutation happening(via updateVehicleLocation) to that ID.

State Subscription ( Query + Subscribe)

To subscribe to a state change, you need to make two calls in your web/mobile app.

  1. Query: To fetch the current/persisted state
  2. Subscribe: To get updates about the latest state changes.

Appsync + Amplify

They work well together. Amplify provides a functionality…


Appsync

If you are here, most likely you have heard about GraphQL. Appysync is an AWS Service built on top of Appollo GraphQL implementation.

This will be a multipart series where I show you:

  1. Intro to Appsync & AWS configurations
  2. Subscription in Appsync
  3. Angular 7 app integrated to Appsync

Without further ado, let's get started!

What is BFF?

Backend for Frontend(BFF) is the single general frontline API layer (Fascade) which our clients would be communicating to instead of making multiple API calls to fragmented microservices. It can be thought of as Alexa. Using VI (Voice Interface), you ask Alexa to send an email, turn…


In Part 1, we saw how to build uber/fat jar for our flink application. In this tutorial, we will cover how to deploy the app in KDA.

Pre-requisites.

  • Kinesis Stream
  • S3 Bucket
  • IAM Role

Let's create a Kinesis stream for feeding our Flink Application. You can also use Kafka or RabbitMQ as a source.

Deployment of flink application jar in KDA requires an S3 bucket (to act as a repository). We upload our jar into this S3 bucket and then point the KDA source to S3 Object URL. Let name the S3 bucket as appname-kda-repository-bucket-dev .

We need an IAM role…


KDA+Flink

Amazon Kinesis Data Analytics(KDA) now supports Apache Flink v1.11. So please skip the Flink 1.8.2 workaround mentioned in this article.

If you are here, you might have already heard of apache-flink. It is primarily used for distributed stream processing/aggregation. Amazon Kinesis Data Analytics (KDA) is a PaaS, where you can run your Flink application.

  1. Best practices for building your KDA Flink app. [Part 1]
  2. Deploying your Flink jar in KDA. [Part 2]

Download:

Please fork the complete project from my Github.

AWS Kinesis Data Analytics:

As mentioned, KDA is a Platform as a Service. KDA is Flink Cluster running on Fargate, which can scale based…


Did you know that Postman can be used to automate API Calls? Also, there is a brother of Postman, called Newman, which can run the same automates from the command line. Let's see this thing in action.

Download:

Please fork the complete project from my Github.

Postman Environment variables

You may want to run your automates with a different set of data, based on region, environment etc. In this case, you can create your script to read input value from environment variables, so that these values are externalized.


Liquibase integration with Spring boot

There used to be a time when we maintained database scripts separately.

Gone are those days, when we used to backup tables from one system and import it into yours, just to make the app run!

If you are here, you might have already heard of liquibase and flyway. Both are similar libraries, for DB Versioning.

Let's get started with liquibase.

Download:

Please fork the complete project from my Github.

Scope

The article will teach

  • How to create schema using liquibase
  • How to create table, and insert data using liquibase.
  • How to put liquibase tables, in your defined schema
  • How to write…

Arjun S K

Writes on Big Data, AWS & Backend technologies.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store