Interface adalah sebuah layer dimana user / pengguna dapat berinteraksi. Misal sebuah handphone dimana ada tombol on off yang mana user dapat berinteraksi dengan tombol tersebut.

Berikut beberapa kegunaan interface :


Ok temans saat ini akan dibahas sekilas tentang go pointer. Berikut adalah gambar untuk pengertian sekilas tentang pointer, soalnya jika pakai tulisan aku masih agak bingung menjelaskannya.

Variable panjang memiliki alamat memori AAAAA1 dengan nilai FFFFF1 yang mana FFFFF1 adalah memory address / alamat memori yang memiliki nilai 10. Jadi variable panjang adalah sebuah pointer, karena nilai variable panjang adalah sebuah alamat memori yaitu FFFFF1.

Sebelum mengkoding lebih jauh, pertama harus memahami beberapa notasi / simbol yang perlu dipahami untuk bahasa pemrograman golang.


At this time i will make a tutorial how to deploy simple go application with minikube, before going further you can visit my old article

https://wahyu-ehs.medium.com/golang-and-mongodb-in-docker-cab7773c04ce.

At firs we need a simple go application and i have already made it, and can be downloaded from : https://github.com/wahyueko22/golang-app/tree/master/go-mongo

On the repo i created many configuration file for deploying application and mongoDB

About what is deployment, service, pv (kubernetes volume), pvc (kubernetes volume claim) please refer to kubernetes doc : https://kubernetes.io/docs/concepts/storage/persistent-volumes/

Required software for deploying go app with minikube :


Ok, at this time i will write about kubernetes. Kubernetes (K8s), K8s comes from the number of characters between K..s from word “Kubernetes”. K8S is orchestration deployment tool for containeryzation. For containerization like docker you can see my old article https://wahyu-ehs.medium.com/golang-and-mongodb-in-docker-cab7773c04ce.

Deployment process in k8s

Base above picture, the general flow of k8s deployment is devops creates config and inside the config we can define what application to be deployed and how many instance of deployed application. For example devops want to deploy 3 instances of a application :


Docker is one of the popular product for containerization. Docker is open source application and every one can learn docker by reading documentation.

Some terms in docker :

Image : image is result of building docker file, may be in java programming, it is similar to .jar or .war file

Container : container is running docker image, may be in java programming, it is similar to deployed war file in tomcat or wildfly or web logic. Deployed war in tomcat or weblogic is called container.

Step to create golang and mongo DB on docker :

a…


On this link https://wahyu-ehs.medium.com/install-nginx-on-ubuntu-and-create-reverse-proxy-9305753f727 have already written about nginx installation and simple reverse proxy. So at this time i will write simple setting load balancer using nginx, . What is load balancer ? load balancer is distributing request (usually web application request) to more than one instance application / more than one server. Load balancer will help us to scale up our web application horizontally. For simplicity, scale up horizontally is deploying application on more than one server. But at this time i will deploy my application on my single laptop, with difference port.

Here are the steps :


Based on https://httpd.apache.org/docs/2.4/vhosts/index.html The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine.

Next i will demonstrate how to make simple virtual host.

Follow the instruction on this link : https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-20-04

2. I prefer to change the default http port

Go to /etc/apache2/sites-available directory then $ sudo gedit 000-default.conf.

Change port 80 to be 8082

3. Create new directory on /var/www/html/. /var/www/html/ is base directory for project location

sudo mkdir telo.com

create new directory mypp

2. Copy jar to var/myapp


Nginx is one of application server similar to apache, but nginx gains more users lately compare to apache. As i understand apache is older than nginx, and apache architecture style is creating new thread on each request. Nginx is younger brother than apache that uses event driven similar to node js architecture, where use one thread but asynchronous and non blocking.

1. Install nginx on linux ubuntu 20.04

sudo apt updatesudo apt install nginx

After success we can check nginx status with command : sudo systemctl status nginx:

Another nginx syntax regarding start and shutdown :

sudo systemctl restart…

At this time, i will write about one technique for maintaining data integrity due to concurrency update on one record. It will use optimistic locking technique.

Based https://www.2ndquadrant.com/en/blog/postgresql-anti-patterns-read-modify-write-cycles/ article there are some technique to handle concurrency transaction :

ORM like hibernate uses @version (version annotation) on one of entity property as marking to do optimistic locking.

@version documentation : “Specifies the version field or property of an entity class that serves as its…

wahyu eko hadi saputro

i am a reader

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