/nanodt

Nano Distributed Table

Primary LanguageCGNU Lesser General Public License v2.1LGPL-2.1

nanodt: Nano Distributed Table (v2.0)

Tabla de contenidos

Initial non-distributed service

Compile

$ cd centralized
$ make
gcc -g -Wall -c app-c.c
gcc -g -Wall -c lib.c
gcc -g -Wall app-c.o lib.o  -o app-c

Execute

$ ./app-c
set("nombre", 1, 0x123)
get("nombre", 1) -> 0x123

Arquitecture

sequenceDiagram
    app-c   ->> lib.c: request lib.h API
    lib.c   ->> app-c: return result of API call
Loading

Distributed service based on mqueue (POSIX queue)

Compile

$ cd distributed-mqueue
$ make
gcc -g -Wall -c app-d.c
gcc -g -Wall -c lib-client.c
gcc -g -Wall -c lib.c
gcc -g -Wall -lrt app-d.o lib.o lib-client.o       -o app-d  -lrt
gcc -g -Wall -c lib-server.c
gcc -g -Wall            lib.o lib-client.o lib-server.o  -o lib-server  -lrt

Execute

TIP: POSIX queues are used for communicating processes in the same machine

StepClientServer
1
$ ./lib-server
2
$ ./app-d
d_set("nombre", 1, 0x123)
d_get("nombre", 1) -> 0x123

 1 = init(nombre, 10);
 1 = set(nombre, 1, 0x123);
 1 = get(nombre, 1, 0x123);
3
^Caccept: Interrupted system call

TIP: POSIX queues can be visible from command line:

sudo mkdir /dev/mqueue
sudo mount -t mqueue none /dev/mqueue
ls -las /dev/mqueue

Arquitecture

sequenceDiagram
    app-d          ->> lib-client.c: request lib.h API in a distributed way
    lib-client.c   ->> lib-server.c: request remote API
    lib-server.c   ->> lib.c: request lib.h API call
    lib.c          ->> lib-server.c: return API call result
    lib-server.c   ->> lib-client.c: return remote result
    lib-client.c   ->> app-d: return result of the distributed API call
Loading

Distributed service based on sockets

TIP: Before execute in two different machine please update the server IP address in lib-client.c

Compile

$ cd distributed-sockets
$ make
gcc -g -Wall -c app-d.c
gcc -g -Wall -c lib-client.c
gcc -g -Wall -c lib.c
gcc -g -Wall  app-d.o lib.o lib-client.o       -o app-d
gcc -g -Wall -c lib-server.c
gcc -g -Wall            lib.o lib-client.o lib-server.o  -o lib-server

Execute

StepClientServer
1
$ ./lib-server
2
$ ./app-d
d_set("nombre", 1, 0x123)
d_get("nombre", 1) -> 0x123

 1 = init(nombre, 10);
 1 = set(nombre, 1, 0x123);
 1 = get(nombre, 1, 0x123);
3
^Caccept: Interrupted system call

Arquitecture

sequenceDiagram
    app-d          ->> lib-client.c: request lib.h API in a distributed way
    lib-client.c   ->> lib-server.c: request remote API
    lib-server.c   ->> lib.c: request lib.h API call
    lib.c          ->> lib-server.c: return API call result
    lib-server.c   ->> lib-client.c: return remote result
    lib-client.c   ->> app-d: return result of the distributed API call
Loading

Additional information