Dante OSS
Rich and comprehensive | simple and convenient
Make the integration and use of Minio easier
Sample microservice application | Example monomer application | Example front-end application
If you find it helpful, please click "Star" in the upper right corner to support it. Thank you!
Introduction | Intro
Dante OSS is an open source framework that simplifies object storage (OSS) operations. Learn from the standardized design idea of JPA, gradually extract and abstract the OSS standardized operations of various manufacturers, and build a unified Java OSS API specification. It forms an object storage usage mode similar to the JPA specification, with the Java OSS API as the core and different OSS vendors' SDKs as the implementation, so that you can switch between OSS from different vendors without modifying the code.
Goal
- Build a Java OSS API specification similar to JPA, with the goal of not changing the API. You can switch object storage by switching the vendor OSS SDK.
- It is not limited to common upload and download, but covers common operations of all OSS SDKs. It can not only easily upload and download, but also quickly build your own OSS management applications.
- Unified Java API and REST API are provided for common operations, and separate REST API implementation is provided for OSS vendor personalized operations as appropriate.
Design | Design thinking
The original design goal of Dante OSS is to deeply encapsulate the Minio Java SDK, which can more easily implement complex Minio management operations, and improve the convenience of using Minio custom development. With the continuous iteration of versions and the collection of more user requirements, the design idea of Dante OSS is also constantly iterative.
With the continuous integration of different OSS manufacturers' SDKs such as Amazon S3 and Alibaba Cloud, it is found that although most OSS products are compatible with S3 standards, the Amazon S3 SDK can be used to complete other manufacturers' OSS operations, but it is also limited to regular and basic OSS operations, and cannot fully play the characteristics of individual manufacturers' OSS. Moreover, due to different implementations, even the same OSS operation, the parameters passed and the return values are also different. Yes, if the code of the same business logic is implemented using Manufacturer A's SDK, it cannot be used on Manufacturer B's SDK. It must be re implemented before it can be used, which greatly increases the cost of migrating OSS.
Although there are many excellent encapsulation frameworks for object storage operations that can support many OSS vendors, the operations supported by them are not so rich. Dante OSS's goal is not only to meet the use of regular OSS operations, but also to provide richer and more unified OSS management operations. Users can more easily integrate and develop richer and updated detailed OSS management functions in their own applications.
Therefore, on the basis of maintaining the original goal of simplifying Minio management operations, Dante OSS draws on the standardized design idea of JPA, extracts and abstracts OSS standardized operations, and forms a unified Java OSS API specification. At the same time, it encapsulates a unified REST API that can operate from any manufacturer to form an application mode with unified definition and dynamic implementation (similar to Hibernate, which is an implementation of JPA, and Hibernate supports different databases in the Dialect mode), so as to facilitate the switching and migration of different OSS.
Currently, Minio is the default implementation of the Java OSS API specification. Currently, only Minio personalized operation REST API implementation is available.
Benefits | Advantages
-
Zero additional learning cost : Developers can seamlessly integrate and use Dante OSS as long as they understand the basic development of Spring and REST
-
Lower developer threshold : Shield the complexity of using Java OSS SDKs such as Minio, and use the Spring environment standard method to simplify the encapsulation of the original API. Service API and REST API out of the box
-
Unified development interface : Build a unified Java OSS API specification, form a unified Service API and REST API interface, and switch between different manufacturers' OSS without modifying the code
-
It contains rich functions : Nearly all functions of the Minio Java SDK have been modified, and the functions of large file fragment upload, second transfer, direct transfer, breakpoint resume transfer, etc. have been implemented and integrated with the best solution in the industry
-
Standard and elegant code : All function parameters do not destroy the original OSS SDK code constructor structure, but are abstracted and simplified on the basis of the original way, greatly improving the programming experience and code readability
-
Perfect annotation document : Provide detailed comments, descriptions, and OpenAPI annotations for request parameters, methods, REST APIs, and Validation. The purpose and usage are clear at a glance. There is no need to read the Minio documentation and source code again, helping you save more time
-
Abundant stability guarantee : Unified and humanized error system, built-in REST API anti brushing, idempotent protection, detailed and accurate Spring Validation.
-
Full front end example : The front end uses a complete project instead of a demo to comprehensively display the front end and rear end interaction, interface call, parameter use, TS type definition and other aspects, which can be directly used for actual projects or simply build their own products after transformation
Compare
For specific comparison, see online documentation [Function Description Section]
Structure
dante-oss
☆ oss bom -- Dante OSS top-level Maven dependency, unified control of dependency and its version
☆ oss dialect -- OSS implementation by different manufacturers.
☆ -- dialect autoconfigure -- OSS Dialect auto configuration module
☆ -- dialect core -- OSS Dialect common code module
Focus -- dialect sdk aliyun -- Aliyun OSS Java SDK package code module
☆ -- dialect sdk minio -- Minio OSS Java SDK package code module
☆ -- dialect-sdk-s3 -- Amazon S3 OSS Java SDK package code module
├── oss-rest -- Dante OSS REST API
☆ -- rest sdk minio -- Minio's unique REST API module
☆ -- rest sdk specification -- Unified REST API based on Dante Java OSS API specification
☆ oss solution -- Implementation module of conventional OSS application scheme based on Dante Java OSS API specification
☆ oss specification -- Dante Java OSS API specification definition
☆ oss starter -- Dante OSS related starter
Focus -- oss aliyun spring boot starter -- Aliyun OSS Java SDK package Starter for independent use
☆ oss mini spring boot starter -- Minio OSS Java SDK package Starter for independent use
Focus -- oss-s3 spring boot starter -- Amazon S3 OSS Java SDK package Starter for independent use
L L L oss spring boot starter Dante OSS Unified Starter
Column | Cookbook
Dante Cloud Technology Insider High Level Document Column (Cookbook)
Due to the limited support of the currently used reading products, if you want to purchase the full text, please click the corresponding article link and open it in the computer browser to purchase.
Use | How to use
1、 Basic use
- Introduced in maven
<dependency>
<groupId> cn.herodotus.oss </groupId>
<artifactId> oss-spring-boot-starter </artifactId>
<version> Latest version </version>
</dependency>
- Configure yml parameters
herodotus :
oss :
dialect : minio
minio :
endpoint : http://127.0.0.1:9000
access-key : XXXXXXXXX
secret-key : XXXXXXXXX
use-proxy : true
proxy-source-endpoint : http://localhost:3000/api
- Unified error handling
//Reference code
public static Result < String > resolveException ( Exception ex , String path ) {
return GlobalExceptionHandler . resolveException ( ex , path );
}
//Or
@ExceptionHandler ({ HerodotusException . class , PlatformException . class })
public static Result < String > exception ( Exception ex , HttpServletRequest request , HttpServletResponse response ) {
······
}
- Interactive error information feedback
//At the system unified error location, call the following code to return more interactive error information containing custom error codes.
if ( ex instanceof HerodotusException exception ) {
Result < String > result = exception . getResult ();
result . path ( path );
log . error ( "[Herodotus] |- Global Exception Handler, Error is : {}" , result );
return result ;
}
2、 Select Use
except dialect-core
and oss-specification
All other modules can be used independently. You can select only one module to use according to your own needs.
1. dialect-sdk-aliyun
It contains the service code that encapsulates the Aliyun basic API. As one of the ways to realize the unified abstraction of OSS, it also contains the implementation code for the Dante Java OSS API specification. It can be used alone and introduced oss-aliyun-spring-boot-starter
Automatic configuration can be turned on.
Aliyun REST API encapsulation is not currently available. Please directly apply to use AliCloud REST API or use Dante OSS unified REST API interface according to your own needs.
2. dialect-sdk-s3
It contains the service code that encapsulates the Amazon S3 basic API. As one of the ways to realize the unified abstraction of OSS, it also contains the implementation code for the Dante Java OSS API specification. It can be used alone and introduced oss-s3-spring-boot-starter
Automatic configuration can be turned on.
Amazon S3 REST API encapsulation is not currently available. Please directly apply to use Amazon S3 REST API or use Dante OSS unified REST API interface according to your own needs.
3. dialect-sdk-minio
It contains the service code that encapsulates the Minio basic API. As one of the ways to realize the unified abstraction of OSS, it also contains the implementation code for the Dante Java OSS API specification.
Provide MINIO standard operation REST API package rest-sdk-minio
be careful: rest-sdk-minio
It does not include the business function of the general solution for large file sharding upload and the general function REST API conforming to the Dante Java OSS API specification
use oss-minio-spring-boot-starter
Automatic configuration of Minio Service and REST API can be enabled uniformly.
4. rest-sdk-minio
Provide MINIO standard operation REST API package. use oss-minio-spring-boot-starter
Automatic configuration of Minio Service and REST API can be enabled uniformly.
5. rest-sdk-specification
rest-sdk-specification
It is a unified operation REST API formed by abstracting the common content of existing APIs in Minio, Aliyun and Amazon S3, and extracting the Dante Java OSS API specification definition. The goal is to form a unified Java OSS API and REST API similar to the Spring Data Repository, so that a set of APIs can support seamless switching between different OSS vendors without modifying the code.
6. oss-solution
It is a high abstraction of mainstream object storage business solutions such as large file sharding, and encapsulates the Dante Java OSS API specification for related management operations. With this module, you can easily and quickly integrate or customize your own large file shards.
7. oss-spring-boot-starter
All contents of Dante OSS can be directly introduced for use. Based on the common abstraction of OSS, switching between different OSS operations is achieved through Spring Boot configuration. Currently, Minio is used as the default implementation, and a complete REST API related to Minio is provided. Aliyun and Amazon S3 currently only contain service APIs encapsulated in their Java SDKs as options for different OSS implementations. If you want to use its REST API, please apply directly according to the official website documents of the corresponding manufacturer, and do not consider integrating this part into Dante OSS for the time being.
Contribution | Committer
- Go to your own repo in Gitee fork project
- Clone fork's past projects, that is, your projects, to your local
- Modify the code (remember to modify the development branch)
- Commit code, push to your own library (development branch)
- Log in to Gitee and you can see a pull request button on your home page. Click it, fill in some instructions, and then submit.
- Waiting for maintainer to merge
Feedback
- Welcome to submit ISSUE , please write down the specific cause of the problem, reproduce the steps and environment
Demo | Example
As an ecological product of Dante Cloud, Dante OSS does not provide demonstration environment and examples separately. Please use Dante environment directly to view the effect and understand the use, which is more practical.
Single version and microservice version cases based on Spring Authorization Server are provided. You can choose from SDK, Spring Boot Starter and complete project. The front-end uses a complete front-end project based on Vue3, Typescript5, Vite4, and Pinia 2 as an integration example, including detailed Typescript type definitions and the integration and use methods of mainstream components such as vue simple uploader.
Note: If you only want to understand the basic use method and effect, it is recommended to use the single architecture demonstration environment. For specific construction method, see [Online Document] Chapter of monomer version.
License
This project is based on the Apache License Version 2.0 open source agreement, which can be used for commercial projects, but must comply with the following supplementary terms.
- This software shall not be used for acts endangering national security, honor and interests, or for illegal purposes in any form.
- In the extended code (in the code derived from the modified existing source code), the agreement, copyright notice and other instructions required by the original author's regulations in the original code need to be included (please respect the copyright of the original author, and do not delete or modify the Copyright and @ author information in the file), not to mention replace Dante OSS Herodotus or the code maker, otherwise you will be liable for violating the terms of this agreement.
- If you apply some codes or function references of this software, please retain the copyright and author in the source file. You need to indicate the source in the obvious position of your software introduction. For example, this software is based on Dante Cloud microservice architecture or Dante OSS, and the link is attached: https://www.herodotus.cn
- All legal disputes and liabilities arising from this software have nothing to do with the author.
- If you have improved this software, I hope you can contribute to us. It is the king's way to go both ways to achieve each other.
- This project has applied for software copyright, please respect open source.
Sponsorship | Donate
S/N |
Sponsor |
Sponsorship time |
S/N |
Sponsor |
Sponsorship time |
S/N |
Sponsor |
Sponsorship time |
one |
Silence |
2021-10-25 |
two |
Potato Stealer |
2021-11-24 |
three |
lorron |
2022-04-04 |
four |
In the cloud |
2022-12-26 |
five |
Xi 晽 |
2022-12-27 |
six |
p911gt3rs |
2023-01-03 |
seven |
jacsty |
2023-01-31 |
eight |
hubert_rust |
2023-03-16 |
nine |
Zkey Z |
2023-03-18 |
ten |
Zhiguo Ouba |
2023-03-27 |
eleven |
michael |
2023-04-07 |
twelve |
Uncle | Alley |
2023-04-11 |
thirteen |
sun_left |
2023-04-19 |
fourteen |
Time, sand |
2023-07-06 |
fifteen |
Old Indian Turtle Dove |
2023-09-09 |
sixteen |
A gust of wind |
2023-12-10 |
seventeen |
Jack |
2024-03-01 |
eighteen |
onehelper |
2024-05-24 |
nineteen |
Ning |
2024-05-29 |
twenty |
|
|
twenty-one |
|
|