MinIO object storage scala client

Happy devOps

(λx.x)eranga
Effectz.AI
3 min readMar 20, 2020

--

Background

In this post I’m gonna discuss about MinIO distributed object storage and implementing Scala based MinIO client application. All the source codes which related to this post available in gitlab. Please clone the repo and continue the post.

About MinIO

MinIO is a high performance and scalable distributed object storage server which implemented with golang. It can be used to store all unstructured data such as photos, videos, container/VM images, log files, archives etc. The size of a single object can range from only a few KB to a maximum of 5TB. MinIO organizes the objects into a collection of buckets. A bucket can be identified as a folder that holds a collection of objects. In distributed mode, MinIO provides a single object storage server that pools multiple drives spread across many servers.

MinIO is designed to be compatible with Amazon S3, which makes it easy to have the same API interface. This means that applications that can be configured to talk to Amazon S3 can also be configured to talk to MinIO. Unlike Amazon S3 you can run your own MinIO service in a private cloud(which managed by your system administrators). Due to this reason it become more popular object storage in the community. So it can be identified as secure alternative for Amazon S3.

Run MinIO

MinIO object storage server can be installed from a binary file or by running it in docker. I’m gonna use docker to run MinIO in dev environment. In production environment you may install MinIO from binary file. Following is the way to run single node MinIO service with docker.

MinIO Web

MinIO provides web interface to interact with the object storage. Once run the MinIO we can login to the MinIO web via it’s admin credentials(which defines with MINIO_ACCESS_KEY and MINIO_SECRET_KEY). We can create buckets, create objects, search objects, etc via the MinIO web.

MinIO Command-Line client

MinIO provides a command-line client mc(MinIO Client) to interact with MinIO storage. It is a modern alternative to Unix core utils like ls, cat, cp, mirror, diff, find for filesystems and object storage. Following is the way to use mc command line client to interact with MinIO storage. The mc client available inside the minio docker container.

MinIO Scala Client

MinIO provide various client SDK libraries to interact with MinIO object storage. Following is the way to implement Scala based client application using MinIO SDK. First I have defined the MinIO dependency in build.sbt.

Then I have created Scala client application functions to put and get objects from MinIO storage.

Reference

  1. https://blog.alexellis.io/meet-minio/
  2. https://github.com/bitnami/bitnami-docker-minio
  3. https://www.univention.com/blog-en/2018/03/minio-the-secure-alternative-to-amazon-s3-for-object-storage/
  4. https://www.scaleway.com/en/docs/how-to-migrate-object-storage-buckets-with-minio/
  5. https://www.digitalocean.com/community/tutorials/how-to-set-up-an-object-storage-server-using-minio-on-ubuntu-16-04
  6. https://blog.minio.io/introducing-modern-find-alternative-b2fa15393481

--

--