0

I am using the book "Mastering Akka" by Christian Baxter. Now I try to build a new project with akka as event sourced system.

I have a object like Folder. In this Folder could be a number of Files. Really files (java.io.File). For a locale system no problem. But I try to build a distributed system. User A set up a database and gets access to his database. Where are the files? Because user A does not sitting on his desktop pc (where he saved the Folder). He is sitting at a notebook on his homeoffice. Now he needs these files inside Folder.

First I thought to save the files as Array[Byte]. But whats about the situation the file is 150MB? And maybe there are 20 files inside folder and all with more then 150MB? I think my RAM is not working for so long without a crash.

Their is no http server. Also maybe I could ask the server to deliver the files as stream? But this needs settings. Is that the best way?

What is the best practice to handle multiple distrubted and/or large files on av event sourced actor?

Stefano Bonetti
  • 8,973
  • 1
  • 25
  • 44
André
  • 125
  • 1
  • 8
  • Well... first of all... do you understand the concept of distributed storage (GDFS, XtreemFS, etc)? But I will suggest to stay away from them (because they come with a huge net of complexities) and use AWS S3 as the file-store for all your files. Now... as for "delivering the files as stream"... well I get the feeling that you so not understand the concept of "delivering the files as stream" (as it does not apply to your application). – sarveshseri Apr 19 '17 at 08:44
  • Your are right. I dont understand the concept. This is why I asked. You suggest to use AWS S3. Can you suggest a place for a good explanation to understand this. I learned at monolith systems. You need more space, no problem we add it virtually. I dont want to stream a file over the net as Array[Byte]. But I want to understand how I could solve a problem such like this. AWS S3? I appreciate each tipp for understanding this issue and book titles. – André Apr 19 '17 at 09:15
  • Well... AWS S3 gives you a performant file-store along with API's for interacting with it. So, when writing the application you do not need to worry about those. Just focus on what your applications is supposed to do. Leave everything storage related to S3. As for learning about S3, it is a very heavily used component of Amazon Web Services and you will find good tutorials with simple google searches. – sarveshseri Apr 19 '17 at 09:38
  • Thank you. I was looking in web for it. So I can treat this like a file on a locale space. But really this is the cloud space. I will look forward for this. For my first thoughts. A file would be treated like a normal local ("/home/usr/andre/file.txt") but with the api and s3 bounded space I have a file link like this ("/media/mounted/disk/file.txt")? – André Apr 19 '17 at 10:01
  • No... you will not be mounting S3 in your local file system. You will have the S3 url of your file and will interact with it using S3 API. – sarveshseri Apr 19 '17 at 10:03
  • Ah okay. I have to read :) Thank you. – André Apr 19 '17 at 10:23

0 Answers0