Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an in-memory and default implementation of detached blob storage #21144

Merged
merged 10 commits into from
May 21, 2024

Conversation

anthony-murphy
Copy link
Contributor

@anthony-murphy anthony-murphy commented May 17, 2024

Based on feedback from partners, the current story around blobs is overly complicated, and hard to work with. The existing detached blob storage interface is difficult to work with as it applies to the whole loader, and not a specific container, additionally it is decoupled from the serialization flow which make coordination difficult, lastly the need to supply detached blob storage when not using serialization is burdensome.

To address these issues, this change creates a default in memory detached blob storage which also support serialization and deserialization, so that detached, serialization and rehydration can be used in the presence of blobs without the need to pass a custom storage mechanism which doesn't align with our existing surface area.

For testing I've refactored our existing detached blob storage to support testing with both a custom detached blob storage specified, and an undefined detached blob storage which will result in using the new in memory storage. These test cover attaching, serializing, and deserializing with blobs.

Lastly IDetachedBlobStorage is deprecated and replaced with a default in memory store for detached blobs. IDetachedBlobStorage will be removed in a future release without a replacement. Blobs created while detached will be stored in memory to align with attached container behavior.

AB#8049
AB#5179

@github-actions github-actions bot added area: loader Loader related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch labels May 17, 2024
@github-actions github-actions bot added the public api change Changes to a public API label May 17, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented May 17, 2024

@fluid-example/bundle-size-tests: +2.67 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 453.28 KB 453.28 KB No change
azureClient.js 550.75 KB 551.65 KB +924 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 256.97 KB 256.97 KB No change
fluidFramework.js 357.09 KB 357.09 KB No change
loader.js 132.91 KB 133.79 KB +893 Bytes
map.js 41.53 KB 41.53 KB No change
matrix.js 143.75 KB 143.75 KB No change
odspClient.js 519.28 KB 520.17 KB +921 Bytes
odspDriver.js 97.3 KB 97.3 KB No change
odspPrefetchSnapshot.js 42.16 KB 42.16 KB No change
sharedString.js 160.27 KB 160.27 KB No change
sharedTree.js 357.08 KB 357.08 KB No change
Total Size 3.19 MB 3.19 MB +2.67 KB

Baseline commit: 15de84c

Generated by 🚫 dangerJS against 87a09af

Copy link
Contributor

@Abe27342 Abe27342 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, couple nits

.changeset/early-melons-bathe.md Outdated Show resolved Hide resolved
packages/loader/container-loader/src/memoryBlobStorage.ts Outdated Show resolved Hide resolved
packages/loader/container-loader/src/memoryBlobStorage.ts Outdated Show resolved Hide resolved
@anthony-murphy anthony-murphy enabled auto-merge (squash) May 21, 2024 22:46
@anthony-murphy anthony-murphy merged commit 2eebaa1 into microsoft:main May 21, 2024
30 checks passed
@anthony-murphy anthony-murphy deleted the blobs-detached-memory branch May 21, 2024 23:39
anthony-murphy added a commit to anthony-murphy/FluidFramework-1 that referenced this pull request May 21, 2024
…icrosoft#21144)

Based on feedback from partners, the current story around blobs is
overly complicated, and hard to work with. The existing detached blob
storage interface is difficult to work with as it applies to the whole
loader, and not a specific container, additionally it is decoupled from
the serialization flow which make coordination difficult, lastly the
need to supply detached blob storage when not using serialization is
burdensome.

To address these issues, this change creates a default in memory
detached blob storage which also support serialization and
deserialization, so that detached, serialization and rehydration can be
used in the presence of blobs without the need to pass a custom storage
mechanism which doesn't align with our existing surface area.

For testing I've refactored our existing detached blob storage to
support testing with both a custom detached blob storage specified, and
an undefined detached blob storage which will result in using the new in
memory storage. These test cover attaching, serializing, and
deserializing with blobs.

Lastly IDetachedBlobStorage is deprecated and replaced with a default in
memory store for detached blobs. IDetachedBlobStorage will be removed in
a future release without a replacement. Blobs created while detached
will be stored in memory to align with attached container behavior.


[AB#8049](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8049)

[AB#5179](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/5179)

---------

Co-authored-by: Tony Murphy <[email protected]>
anthony-murphy added a commit to anthony-murphy/FluidFramework-1 that referenced this pull request May 21, 2024
…icrosoft#21144)

Based on feedback from partners, the current story around blobs is
overly complicated, and hard to work with. The existing detached blob
storage interface is difficult to work with as it applies to the whole
loader, and not a specific container, additionally it is decoupled from
the serialization flow which make coordination difficult, lastly the
need to supply detached blob storage when not using serialization is
burdensome.

To address these issues, this change creates a default in memory
detached blob storage which also support serialization and
deserialization, so that detached, serialization and rehydration can be
used in the presence of blobs without the need to pass a custom storage
mechanism which doesn't align with our existing surface area.

For testing I've refactored our existing detached blob storage to
support testing with both a custom detached blob storage specified, and
an undefined detached blob storage which will result in using the new in
memory storage. These test cover attaching, serializing, and
deserializing with blobs.

Lastly IDetachedBlobStorage is deprecated and replaced with a default in
memory store for detached blobs. IDetachedBlobStorage will be removed in
a future release without a replacement. Blobs created while detached
will be stored in memory to align with attached container behavior.

[AB#8049](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8049)

[AB#5179](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/5179)

---------

Co-authored-by: Tony Murphy <[email protected]>
anthony-murphy added a commit that referenced this pull request May 22, 2024
…b storage (#21195)

port of #21144

Based on feedback from partners, the current story around blobs is
overly complicated, and hard to work with. The existing detached blob
storage interface is difficult to work with as it applies to the whole
loader, and not a specific container, additionally it is decoupled from
the serialization flow which make coordination difficult, lastly the
need to supply detached blob storage when not using serialization is
burdensome.

To address these issues, this change creates a default in memory
detached blob storage which also support serialization and
deserialization, so that detached, serialization and rehydration can be
used in the presence of blobs without the need to pass a custom storage
mechanism which doesn't align with our existing surface area.

For testing I've refactored our existing detached blob storage to
support testing with both a custom detached blob storage specified, and
an undefined detached blob storage which will result in using the new in
memory storage. These test cover attaching, serializing, and
deserializing with blobs.

Lastly IDetachedBlobStorage is deprecated and replaced with a default in
memory store for detached blobs. IDetachedBlobStorage will be removed in
a future release without a replacement. Blobs created while detached
will be stored in memory to align with attached container behavior.


[AB#8049](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8049)


[AB#5179](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/5179)

Co-authored-by: Tony Murphy <[email protected]>
anthony-murphy added a commit that referenced this pull request May 22, 2024
…b storage (#21194)

port of #21144

Based on feedback from partners, the current story around blobs is
overly complicated, and hard to work with. The existing detached blob
storage interface is difficult to work with as it applies to the whole
loader, and not a specific container, additionally it is decoupled from
the serialization flow which make coordination difficult, lastly the
need to supply detached blob storage when not using serialization is
burdensome.

To address these issues, this change creates a default in memory
detached blob storage which also support serialization and
deserialization, so that detached, serialization and rehydration can be
used in the presence of blobs without the need to pass a custom storage
mechanism which doesn't align with our existing surface area.

For testing I've refactored our existing detached blob storage to
support testing with both a custom detached blob storage specified, and
an undefined detached blob storage which will result in using the new in
memory storage. These test cover attaching, serializing, and
deserializing with blobs.

Lastly IDetachedBlobStorage is deprecated and replaced with a default in
memory store for detached blobs. IDetachedBlobStorage will be removed in
a future release without a replacement. Blobs created while detached
will be stored in memory to align with attached container behavior.



[AB#8049](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8049)


[AB#5179](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/5179)

Co-authored-by: Tony Murphy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: loader Loader related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants