Storage capacities have always been a debating problem amongst developers. Some people still use local storage. However, I hold a trong favor for an Object storage service such as Minio or Amazon S3 (Amazon Simple Storage Service).


Object storage is unstructured data which people frequently see images, videos and so on. They have a range size from several KB to milition GB. Applications always have to save these files and even pay enormously. Storage assignment is significant.

Normally, developers put data files in local storage. There are several disadvantages when doing that. So, developers have considered storage servers. Nowaday, Object storage service is more popular for several reasons.

Scalability

Local storage often depends on physical hardware. Once the maximum limit of the local storage is reached, people have to add new space, which does not resist downtime. Conversely, Minio has virtually unlimited storage. That means, this service allows people to broaden storage anytime not to be concerned.

High secure

Data stored in your Minio environment is protected from unauthorized access thanks to encryption features and access management tools. Hackers do not have ability to get exact path of file in server.

Policies

Minio even allows creating users and groups. Moreover, Minio has policies to define actions or resources which users can access. Now, teammates can share resources in minio without concerned permissions.

Support distribution

Distribution is essential in the state of the art system, especially micro services. Minio is totally appropriate to this system. However, this is really a bigger topic. I will explain in next article. Details in Distributed Minio


Let’s create tutorial with minio and python.

Create minio with docker like that

docker run -p 9000:9000 -p 9001:9001 -e "MINIO_ROOT_USER=yourusername" -e "MINIO_ROOT_PASSWORD=yourpassword" -d -v /minio/data:/data --name minio minio/minio server /data


Minio


Another Minio image

docker run \ -p 9000:9000 \ -p 9001:9001 \ --name minio-server \ -d \ -v /minio-server/data:/data \ -e "MINIO_ROOT_USER=yourusername" \ -e "MINIO_ROOT_PASSWORD=yourpassword" \ quay.io/minio/minio server /data --console-address ":9001"


Minio Console


On the other hand, Mino explicitly supports python language in the offical document python-client-api developers just follow and enjoy it. For example:


            
              from minio import Minio
              from config import setting_project # This is my config

              client = Minio(
                  setting_project.minio_url,
                  access_key=setting_project.minio_access_key,
                  secret_key=setting_project.minio_secret_key,
                  secure=setting_project.minio_secure
              )
              found = client.bucket_exists(setting_project.minio_bucket)
              if not found:
                  client.make_bucket(setting_project.minio_bucket)


              // create 
              client.put_object(
                          setting_project.minio_bucket, file_location, file.file, len(byte_file)
                      )
              // get 
              data = client.get_object(setting_project.minio_bucket, path)
            
          


In summary, Object storage services would reap more benefits in handling data. Developers do not bother to scale systems which exceed capacity. OSS also supports distributed very well and completely.

Steve Nguyen

© Steve CV. All rights reserved.
Design - TemplateFlip