-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtutorials.html
479 lines (477 loc) · 22.5 KB
/
tutorials.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 2.0.10">
<meta name="description" content="Cloud Framework for fault-tolerant distributed processing with dynamic load balancing">
<meta name="keywords" content="tutorial, cloud, private cloud, framework, erlang, fault tolerant, distributed systems, embarrassingly parallel, divide and conquer, cloudi">
<title>CloudI User Tutorials</title>
<link rel="stylesheet" href="style_adoc.css">
<!-- Open Graph Protocol (OGP) with LinkedIn requirements -->
<meta property="og:title" content="CloudI: A Cloud at the lowest level - Tutorials" />
<meta property="og:description" content="CloudI is an open-source private cloud computing framework for efficient, secure, and internal data processing. CloudI provides scaling for previously unscalable source code with efficient fault-tolerant execution of ATS, C/C++, Erlang/Elixir, Go, Haskell, Java, JavaScript/node.js, OCaml, Perl, PHP, Python, Ruby, or Rust services.
The bare essentials for efficient fault-tolerant processing on a cloud!" />
<meta property="og:image" content="https://cloudi.org/images/cloud_ogp.png" />
<meta property="og:url" content="https://cloudi.org/tutorials.html" />
<meta property="og:type" content="website" />
</head>
<body class="article">
<div id="header">
<a href="index.html">
Cloud<span style="font-family:serif">I</span><img alt="Active Cloud" width="156" height="106" src="images/cloud.png" />
</a>
</div>
<br />
<div id="navigation">
<ul>
<li><a href="api.html">API</a></li>
<li><a href="faq.html">FAQ</a></li>
<li><a href="tutorials.html" class="active">Tutorials</a>
(<a href="tutorial_java.html">Java</a>)</li>
<li><a href="download" rel="noopener" target="_blank">Download</a></li>
<li><a href="https://github.com/CloudI/CloudI/tree/develop#readme">Source</a></li>
<li><a href="support.html">Support</a></li>
</ul>
</div>
<div id="header_document">
<h1>CloudI User Tutorials</h1>
<div class="details">
<span id="revnumber">version 2.0.7,</span>
<span id="revdate">2023-10-26</span>
</div>
<div id="toc" class="toc">
<div id="toctitle"></div>
<ul class="sectlevel1">
<li><a href="#why_use_cloudi">Why Use CloudI?</a></li>
<li><a href="#programming_language_cloudi_api_tutorials">Programming Language CloudI API Tutorials</a></li>
<li><a href="#cloudi_examples">CloudI Examples</a></li>
<li><a href="#guidelines_for_creating_a_cloudi_service">Guidelines For Creating A CloudI Service</a></li>
</ul>
</div>
</div>
<div id="content">
<div class="sect1">
<h2 id="why_use_cloudi">Why Use CloudI?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CloudI enforces fault-tolerance constraints on source code while allowing source code to be efficient and scalable.
With CloudI, you can create a system with Microservices that doesn’t require virtualization or vendor lock-in.</p>
</div>
<div class="paragraph">
<p>CloudI Frequently Asked Questions (FAQ) information that can provide more depth related to these concepts are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="faq.html#1_Microservices">Does CloudI provide a Microservice Architecture?</a></p>
</li>
<li>
<p><a href="faq.html#1_Messaging">How does CloudI compare to other open source messaging?</a></p>
</li>
<li>
<p><a href="faq.html#1_Clouds">How does CloudI compare to other "Clouds"?</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="programming_language_cloudi_api_tutorials">Programming Language CloudI API Tutorials</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The tutorials below focus on a single programming language to show that service development with CloudI only requires the use of a single programming language.
If a supported programming language doesn’t yet have a tutorial written yet, it is best to refer to the <a href="#cloudi_examples">CloudI Examples</a>.</p>
</div>
<div class="sect2">
<h3 id="java_tutorial"><a href="tutorial_java.html">Java Tutorial</a></h3>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cloudi_examples">CloudI Examples</h2>
<div class="sectionbody">
<div class="dlist">
<dl>
<dt class="hdlist1">All Supported Programming Languages</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/tree/master/doc#readme">Quick Start</a></p>
</li>
<li>
<p>Basic Count Integration Test</p>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/ats/v2/main.dats">ATS</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/c/main.c">C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/erlang/src/cloudi_service_test_count.erl">Erlang</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/gopath/src/count_go/main.go">Go</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/haskell/Main.hs">Haskell</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/java/org/cloudi/tests/count/Task.java">Java</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/count.js">Javascript/node.js</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/ocaml/main.ml">OCaml</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/CountTask.pm">Perl</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/count.php">PHP</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/count.py">Python</a> and <a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/count_c.py">Python/C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/count.rb">Ruby</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/count/rust/main.rs">Rust</a></p>
</li>
</ul>
</div>
</li>
<li>
<p>Basic HTTP Request Integration Test</p>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/ats/v2/main.dats">ATS</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/c/main.c">C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/erlang/src/cloudi_service_test_http_req.erl">Erlang</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/gopath/src/http_req_go/main.go">Go</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/haskell/Main.hs">Haskell</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/java/org/cloudi/tests/http_req/Task.java">Java</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req.js">Javascript/node.js</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/ocaml/main.ml">OCaml</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req.pl">Perl</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req.php">PHP</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req.py">Python</a> and <a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req_c.py">Python/C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/http_req.rb">Ruby</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/http_req/rust/main.rs">Rust</a></p>
</li>
</ul>
</div>
</li>
<li>
<p>Basic Message Size (Forwarding) Integration Test</p>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/ats/v2/main.dats">ATS</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/cxx/main.cpp">C++</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/erlang/src/cloudi_service_test_msg_size.erl">Erlang</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/gopath/src/msg_size_go/main.go">Go</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/haskell/Main.hs">Haskell</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/java/org/cloudi/tests/msg_size/Task.java">Java</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/msg_size.js">Javascript/node.js</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/ocaml/main.ml">OCaml</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/msg_size.pl">Perl</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/msg_size.php">PHP</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/msg_size.py">Python</a> and <a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/msg_size_c.py">Python/C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/msg_size/rust/main.rs">Rust</a></p>
</li>
</ul>
</div>
</li>
<li>
<p>Basic Messaging Integration Test</p>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/ats/v2/main.dats">ATS</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/cxx/main.cpp">C++</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/erlang/src/cloudi_service_test_messaging.erl">Erlang</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/gopath/src/messaging_go/main.go">Go</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/haskell/Main.hs">Haskell</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/java/org/cloudi/tests/messaging/Task.java">Java</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/messaging.js">Javascript/node.js</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/ocaml/main.ml">OCaml</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/MessagingTask.pm">Perl</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/messaging.php">PHP</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/messaging.py">Python</a> and <a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/messaging_c.py">Python/C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/messaging.rb">Ruby</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/messaging/rust/main.rs">Rust</a></p>
</li>
</ul>
</div>
</li>
<li>
<p>Basic Null Response Integration Test</p>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/ats/v2/main.dats">ATS</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/c/main.c">C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/erlang/src/cloudi_service_test_null.erl">Erlang</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/gopath/src/null_go/main.go">Go</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/haskell/Main.hs">Haskell</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/java/org/cloudi/tests/null_/Task.java">Java</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null.js">Javascript/node.js</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/ocaml/main.ml">OCaml</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null.pl">Perl</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null.php">PHP</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null.py">Python</a> and <a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null_c.py">Python/C</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/null.rb">Ruby</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI/blob/master/src/tests/null/rust/main.rs">Rust</a></p>
</li>
</ul>
</div>
</li>
</ul>
</div>
</dd>
<dt class="hdlist1">C</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/okeuday/sillymud">MUD Game Server Using CloudI</a></p>
</li>
<li>
<p><a href="https://github.com/okeuday/odroid_display">LCD Display Service</a></p>
</li>
</ul>
</div>
</dd>
<dt class="hdlist1">C++</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/tree/master/src/tests/hexpi#pi-as-a-hexadecimal-fraction">hexpi Map-Reduce</a></p>
</li>
</ul>
</div>
</dd>
<dt class="hdlist1">Erlang</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/CloudI/tree/master/examples#examples">Embedding CloudI Into An Erlang Project</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/CloudI#integration">Services Included With CloudI</a></p>
</li>
</ul>
</div>
</dd>
<dt class="hdlist1">Java</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/CloudI/cloudi_tutorial_java">Java Tutorial</a></p>
</li>
<li>
<p><a href="https://github.com/CloudI/cloudi_service_htmlunit">HtmlUnit Service</a></p>
</li>
</ul>
</div>
</dd>
<dt class="hdlist1">Python</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/okeuday/odroid_fish">UTF8 Fish Swimming</a></p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="guidelines_for_creating_a_cloudi_service">Guidelines For Creating A CloudI Service</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The information below can help guide your development of custom services with any supported programming language:</p>
</div>
<div class="sect2">
<h3 id="how_to_design_a_service">How To Design A Service</h3>
<div class="paragraph">
<p>Service creation requires splitting functionality based on capabilities so that functionality and its associated development risk is isolated.
However, the latency associated with the functionality should also be isolated within the programming language best suited to the task.
Part of the decision to isolate service latency is minimizing the amount of data that must be exchanged in service requests.</p>
</div>
<div class="paragraph">
<p>A common reason for creating a service is to isolate the risk associated with an external component that is sufficiently complex and is likely to require a variable amount of latency which needs to be managed as a unique entity to provide dependable processing (e.g., a large source code library, a database, a messaging bus, a filesystem, a third-party API, etc.).
It is also common to create separate services due to source code libraries existing in a separate programming language.</p>
</div>
<div class="paragraph">
<p>The simplest approach to service development, when creating a new service, is to develop the business logic that is necessary using as many services as required based on design requirements, basic testing, and benchmarking (if required), without isolating the use of external components.
Then, as risks are identified during development, functionality can be moved into separate services to manage source code that needs fault tolerance guarantees.
With this approach, the business logic will always have fault tolerance guarantees to keep all source code changes (which may include changing the external components used) isolated from other development during the lifetime of the business logic source code service(s).</p>
</div>
<div class="paragraph">
<p>The main data throughput to the business logic should utilize CloudI service requests for reliable timeouts and service redundancy.
Often the main data throughput is HTTP protocol usage coming from any of the provided HTTP servers (both cloudi_service_http_cowboy and cloudi_service_http_elli are Erlang CloudI services for HTTP servers).
The incoming HTTP requests are automatically load-balanced among the available services, based on the incoming URL path matching a service name pattern for a pool of service processes.</p>
</div>
<div class="paragraph">
<p>CloudI services provide process pooling automatically when their configuration has a <a href="api.html#2_services_add" target="_blank" rel="noopener">count_process or count_thread (of an external service)</a> greater than 1.
A CloudI service’s process pooling can be adjusted dynamically based on the incoming service request rate by using the <a href="api.html#2_services_add_config_opts_count_process_dynamic" target="_blank" rel="noopener">count_process_dynamic</a> service configuration option.
When a service request is sent it will automatically select a service execution process (which represents an external service thread within an OS process or an internal service Erlang process within the Erlang VM) randomly from those available, due to <a href="api.html#1_subscribe" target="_blank" rel="noopener">subscribing</a> with the same service name pattern.</p>
</div>
<div class="paragraph">
<p>Relying on this process pooling keeps services dependable and helps to reduce their potential complexity, since a service developer only needs to focus on developing serial source code.
The main exception to the pursuit of serial source code is due to the use of global state, which may require locking for consistency.
Ideally, the use of global state can be avoided in the service source code because global state usage naturally increases latency unless low-level atomic operations are used to avoid locking.</p>
</div>
</div>
<div class="sect2">
<h3 id="what_programming_language_should_be_used_for_service_development">What Programming Language Should Be Used For Service Development?</h3>
<div class="paragraph">
<p>The decision of what programming language to use is generally based on the knowledge of the developer.
The libraries that already exist and are known to be dependable will often determine which programming language to use.</p>
</div>
<div class="paragraph">
<p>If the system (the combination of services during development) will be sending service requests from many separate services or will be receiving service requests within many separate services, usage of separate programming languages for each separate service can increase the computational requirements for the system, or at least will be a service configuration task to determine based on the computing resources available.
External CloudI service instances (any CloudI service written in a programming language that doesn’t execute on the Erlang VM) can create more than one OS process, but must create at least one OS process, so that service memory is isolated and the service processing is fault-tolerant.
If the service request messaging is able to keep many separate external CloudI services busy the processing will be at the mercy of the OS kernel scheduler, which may make it easy to exhaust the computational resources available.</p>
</div>
<div class="paragraph">
<p>Controlling the potential service request latency with the selection of the programming languages can avoid prematurely exhausting computational resources.
A good approach is using as few programming languages that can reasonably be used for the business logic design.
Based on CloudI <a href="faq.html#5_LoadTesting" target="_blank" rel="noopener">loadtesting</a> (ordered based on average latency during the loadtest), service requests are handled with low latency in Erlang/Elixir, C/C++, OCaml, Java, Python/C, Haskell, Go (less than 6 milliseconds) and higher latency in Python, Ruby, Perl, PHP, Javascript/node.js (greater than 2000 milliseconds, when under high load) due to inefficiencies within the programming language runtimes.
By considering the latency requirements of the system early during development it will be easier to scale the deployment and avoid wasted development effort.</p>
</div>
<div class="paragraph">
<p>If a programming language that runs on the Erlang VM is used, it is possible to develop with finer-grained fault tolerance in an internal CloudI service due to the usage of Erlang processes (similar to user-level threads with isolated memory) by CloudI.
External CloudI services require that the memory used for execution of the service is isolated within an OS process and it is possible to hide an extreme amount of risk to reliability within a single external service instance, making this approach coarser-grained fault tolerance.</p>
</div>
</div>
<div class="sect2">
<h3 id="what_data_format_should_be_used_for_service_development">What Data Format Should Be Used For Service Development?</h3>
<div class="paragraph">
<p>CloudI’s service request and response data (i.e., request_info, request, response_info, response) is protocol agnostic, so any data format can be used for CloudI service communication.
External services can only receive data that is sent as a binary type in the programming language used for the service request send.
However, internal services can receive data of any type, though it is common to use binary types to allow the processing of service requests sent from external services.</p>
</div>
<div class="paragraph">
<p>If you require a "universal protocol" (i.e., a protocol that can encode types from any programming language and handle them transparently in other programming languages), you may be disappointed to find out that no complete solution exists.
If you approach the concept of a "universal protocol" as only handling the most minimal and common types available in programming languages, msgpack is a popular choice.
The data format should be based on the requirements and it may require a human readable format, with JSON as a popular choice.</p>
</div>
<div class="paragraph">
<p>There is nothing that prevents the usage of multiple data formats by a single CloudI service and typically a file extension suffix is used in the service name pattern to distinguish between different data formats.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>