This repository has been archived by the owner on Mar 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcrud-limitations.html
736 lines (709 loc) · 29.9 KB
/
crud-limitations.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
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rethinking CRUD :: Cloudstate Documentation</title>
<link rel="stylesheet" href="./_/css/site.css?v-01">
<link rel="shortcut icon" href="./_/img/favicon.ico" />
<meta itemprop="name" content="Rethinking CRUD | Cloudstate Documentation">
<meta name="twitter:title" content="Rethinking CRUD | Cloudstate Documentation">
<meta property="og:title" content="Rethinking CRUD | Cloudstate Documentation" />
<meta property="og:type" content="website" />
<meta name="generator" content="Antora 2.3.3">
<link rel="canonical" href="https://cloudstate.io/docs/crud-limitations.html">
<meta property="og:url" content="https://cloudstate.io/docs/crud-limitations.html" />
<meta property="og:site_name" content="Cloudstate Documentation" />
<meta name="author" content="Cloudstate Documentation">
<meta itemprop="image" content="https://cloudstate.io/dist/images/cloudstate-distributed-state-management-for-serverless.png">
<meta name="twitter:image:src" content="https://cloudstate.io/dist/images/cloudstate-distributed-state-management-for-serverless.png">
<meta property="og:image" content="https://cloudstate.io/dist/images/cloudstate-distributed-state-management-for-serverless.png" />
<meta property="og:image:secure_url" content="https://cloudstate.io/dist/images/cloudstate-distributed-state-management-for-serverless.png" />
<!--Head Scripts -->
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="c3a30abe-4934-45a2-ba48-823fa026fc64" ></script>
<!--Head Scripts YouTube Embed-->
<script type="text/javascript">
var ytID;
function OptanonWrapper() {
//find each YouTube embed and only load if cookies have been approved
$( "a.yt-widget" ).each(function( index ) {
var anchor = $(this);
var ytURL = $(this).attr("href");
var queryString = anchor[0].search;
let params = new URLSearchParams(queryString);
ytID = params.get("v");
$(this).before('<div class="flex-video-wrapper"><div class="flex-video"><div id="yt-'+ytID+'" class="cookie-warning youtube-warning"><a class="optanon-allow-all" onclick="OneTrust.AllowAll();">Accept cookies to view video</a><span>Alternatively you can watch the video <a href="'+ytURL+'" target="_blank">here on YouTube</a></span></div></div></div>');
$(this).removeAttr("href").removeClass("yt-widget").addClass("yt-widget-hide");
});
$( ".youtube-warning" ).each(function( index ) {
OneTrust.InsertHtml('<iframe id="player" class="youtube-embed-player" src="//www.youtube.com/embed/'+ytID+'?rel=0&modestbranding=0" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>', 'yt-'+ytID, null, {deleteSelectorContent: true}, '4');
});
}
</script> </head>
<body class="article cloudstate">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://cloudstate.io">
<img class="header-logo" src="./_/img/cloudstate-reverse.svg">
</a>
<a href="https://cloudstate.io/docs/" id="site-id" class="site-id">Documentation</a>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<div id="lightbend-banner" class="lightbend-banner cloudstate full-width" data-category="OSS Lightbend Banner Impression" data-label="Cloudstate Banner Impression">
<div class="wrapper">
<div class="nav">
<a class="banner-btn oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Enhance your apps with Lightbend [Button] - Cloudstate Banner" href="https://www.lightbend.com/lightbend-subscription?r=oss-banner-cloudstate" target="_blank">
<span class="banner-btn-text">Enhance your apps with</span>
<img class="lightbend-logo" src="./_/img/lightbend-logos/lightbend-reverse.svg" alt="Lightbend" title="Lightbend">
</a>
<div class="drop-down">
<svg class="svg-chevon-circle-down" version="1.1" id="Chevron_circled_down" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<g>
<circle cx="10" cy="10" r="9" />
<path d="M12.505,8.698L10,11L7.494,8.698c-0.198-0.196-0.518-0.196-0.718,0c-0.197,0.196-0.197,0.515,0,0.71l2.864,2.807
c0.199,0.196,0.52,0.196,0.717,0l2.864-2.807c0.199-0.195,0.198-0.514,0-0.71C13.024,8.502,12.704,8.502,12.505,8.698z" />
</g>
</svg>
<div class="drop-down-content">
<div class="lightbend-family">
<a href="https://akka.io" class="akka oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Akka - Logo Tag Line - Cloudstate Banner">
<img class="akka-full-color-logo" src="./_/img/lightbend-logos/akka-full-color.svg" alt="Akka by Lightbend" title="Akka by Lightbend">
</a>
<a href="https://cloudflow.io" class="cloudflow oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Cloudflow - Logo Tag Line - Cloudstate Banner">
<img class="cloudflow-full-color-logo" src="./_/img/lightbend-logos/cloudflow-full-color.svg" alt="Cloudflow by Lightbend" title="Cloudflow by Lightbend">
</a>
<a href="https://www.lagomframework.com" class="lagom oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Lagom - Logo Tag Line - Cloudstate Banner">
<img class="lagom-full-color-logo" src="./_/img/lightbend-logos/lagom-full-color.svg" alt="Lagom Framework by Lightbend" title="Lagom Framework by Lightbend">
</a>
<a href="https://www.playframework.com" class="play oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Play - Logo Tag Line - Cloudstate Banner">
<img class="play-full-color-logo" src="./_/img/lightbend-logos/play-full-color.svg" alt="Play Framework by Lightbend" title="Play Framework by Lightbend">
</a>
<a href="https://www.scala-lang.org" class="scala oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Scala - Logo Tag Line - Cloudstate Banner">
<img class="scala-full-color-logo" src="./_/img/lightbend-logos/scala-full-color.svg" alt="Scala by Lightbend" title="Scala by Lightbend">
</a>
<div class="cloudstate current">
<img class="cloudstate-full-color-logo" src="./_/img/lightbend-logos/cloudstate-full-color.svg" alt="Cloudstate by Lightbend" title="Cloudstate by Lightbend">
<span>Get developer assistance and expert support from Lightbend.</span>
<a class="oss-track-link-label" data-category="OSS Lightbend Banner Clicks" data-label="Learn More [Button] - Cloudstate Banner" href="https://www.lightbend.com/lightbend-subscription?r=oss-banner-cloudstate" target="_blank">Learn More</a>
</div>
</div>
<div class="title">The Lightbend Family</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="main-wrapper">
<div class="navigation-container" data-component="" data-version="master">
<aside class="navigation">
<div class="panels">
<div class="navigation-menu is-active" data-panel="menu">
<nav class="nav-menu">
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="index.html">Introduction</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="stateless-limitations.html">Current limitations of Serverless platforms</a>
</li>
<li class="nav-item is-current-page" data-depth="2">
<a class="nav-link" href="crud-limitations.html">Rethinking CRUD</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="cloudstate-solution.html">The Cloudstate solution</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="working.html">Working with Cloudstate</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="examples.html">Example Applications</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="concepts/index.html">Important concepts</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="concepts/glossary.html">Glossary</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="concepts/grpc.html">gRPC</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="concepts/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="concepts/crdts.html">Conflict-free replicated data types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="concepts/effects.html">Forwarding and effects</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="develop/index.html">Developing Cloudstate services</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="develop/prerequisites.html">Prerequisites</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="develop/install.html">Installing Cloudstate</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="develop/gke.html">Run on GKE</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="develop/examples.html">Available Cloudstate examples</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="develop/tutorial.html">The shopping cart tutorial</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="dart/index.html">Implementing in Dart</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/gettingstarted.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/actions.html">Actions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/examples.html">Examples</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dart/serialization.html">Serialization</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="go/index.html">Implementing in Go</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/gettingstarted.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/effects.html">Forwarding and effects</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/serialization.html">Serialization</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="go/api.html">API docs</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="java/index.html">Implementing in Java</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/getting-started.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/effects.html">Forwarding and effects</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/serialization.html">Serialization</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="java/api.html">Java API docs</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="javascript/index.html">Implementing in JavaScript</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/getting-started.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/effects.html">Forwarding and effects</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/serialization.html">Serialization</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="javascript/api.html">JavaScript API docs</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="kotlin/index.html">Implementing in Kotlin</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="kotlin/gettingstarted.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="kotlin/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="kotlin/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-toggle"></button>
<a class="nav-link" href="kotlin/dsl.html">DSL</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="kotlin/eventsourceddsl.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="kotlin/crdtdsl.html">Conflict-free Replicated Data Types</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="kotlin/examples.html">Examples</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="kotlin/serialization.html">Serialization</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="python/index.html">Implementing in Python</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="python/gettingstarted.html">Getting started</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="springboot/index.html">Implementing in Spring Boot</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="springboot/gettingstarted.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="springboot/configuration.html">Configuration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="springboot/cdi.html">Context Injection</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="springboot/conventions.html">Conventions and Restrictions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="springboot/examples.html">Examples</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="dotnet/index.html">Implementing in .Net</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/gettingstarted.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/eventsourced.html">Event sourcing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/crdt.html">Conflict-free Replicated Data Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/actions.html">Actions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/examples.html">Examples</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="dotnet/serialization.html">Serialization</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="deploy/index.html">Deploying to production systems</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="deploy/install-production.html">Setting up a production cluster</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="deploy/deploying.html">Deploying stateful services</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-toggle"></button>
<a class="nav-link" href="deploy/stateful-stores.html">Stateful stores</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="deploy/cassandra.html">Cassandra</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="deploy/postgresql.html">PostgresSQL</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="deploy/inmemory.html">In memory store</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="deploy/monitoring.html">Monitoring</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="deploy/autoscaling.html">Autoscaling</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="deploy/security.html">Security</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-toggle"></button>
<a class="nav-link" href="contribute/index.html">Contributing to the project</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/architecture.html">Architecture</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/getting-started.html">Getting started</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/build-native.html">Building native images</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/serialization.html">Serialization conventions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/language-support.html">Language support</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/knative-integration.html">Knative integration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/graalvm-integration.html">GraalVM integration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="contribute/testing.html">Testing</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="navigation-explore" data-panel="explore">
<div class="context">
<span class="title">Cloudstate</span>
<span class="version">master</span>
</div>
<ul class="components">
<li class="component is-current">
<span class="title">Cloudstate</span>
<ul class="versions">
<li class="version is-current is-latest">
<a href="index.html">master</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="main">
<div class="toolbar" role="navigation">
<button class="navigation-toggle"></button>
<nav class="crumbs" aria-label="breadcrumbs">
<ul>
<li class="crumb"><a href="index.html">Introduction</a></li>
<li class="crumb"><a href="crud-limitations.html">Rethinking CRUD</a></li>
</ul>
</nav>
</div>
<div class="col-content">
<article id="page-content" class="doc">
<h1>Rethinking CRUD</h1>
<fieldset class="supergroup-switch">
</fieldset>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>We need to rethink the use of CRUD in Serverless. CRUD, in the general sense, means unconstrained database access, and is too broad and open-ended to be used effectively in Serverless environments (or any general Cloud development for that matter).</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/faas-crud.png" alt="FAAS with CRUD">
</div>
</div>
<div class="paragraph">
<p>Unconstrained database access means that the user function itself needs to manage the nitty-gritty details about data access and storage, and you are thereby moving all the operational concerns from the Serverless framework into the user function. Now it’s hard for the framework to know the intention of each access. For example:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Is the operation a read, or a write?</p>
</li>
<li>
<p>Can it be cached?</p>
</li>
<li>
<p>Can consistency be relaxed, or is strong consistency needed?</p>
</li>
<li>
<p>Can operations proceed during partial failure?</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Instead, if we understand these properties then we can make better decisions automatically. For example:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Write ops are fast and read ops are slow: add more memory to DB</p>
</li>
<li>
<p>Reading immutable values: add caching</p>
</li>
<li>
<p>Writes must be serializable: add sharding, single writers per entity.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="abstracting-over-state"><a class="anchor" href="#abstracting-over-state"></a>Abstracting over state</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We all know that constraints can be liberating and this holds true for Serverless as much as anything else. As a fact, one of the reasons for the success of Serverless is that it has such a constrained developer experience, which allows you as a developer to focus on the essence: the business logic for the function. For example, Serverless has a great model for abstracting over communication where all communication is translated to receiving and emitting events.</p>
</div>
<div class="paragraph">
<p>The question we asked ourselves was: can we abstract over state in the same way? Provide a clean and uniform abstraction of <em>state in</em> and <em>state out</em> for the function.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/abstract_over_state.png" alt="Abstracting over state">
</div>
</div>
<div class="paragraph">
<p>This would allow the framework to manage durable state on behalf of the function, to monitor and manage it holistically across the whole system, and make more intelligent decisions.</p>
</div>
<div class="paragraph">
<p>Unconstrained CRUD does not work in this model since we can’t pass the entire data set in and out of the function. What we need are data storage patterns that have constrained input/output protocols. Patterns that fall into this category are Key-Value, Event Sourcing, and CRDTs.</p>
</div>
<div class="paragraph">
<p>In <a href="https://martinfowler.com/eaaDev/EventSourcing.html">Event Sourcing</a>, <em>state in</em> is the event log while <em>state out</em> is any newly persisted events as a result of handling a command.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/data_model_event_sourcing.png" alt="Event Sourcing as data model">
</div>
</div>
<div class="paragraph">
<p>In <a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type">CRDTs</a>, <em>state in</em> is a stream of deltas and/or state updates, and <em>state out</em> is a stream of deltas and/or state updates.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="_images/data_model_crdts.png" alt="CRDTs as data model">
</div>
</div>
<div class="paragraph">
<p>In Key-Value, the <em>state out</em> is the key and <em>state in</em> the value.</p>
</div>
<div class="paragraph">
<p>While most developers have worked with Key-Value stores, Event Sourcing and CRDTs might be a bit unfamiliar. What’s interesting is that they fit an event-driven model very well while being on opposite sides of the state consistency spectrum, with the former providing strong (ACID) consistency (through event logging) and the latter providing eventual/causal consistency. Taken together, they give us a truly wide range of options for managing distributed state in a consistent fashion by allowing you to choose the optimal model for your specific use-case and data set. Akka Multi-DC log replication is a great example of combining the two techniques to do amazing things.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="whats-next"><a class="anchor" href="#whats-next"></a>What’s next</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Next, let’s see how Cloudstate addresses the needs of a stateful Serverless platform: <a href="cloudstate-solution.html" class="page">The Cloudstate solution</a>.</p>
</div>
</div>
</div>
<nav class="pagination">
<span class="prev"><a href="stateless-limitations.html">Current limitations of Serverless platforms</a></span>
<span class="next"><a href="cloudstate-solution.html">The Cloudstate solution</a></span>
</nav>
</article>
<aside class="toc sidebar">
<div class="toc-menu"></div>
</aside>
</div>
<div class="main-footer">
<div class="page-source">
Found an error in this documentation? Please feel free to <a href="https://github.com/cloudstateio/cloudstate/edit/master/docs/src/modules/ROOT/pages/crud-limitations.adoc">edit this page</a> and contribute a pull request.
</div>
<div class="footer-box">
<footer class="footer">
<div class="footer-logo"><a href="https://cloudstate.io"><img src="./_/img/cloudstate-color.svg"></a></div>
<div class="footer-content">© Cloudstate <script>document.write(new Date().getFullYear());</script> | <a href="https://www.lightbend.com/legal/privacy" target="_blank">Privacy Policy</a> | <a href="https://cloudstate.io/cookie">Cookie Listing</a> | <a class="optanon-toggle-display">Cookie Settings</a></div>
</footer>
</div>
</div> </main>
</div>
<!--Footer Scripts Global-->
<script src="./_/js/site.js"></script>
<script src="./_/js/vendor/highlight.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="./_/js/vendor/groups.js"></script>
<script>hljs.initHighlighting()</script>
<script src="./_/js/vendor/jquery.waypoints.min.js"></script>
<script src="./_/js/vendor/inview.min.js"></script>
<script>
(function($) {
$(function() {
var pageViewedTriggerElement = '#page-content';
//override #page-content if a custom trigger is present in page
if($("#page-viewed-trigger").length){
pageViewedTriggerElement = '#page-viewed-trigger';
}
var inview = new Waypoint.Inview({
element: $(pageViewedTriggerElement)[0],
entered: function(direction) {
//fire custom Jquery event that Marketo can listen for
$.event.trigger({
type: "pageContentViewed"
});
}
})
});
})(jQuery);
</script>
<!--Marketo-->
<script>
//store munchkin status to use in other functions
var munchkinLive = false;
//marketo munchkin
(function() {
var didInit = false;
function initMunchkin() {
if(didInit === false) {
didInit = true;
Munchkin.init('558-NCX-702', { 'asyncOnly': true, 'disableClickDelay': true });
munchkinLive = true;
}
}
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = '//munchkin.marketo.net/munchkin.js';
s.onreadystatechange = function() {
if (this.readyState == 'complete' || this.readyState == 'loaded') {
initMunchkin();
}
};
s.onload = initMunchkin;
document.getElementsByTagName('head')[0].appendChild(s);
})();
//wait for jquery as we use a custom jquery event, triggered by waypoint.
(function($) {
$(function() {
var pageViewed = false;
$(document).on("pageContentViewed", handlePageContentViewed);
function handlePageContentViewed(e) {
var viewedPagePath = "/viewed"+window.location.pathname;
if(!pageViewed && munchkinLive){
Munchkin.munchkinFunction('visitWebPage', {
'url': viewedPagePath
}
);
pageViewed = true;
}
};
});
})(jQuery);
</script><!--Footer Scripts Cloudstate-->
<!-- Google Tag Manager -->
<script type="text/plain" class="optanon-category-2">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WWL9BXX');</script>
<!-- End Google Tag Manager -->
</body>
</html>