EXE
Synrc Research Center

       intro system overview
     prelude foundations
intermission business
        coda banking
TOC
Intro
Verified Concise
Distributed Performant Unikernel
   unikernel system overview
    verified foundations
     concise business
 distributed transactions
  performant erlang
Features
Unikernel
  Coq CoInductive Structures, Type Classes
 Agda Type Classes, CoInductive Structures
 Lean Polymorphic Stuctures, Type Classes
Idris Type Classes
   F* Type Classes
Verified
Concise
MAD 1K
FS 190
ACT 175
VZ 200
N2O 1.2K
KVS 1.2K
SHEN 220
NITRO 2.6K
MQS 288
BPE 625
FORMS 290
UPL 6K
LDAP 730
XA 2.2K
Voxoz  Synrc   Spawnproc
Distributed
PAXOS/RAFT latency
        CR traffic/linearizations
Goal: provable distributed algorithm
      of transactional processing
Amazon Europe
Performant
Prelude
Foundations


KVS N2O BPE
Semigroup Action
record app (P S : Type) :=
       (action  : P → S → E S)​
       (spawn   : P → S)
       (run     : S → P)
action — effect handler
     P — protocol
     S — state
Types and Effects
exception : rise
       io : read, write
    state : get, put
     comm : send, recv
      rnd : next
(action : P → Eff P )​
Inductive Records
definition ids       := option N
    record container := (top: ids) (size: N)
    record iterator  := (id: ids)
                        (next: ids)
                        (prev: ids) 
KVS
Abstract Term Database
> mnesia:activity(transaction, fun() ->
     kvs:append(#user{id=
     kvs:next_id("user",1)}) end).

[{get,container,_},
 {get,top,_},
 {put,iterator,_},
 {put,prev,_},
 {put,next,_},
 {put,container,_}].
Atomic
Versioning
> kvs:config(user).

[#in{l=902, r=infinity, name=user6, last=user2},
 #in{l=704, r=901,      name=user5, last=user2},
 #in{l=502, r=703,      name=user4, last=user2},
 #in{l=301, r=501,      name=user3, last=user},
 #in{l=200, r=300,      name=user2, last=user},
 #in{l=1,   r=199,      name=user,  last=user}]​
N2O
Protocol Multiplicator
N2O Stack
#deposit_app
#otp
25 Forms/Month
Ontological Model
Schema/Keys
Table/Record
Document/Forms
Validation/Fields
HTML
Protocols
Remote Protocol
BPE
BPMN 2.0 process management
BPMN 2.0
Definition

    action({request,'AcquirePhone'}, Proc) ->
        Phone = bpe:doc(#phone{},Proc),
        io:format("ACT Deposit Phone: ~p~n",[Phone]),
        bpe:val(Phone,Proc,fun valid/2);

    action({request,'CheckOTP'}, Proc) ->
        OTP = bpe:doc(#otp{},Proc),
        io:format("ACT Deposit OTP: ~p~n",[OTP]),
        bpe:val(OTP,Proc,fun valid/2);

    action({event,'Payment',Payment}, Proc) ->
        io:format("ACT Deposit Payment~p~n",[Payment]),
        bpe:val(Payment,Proc,fun valid/2);

    action({request,'CreateAccount'}, Proc) ->
        DepositApp=bpe:doc(#deposit_app{},Proc),
        bpe:val(DepositApp,Proc,fun valid/2,fun(Form,Proc) ->
            io:format("KVS Deposit Forms Store   ~p ~n",[Form]),
            kvs:add(Form),
            Account = #account{program=Form#deposit_app.program,type=deposit},
            io:format("ACT Deposit Create Account ~p ~n",[Account]) end);

deposit.erl​

Actions
Intermission
Business Applications
Deposits Processing

  program Deposit_Plus UAH
  include 'PB-CASHBACK.card'
  version 1
  deposit duration range monthly 1 -> 20%
                       monthly 3 -> 22%
                       monthly 6 -> 22%
                       annual 23%
           withdraw disabled
           auto
           charge enabled monthly limit max 20000
           monthly 1% of amount to account '/users/:client/bonus'
           recalculate move from rate to deposit
           monthly 15% name 'tax' of deposit to account 'users/:client/tax'
  accounts deposit 'users/:client/deposit'
           rate 'users/:client/rate'
Processing
ACT
#phone
#otp
#application
#termination
#transfer
#charge
#withdraw
#client
#payment

 

BPE
#process
#sequenceFlow
#messageEvent
#task
#serviceTask
#receiveTask
#userTask
#beginEvent
#endEvent
#history
DBS
#account
#customer
#program
#card
#transaction
#cashback
#currency
TPS
#prepare
#commit
#rollback
UPL
XA
KVS
#iterator
#container
#subscription
#user
#client
#config

 

N2O
#element
#action
#ev
#cx
Coda
Deposits Moneybox Services
Deposits
Processes: 7      13      18
    Forms: 32     61      101
   Panels: 2      7       16
Endpoints: 0      8       14
 Services: 0      20/30   26/60
12/14  06/15   12/15
Moneybox
Processes: 0
    Forms: 22
   Panels: 3
Endpoints: 4

12/15
Performance
Pipeline Basic
 Services Bank 8KLOC/800KB
Pipeline Basic 4.7KLOC/340KB
#otp           #ivr          #insider
#ekb           #grantset     #error
#promin        #iq           #timing
#p24           #wf           #doc
#validation    #cxp          #crm
#payment       #antifraud    #corezoid
PB
host(_) -> "https://services.privatbank.ua";
ato()   -> {{?MODULE,pb:host(?MODULE)},
           [{1,xml,post,?MODULE,{req1,ans1},2,
            "/api/deposits/backend"}]}.

req1([EkbID,Bank],Acc) -> {ok,pb:xml([]),Acc}.
ans1(XML,Acc) -> {ok,[],Acc}.

 

PB
    BPE   =  List
    JSON  =  Binary
    ACKS  =  Eff Data
Eff Data  =  {error,Data,NewAcc}
          |  {warning,Data,NewAcc}
          |  {erorrCode,Data,NewAcc}
          |  {ok,Data,NewAcc}

req   BPE   -> JSON
call  JSON  -> ACKS
ans   ACKS  -> BPE
PB
> pb:service(pb_otp:send(),[#phone{number="1"},#otp{code="1"}],1000,[]).

=INFO REPORT==== 12-Oct-2015::04:40:50 ===
pb:MOCK "text/xml" post "https://sms-inner.siteheart.com/api/otp_create_api.cgi"

{ok,true,
    [{ans1,<<"<?xml">>>},
     {call,<<"<?xml">>},
     {req1,[#phone{},#otp{}]}
PB
pipe(Params) -> req9 call ans9  
                req8 call ans8 
                req7 call ans7 $ Params.

    {ok,20,
     [{ans2,20},
      {call,<<"{"O">>},
      {req2,<<"{"O"">>},
      {ans1,[[],[],1,<<"00000001">>,site]},
      {call,<<"OpenResponse">>},
      {req1,<<"OpenRequest">>},
      {req,<<"OpenRequest">>},
      {id,<<"00000001">>},
      {sid,1},
      {channel,site}]}

Erlang in Business

By Maxim Sokhatsky

Erlang in Business

This talk is about SpawnProc Intermediary Processing Language UPL and Core Services BPE, DBS and FORMS.

  • 2,814