This blog moved to medium->https://medium.com/@cocoamaemae

Thursday, December 6, 2018

Front End Development Tools

TaskRunner

Tool executing multiple tasks by only one execution. Tasks are like CSS preprocessor, Transpire, Module Bundler, etc...

e.g.
webpack
grunt
gulp

Module Bundler 

Tool stitching together a group of modules and their dependencies.

e.g.
webpack
browserify


Transpiler

The tool that read source code and written in one programming language.

e.g.
Babel
AltJS







Thursday, November 8, 2018

Kubernetes words

Kubernetes words


Node
Virtual machine or physical server.

Cluster
It means at least one master node and one node server.

Pod
It means a group of containers more than one. Minimum unit which is enable to deploy

Service
It means aggregation of multiple pods.


Monday, October 22, 2018

Regarding URL encode

What's URL encode?

URL can be sent only ASCII characters over internet. When doing http request with query parameters, query parameters are needed to be encoded.  It is called as percent encoding. It is defined in RFC3986.

How to do URL encode

Basically encode only values in query parameters to avoid collision of keys and =.
e.g.
http://example.com/?key1=value1&key2=value2....

reference

https://www.w3schools.com/tags/ref_urlencode.asp
https://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters

Monday, October 8, 2018

MySQL, MariaDB partitioning

What is partitioning?

The structure which divides one table data to multiple data.
When not using partitioning, one table data is aggregated to one file. On the other hand, when using partitioning, one table data is divided to multiple files. Especially table which is referenced can focus on and select performance can be improved. Also, deleting unnecessary data is easier.

There are vertical partitioning and horizontal partitioning, but explains regarding horizontal partitioning in this section.

Regarding MySQL, partition functionality is attached from 5.1
Regarding MariaDB, partition functionality can be used from initial version, 5.1

Assumption of using partition

The used column needs to have primary key.

Kind of partitioning

Range

Specify range of column value.
e.g.
CREATE TABLE sample_table (
    id int NOT NULL,
    day DateTime NOT NULL
    ) ENGINE=InnoDB
    PARTITION BY RANGE (id) (
    PARTITION p0 VALUES LESS THAN (3),
    PARTITION p0 VALUES LESS THAN (4)
)

List

Specify data list of column value.
e.g.

CREATE TABLE sample_table ( id int(2), day DateTime Not NULL ) ENGINE=InnoDB PARTITION BY LIST(id)( PARTITION p1 VALUES IN (1,2), PARTITION p2 VALUES IN (3,4,5));


Hash

RDBMS engine calculates hash and divides automatically.
e.g.
CREATE TABLE sample_table (
   id int(2),
   day DateTime NotNULL
 ) ENGINE=InnoDB
    PARTITION BY HASH(id)
    PARTITIONS 10;
;

Key

Specify more than one keys(primary or unique), and RDBMS engine create hash and divides automatically.
e.g.
CREATE TABLE t4 (
   id int(2) PRIMARY KEY,
   day DateTime NOT NULL
 ) ENGINE=InnoDB
    PARTITION BY KEY()
    PARTITIONS 10;
;





Monday, September 17, 2018

The reason why DB clustering need 3 nodes

Brief

Consider regarding database clustering consists of 3 nodes basically.

Database clustering which needs 3 nodes at least

  • Redis
  • MariaDB Galera Cluster
  • etcd
  • Consul
  • influxdb

Regarding distributed system, there is CAP theory.
  • Consistency
  • Availability
  • Partition Tolerance
In these features, Partition Tolerance is the biggest factor which defines the default number of database clustering.

If there were 3 nodes and split them, selected majority and continues to work.


If there were 4 nodes and split them, can not select majority and continue to work.
In the view of Partition Tolerance, database clustering needs 3 nodes at least. If increased nodes, the number of nodes would be odd number naturally.

Remark

There are database clustering which do not need.
  • Apache cassandra
  • Basho riak
  • Aerospike



Sunday, August 19, 2018

Comparison of Daas, Iaas, Paas, Saas, Faas, Baas, Caas


Brief

Recap regarding *aas
  • Daas
The abbreviation of Desktop as a service or Data as a service.
    • Desktop as a service
The service provides PC's desktop functionalities through internet.
    • Data as a service
It provides data management system via internet.

  • Iaas
The abbreviation of Infrastructure as a service.
The service provides physical infra like server body, unit, room or etc. Users have to configure layer above OS.

e.g.
AWS EC2
GCP CE
MS Azure

  • Paas
The abbreviation of Pratform as a service.
The service provides what is same as Iaas, and also provides OS. Users have to configure layer above FW.  *FW in paas is often limited by vendors.

e.g.
Google App Engine
Herok
Cloud Foundry

  • Saas
The abbreviation of Software as a service. Basically accessed by users a thin client via a web browser.

e.g.
Gmail
SAP
Saleceforce

  • Faas
The abbreviation of Function as a service.
The service provides small functionalities via webAPI. Mainly for application developers.

e.g.
AWS Lamda
Google Cloud Function

  • Baas/MBaas
The abbreviation of Backend as a service/Mobile backend as a service. It provides
functionalities for mobile application development.

e.g.
Fii
Firebase
  • Caas
The abbreviation of container as a service

e.g.
GKE
ECS
PKS


Wednesday, August 15, 2018

Proxy and Reverse Proxy


  • Proxy
- Server installed between intranet and internet.
- Client PCs access to internet through proxy.
- Web servers could see only proxy IP address as request originated.
- It is called as forward proxy as well.


  • Reverse Proxy
- Server installed in front of multiple web servers.
- Receives http requests instead of web servers.
- It has L7 load balancer functionality and distributes http requests.
- It has cache server functionality as well. Cache web contents like html, css, javascript, xml or etc and return them instead of web servers only if they were not changed after cached.

Friday, August 3, 2018

Performance Test Terms



  • throughput
the amount of material or items passing through a system. In general, throughput is the below.
    • tps transaction per sec. definition of transaction is different with the projects.
    • PV/s  page view per sec



  • elapsed time

time that elapses before all the response returns after request

  • latency

time that elapses before the first response returns after request

Tuesday, July 24, 2018

How to make SPA stronger against SEO

Brief

Considering regarding how to make SPA stronger against SEO

Issues

If introduced SAP, the below issues could be considered.

  • It's not obvious if web contents updated dynamically is evaluated or not in accurate.
  • Google web crawler does not evaluate JS

How to solve

  • SSR(Server Side Rendering):  Using node.js or etc.., and execute front end process in server side.
  • Prerendering: Using cui browser, and return contents rendered in server side in advance.

Wednesday, July 11, 2018

kubernetes begining

Brief

By spread of container technology like Docker, it was easy to solve dependencies  of libraries, applications and files among servers. Also, container technology makes it easy to migrate resources.
Next problem is management of containers. If there are just only several containers, managing is not so difficult. But increasing the number of containers, it makes managing more complex.

What's Kubernetes?

Kubernetes is one of the operation tools of container clustering and called as container orchestration tool. It is developed to solve the above container management problems. Google is developing.
It has functions of container operation like auto deploy, storage mount, health check and getting logs or etc...





Sunday, May 6, 2018

Numa Architecture and innodb_buffer_pool_size

Event
e.g.
The machine spec
the number of processors: 2
RAM: 32GB

MySQL configuration
innodb_buffer_pool_size = 24GB

If these configurations, Numa architecture divide RAM each16GB. But innodb_buffer_pool_size is over 16GB, so there is possibility that swap occurs.
This event is called as "Swap Insanity".

How to solve

  • Deactivate Numa
  • Decrease innodb_buffer_pool_size

etc...

Reference
http://d.hatena.ne.jp/fat47/20121121/1353495937



Numa Architecture

What's Numa Architecture
Numa is the abbreviation of "non-uniform memory access".
The objective of Numa is parallelization of *bus.
Numa is an alternative approach that links several small *nodes.

*bus to connect between cpu and RAM.
*node means a pair of processor and RAM.

Features
If Numa architecture is adopted, RAM is divided by the number of bus and accessed.

e.g.
If there are 2 buses on the machine which has 32GB RAM, RAM is divided per 16GB and accessed.



Sunday, April 29, 2018

ReactJS Features

Brief
Consideration regarding ReactJS merit and demerit

ReactJS Features

  • JSX is essential


ReactJS Merit

  • Rendering speed is faster than ordinary template engine.
  • Writing logic per a html part is reused.


ReactJS Demerit

  • Not good at Ajax
  • It's not suitable for the pages which do not have many dynamic contents.
  • Rendering speed is slower than JQuery optimized.

Monday, April 2, 2018

Multi process and memory segment

Brief
Explain memory condition in multi process

There are a parent process and several child processes in multi process.
All the process share parent process text segment and refer same memory domain.
On the other hand, data segment is copied by each child processes.
Global variables are not shared in each data segments.


Basic memory segment explanation is below.
https://cocoamaemae-tec-diary.blogspot.jp/search?q=memory


Reference
http://moro-archive.hatenablog.com/entry/2014/09/11/013520
https://teratail.com/questions/15389
http://ts0818.hatenablog.com/entry/2015/09/23/191335

Monday, March 12, 2018

Linux Load Balancer Comparison

Brief
Investigation and comparison of Linux Load Balancer

LVS(Linux Virtual Server)
Layer 4 load balancer (make it to possible to load balance by IP addresses)

LVS is a software which enable to make a Linux server a load balancer.

Haproxy
Layer 7 load balancer (make it to possible to load balance by URL or HTTP header)

Nginx
Layer 7 load balancer (make it to possible to load balance by URL or HTTP header)

Sunday, February 11, 2018

Key points of objected oriented design

Brief
Recap key points when using object oriented design and writing codes.


Complete constructor pattern

  • Configure essential information when creating constructor 
  • Not specify arguments of methods as possible as it can. 
  • If member variables are considerably increased, extract new classes.

First class correction
  • Recap related methods or logics and fields to one class 

Tuesday, February 6, 2018

Regarding normalization

What's normalization?
Divide RDB tables to satisfy functional dependencies.

Why normalization is necessary?
Merits

  • Possible to avoid the inconsistency when updating tables
  • To understand meanings of respective tables easier

Demerits

  • Increase JOIN and reduce SQL performance since the number of tables increase

Which normalization should be done?
Basically, it should always be done untill third normalization.




Sunday, February 4, 2018

The difference with web server and application server

Brief

Clarify about the difference with web server and application server.

Web server

web servers are just to handle http requests and return static contents(HTML, CSS, JavaScript) if there are no dynamic processes.
If there are dynamic processes, execute programs like PHP or Perl by using any modules or pass requests to an application server.

e.g.
Apache, Nginx, IIS


Application Server

application servers handle requests from web servers and run programs like Ruby or Java, and response to web servers.

e.g.
Ruby on rails environment
Passenger, Unicorn

Java Servlet environment
Tomcat(*), Glass Fish
(*)Tomcat has a function as web server, too.

Tuesday, January 30, 2018

Strange Questions for Job Interview


  1. Why Are Manhole Covers Round?
  2. After snow melt, what's happened?
  3. What is distribution amount of toilet paper in Japan?
  4. What is your secret taste of curry?

Tuesday, January 23, 2018

Ordinary Questions in Coding Interview


  1. Calculate fibonacci value X
  2. Determine X if prime factor or not
  3. Reverse order of array
  4. Fizz Buzz

Front End Development Tools

TaskRunner Tool executing multiple tasks by only one execution. Tasks are like CSS preprocessor, Transpire, Module Bundler, etc... e.g. ...