CP3 in action

In this blog post I want to talk about APIs, and how to design your API when working with microservices.

Prerequisites:
1. Golanghttps://golang.org/doc/install
2. Protobuf compiler — https://grpc.io/docs/protoc-installation/

The project’s source code can be found here

Breaking the Monolith

Until fairly recently, the go-to approach to building applications was creating a single-tiered and indivisible unit that handles multiple related tasks. This is the Monolith pattern.

This pattern was by far the most common back then, it still works well in many cases and is still widely used in the industry today.

However, this approach has some drawbacks:
1. Your code base becomes…


Not only Dame Time but also Go Time

I wanted to publish this article during the early days of the NBA Playoffs, when Damian Lillard was balling. Although it’s a bit too late now, he still deserves a big shout out.

In this post we will review and deploy a golang application that follows the clean architecture principles.
Source code can be found here.

  • Update: 3.7.2021: Removed OpenAPI client generation because it didn’t help much (and I also had to write validations/errors manually), created request-response model instead.

Intro:

Most of us have probably worked on large projects where parts of the code were so difficult to extend, understand and sometimes even maintain. …


In this post I am going to cover some common cases and incidents that you are likely to experience when using goroutines and how to deal with them.

Table of contents:

Introduction
1. Waiting for the goroutines
2. Deadlocks
3. Getting unexpected results
4. Race conditions

Introduction

First, what’s a goroutine?

Golang is concurrent by nature.
To achieve concurrency, Go uses goroutines — functions or methods that run concurrently with other functions or methods.
Yes, even Golang’s main function is a goroutine!

goroutines can be viewed as lightweight threads, but unlike threads, they are not managed by the operating system, but by Golang’s runtime.


Introduction:

Around 9 months ago I started making the transition from Python to Golang, mainly due to the technology stack used in my company.

One difficult spot I found was mocking AWS services.
In this article I am going to demonstrate how to mock AWS services using Golang.

Motivation (Why do we even need to mock)?

In the previous article, I demonstrated how to build, deploy and test a Lambda with Python and Pytest.

During an application development life cycle we want to make sure that the code we write is working properly, and that we’re not breaking other components while adding new ones. …


Update 07.09.2020: Added an AWS DynamoDB.

In this article we will build, test and deploy an example lambda using SAM, Python3 and Pytest, while maintaining maximum code coverage, development velocity and simplicity.

Introduction:
AWS provides an open source framework for building serverless applications — Serverless Application Model.

SAM allows you to easily deploy lambdas on AWS, simplifies the process and saves you lots of time and headache with zipping, installing dependencies and etc.

Prerequisites:
Python3
AWS CLI
SAM CLI
pip packages: pip install pytest jq yq responses requests moto
An S3 bucket(s) to store the lambda artifacts

Why SAM?

While there are…

Reshef Sharvit

Backend Engineer

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