In this session, we explored how the cbfs module empowers developers to abstract and manage file systems seamlessly across their lifecycle. From local development to S3 deployment and customized media providers requiring authentication, cbfs offers flexible solutions. We discussed how cbfs simplifies file handling with enhanced workflow efficiency compared to native methods, along with practical tips to accelerate complex file operations in your projects.
1 of 19
Download to read offline
More Related Content
Disk to Cloud: Abstract your File Operations with CBFS
1. INTO THE BOX 2024
CBFS
Abstract, Extend, Integrate Any File System
3. - ColdBox Module
- Abstract ANY
fi
lesystem within your ColdBox applications
- Con
fi
gure named disks that represent
fi
le systems
- Each disk is tied to a Storage Provider
- Storage Providers
- Local, RAM, Temporary, S3
- Various means to provide storage to your application
- Access and use disks using a simple API
What is CBFS?
4. - Abstraction
- Same API, di
ff
erent destinations
- Di
ff
erent locations for di
ff
erent tiers: development, staging, production
- Flexibility
- Ability to change providers with no change of code *
- Ease of Use
- Focus on abstraction instead of a speci
fi
c protocol
- Modularity
- Leverages ColdBoxs HVMC
- Any module can de
fi
ne disks or consume disks
Why CBFS?
9. - Responsible for managing disks
- Tracks instances and metadata
- Register / unregister
- Startup / shutdown
- Interact with your disks
Disk Service
10. - Use to register and interact with your disks
- Disks with the same names can can use di
ff
erent providers depending on the deploy tier
- Get names of disks
- diskService.names()
- Get count of disks
- diskService.count()
- Obtaining Disk Instances
- diskService.get( diskName )
- Default Disk
- diskService.defaultDisk()
- diskService.tempDisk()
Disk Service
11. - Local
- Java 11 + NIO
- 95% of our implementation is not using native CFML
- Adobe CF / Lucee is using Java-8 and earlier IO packages
- RAM
- Stores
fi
les in memory
- Temp
- Stores
fi
les in CFML engines temporary
fi
le storage
- S3
- Uses AmazonS3@s3sdk
- Connect to S3, Digital Ocean Spaces, Azure Blog Storage ( via S3 API implementation)
Included Providers