Archive

Archive for the ‘Others’ Category

Multitenancy


Definition

A multitenancy application is a software that can be utilized by more than one customers on single instance at the same time.

Single-tenancy

Single tenancy

Multi-tenancy

Multi tenancy

Requirements

The application should have following criterion to prove that it’s a multi tenancy product:

Customization

  • Extension on data model: this enable customer to add some additional fields on the data model. The added fields base on their own business needs. For operating purpose, the application needs the model must have some mandatory fields. Otherwise, rely to the business to have some added fields…. We are use JSON it’s a good way to extend the number of information
  • Workflow: They could be a sort of pre-defined workflows or the system must have a dynamic mechanism to allow customer to define their own business workflow. In our case, we use dynamic mechanism (BPMN with Inubit). That’s fine.
  • Access Control: customer should have a mechanism to manage their own users and permissions.
  • Branding: allow each customer to customize the look-and-feel to match their corporate branding. I think this is not a big deal. This capability depends on how much the application can be customized by customer.

 

Isolation:

  • Tenant: each tenant has its own domain, which other tenants cannot access
  • Data: each tenant can manage their own data in isolated manner. In RDBMS case, we can use
    • Separate database: each tenant has his own database to store the its data in multiple different schemas. In this case, application easily manage separate data-source object (connections, transactions, ORM) for a given tenant.
    • Separate schema: each tenant only occupies a sort of dedicated schemas.
    • Shared schema: different tenants could share a list of tables they located. The tables should have anything called discriminator to indicated which record associated to which tenant.
  • Execution: this mentions to the business workflow of a given tenant cannot be triggered or inhibited by other tenant.
  • Performance: No tenant has an impact on the performance of another tenant
Advertisements
Categories: Others

Differences between HTTP 1.0 vs HTTP 1.1

April 18, 2018 Leave a comment

Host field

HTTP 1.1 requires Host field by Spec

HTTP 1.0 doesn’t officially require Host header

GET / HTTP/1.1
Host: www.blahblahblahblah.com

Persistent connection

HTTP 1.0 considers a connection is persistent unless keepalive header is included

HTTP 1.1 considers all connections are persistent

Method OPTIONS

HTTP 1.1 introduces new method named OPTIONS

HTTP 1.0 doesn’t support this method

Response code 100

HTTP 1.1 uses response code 100 to continue the body and avoid big request payload

HTTP 1.0 doesn’t support this response code

Categories: Others Tags:

Spring Data JPA listen to Postgres notification

April 11, 2018 Leave a comment

Create trigger function

-- FUNCTION: public.table_update_notify()

-- DROP FUNCTION public.table_update_notify();

CREATE FUNCTION public.table_update_notify()
    RETURNS trigger
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE NOT LEAKPROOF
AS $BODY$
DECLARE
  id bigint;
BEGIN
  IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
    id = NEW.id;
  ELSE
    id = OLD.id;
  END IF;
  PERFORM pg_notify('employee_channel', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);
  RETURN NEW;
END;

$BODY$;

ALTER FUNCTION public.table_update_notify()
    OWNER TO postgres;

Create a trigger into table name employee

-- Trigger: employee_notify_update

-- DROP TRIGGER employee_notify_update ON production.employee;

CREATE TRIGGER employee_notify_update
    BEFORE INSERT OR DELETE OR UPDATE
    ON production.employee
    FOR EACH ROW
    EXECUTE PROCEDURE public.table_update_notify();

Now every time, table employee changed, it fire an event with payload is information of the change

Initialize the Spring Data JPA with spring boot starter

Categories: Others Tags: , ,

What is Hypervisor ?


What is Hypervisor?
Hypervisor (visor: còn gọi là tấm bảo vệ) là một software, firmware hay hardware giúp tạo và điều hành các máy ảo. PC mà trên đó hypervisor đang kiểm soát hoạt động của một hoặc nhiều máy ảo gọi là host machine. Mỗi máy ảo gọi là guest machine. Hypervisor kiểm soát các guest OS trên một nền tảng điều hành ảo (Virtual Operating Platform) và quản lý hoạt động của các hệ điều hành này. Các guest machine chia sẽ các hardware resource ảo.

Read more…

Categories: Others

What you should do when the arrow keys is locked in eclipse on Linux platform


When I use Eclipse IDE on a Linux machine, I usually encounter some problems when the arrow keys suddenly loose their effect. The enter and backspace key also is stuck by this way. It makes me angry and I often press these key many times to try to get out of this obstacle.
After many attempts, I can reproduce the case when this problem occur by these steps: Hover your mouse on a function to make eclipse show up its java doc popup window. Then you move your mouse and click inside that window to focus on that one. After that, you move the mouse out the java doc window and click on anywhere in the editor. By this way, the problem happens.

As my opinion, this is simply caused by the loosing of focus on your editor. The focus is still on the popup window.

With that cause, I find out the way to make the focus back on the editor. You can do something like: show up any more popup window (by right click on editor and select Quick Outline for instance) and then press Esc, the focus will back immediately and you can use your arrow keys as usual.

For conclusion: Right Click (on editor) -> Quick Outline -> press Esc key.

Categories: Others Tags:

How to face with cannot load hard drive error of VirtualBox

October 6, 2014 Leave a comment

Oracle Virtual Box is a very famous visualizer application with user and programmer in particular. As you know, one virtual machine has its own at least one virtual hard disk named with extension VDI located wherever on your real hard disk, supposed /home/thminh/tools/VirtualMachines as my case. One day, you start Virtual Box application as usual, you are taken notice with a pop-up like
Read more…

How to indicate the remote host’s os

February 26, 2014 Leave a comment

This post introduce how to find the remote machine(s) is Window or Linux in the system UI – Data Server – Equipment Service. In this case, if remote DS is Windows, you have to install Cygwin which simulate Linux environment on Windows, so you can execute the same command for both platform. After that, you will use plink application to get the output of command uname into a file, we check the file out and there is some key word for every operation system like: Linux (Linux) or Cygwin (Windows)
Read more…

Categories: Others Tags: ,
%d bloggers like this: