 Bonus processing using AWS service. So I think while we are building application, there are certain type of background process. And usually, like normally some background process taking a lot of time to finish. And when you build a web app, we want our web app to be respond quickly to user. So user don't have to wait. And in a certain language, we can launch a new thread. Or like in Go lang, we have new routine for, OK. So usually, we have some background process taking so long. And we want to try to separate the background process. And just to make sure that user will get respond quickly. Before we go to detail, I want to show you my cell. There's a link above me. And I like football very much. I play soccer every week. And I have family with a daughter. It's got disconnect. Are you running is that keynote or is it a PDF or something? No. It's on Google Drive. OK. So the problem is like, for example, we have a web app server and we have a background process. Some background process run like 30 seconds. And we don't want our user to wait for 30 seconds. And also, for example, you have 1,000 or million user access the website at the same time. They've been add up to a very huge amount of time. And the other way is like we try to asynchronous the background process. So it runs transparently to user. And our app server will return to user directly. So for example, in this case, we reduce from around 30 seconds to just around one second only. And today I'm in demo. This one using an application written in Golang. Very small app just for demo only. And I'm using some AWS service, S3 Elastic Transcoder, SNS, and Lambda. The reason I use Elastic Transcoder because I want to demo a background process which is usually taking a lot of time, which is like video converting. So usually, for example, amazing, user upload a video file. We want to convert video file or do some processing with the video, like take a thumbnail, creating a multiple format for the video. Then that process usually takes a lot of time. And we don't want to wait for the process to be finished in order to return to user. So I will upload the file to S3 using Transcoder to convert the format. And when the status of the job is updated, it will send notification to SNS, stand for a simple notification service from AWS. And then SNS will trigger Lambda function. And here in the Lambda function, we can do whatever we want. The reason why we have to take this kind of time is, for example, for SNS, it can call a RESTful API. For example, but the thing is, the API must be public in order SNS to call. So a lot of time, our app resides inside our internal network. So SNS cannot call the API directly. So that's why I have to call Lambda first to make sure Lambda and SNS are in the same network. And then Lambda can call our API. So here is sample code here. I just put here for sample only. I will push this code into GitHub. And you can take a look a little. Now I will demo this app. So this is a code of the application. It's very quick. Anybody can see? It's a bit small. You're using it. Yeah, now I can see. OK. So basically, ZIT is just like connecting this post method. This post method is like handing the file upload. And when we upload the file, I create a record, save it to database, and start the upload to the AWS S3. And then create a job for transcoder for this process. And let's run this one. This one. OK. Anybody can see my comment? I don't know how to increase the size of this one. OK. So the comment is very simple, go run main.go. This runs this simple file because as the application is written in the very simple file. OK. Wait for one or two seconds of server start. OK. So it started. And here I use postman to test the script. I already test it here. But now I will try. OK. Here is the request. I try to upload the simple uitune.mov. ZIT is a simple mov file from Apple. So I download and I will try to upload this file now. And transcoder will try to convert this mov file into the mp4 format. OK. So now I send this request. You see it takes like one or two seconds to finish. And here let's go to NS3. OK. OK, you see this file, this one. This one is just newly created. If you take a look of the timestamp, yeah. But you see the file is updated at 21 here, the second 21. But this one is finished at 29. So it takes eight seconds to finish. But in our web app here, OK, this one is 20. So that means it's almost instantly with the response. Yeah. Ah, yeah, here. It takes two seconds to finish. But this object takes eight seconds to convert it. It's two seconds for the upload, I guess. Yeah, two seconds for the file to be uploaded and to be submit to S3 and return to user. So after that, the converting, the background post set will happen on the AWS only. Yeah. What about posters and things like that? What do you mean by post? Like, you'll like preview images? Yeah, they can generate the thumbnail for you. Oh, OK. Yeah. So basically for, OK. So the second thing I want to show you is like once this file is uploaded, when it updates the status, it will send notification to SNS. And SNS will call my lambda function. To show you, I will show you about my transcoder configuration first. Elastic transcoder. So Zit is a pie life. So Zit is a pie life for transcoding. And I use this preset. I think I use this one just to make sure that the file size is small, because I have to pay for that. Yeah, this one. Yeah. So Zit is the format, MP4 format. We can choose multiple formats if we want to convert at the same time. Yeah. Five minutes, Michael. Yeah. Yeah, sure. And Zit is just a job, just one now. And you can see here, it takes six seconds to convert this file. And you can hear, as you can see here, it will send notification to SNS topic. It's a Zit one. And is that once it's written to S3, right? Yes. Yeah. And this is a topic in SNS. And here is Lambda. And Lambda will get triggered by that same topic here. And when it's triggered, it runs this code. And this code is written by Node.js. You can write whatever you want here. I just console lock it for just a proof. And from here, from locking, you can see here. OK. Zit is just an example. When the stator is completed, I run a console lock in the Node.js, the Lambda function just now. And here is the data is locked. Yeah. I run the console lock here. And it locks the data to console and the CloudWatch will grab it and put it here. Yeah. That's all from me now. Thanks, Michael. Yeah. Can you use this technique on Property Guru? Yeah. So Property Guru handles videos? I think it does. No, it doesn't. It hasn't, yes. Actually, I implemented this one in Property Guru to convert. We call currently that Property Guru can handle some, a certain format. And we want to support almost the format and we can play natively in HTML5. Yeah. That sounds sensible. Yeah. And Zit is a GitHub repo for the code. If you want, you can take a look. Thank you so much. Questions for Michael? Anyone also doing transcoding out of interest? I personally use FMMpeg. But I'm curious to know what you guys use. Previously, I used FMMpeg as well. And now it's called AVConf. AVConf is the old one. I think it's merged back into FMMpeg. Oh, OK. It's split and then it came back. Oh, OK. Correct me. Yeah. It's like two years ago, so maybe it's much. And I can feel like FMMpeg, it takes me a lot of time to set it up and to do a lot of tasks to connect everything together. But this transcoder is very quickly. Yeah. I see the benefit of using these presets for sure. Anyone doing the same sort of stuff will have questions for Michael? So does this scale up? Yes, this quite scale quite well. Because currently we have quite a number of video uploads per day. And we don't have any problem with this one. And usually the converting, I haven't seen any converting time, which takes longer than one minute. The longer, yeah. Well, even if you have a huge file. Yeah, I try. For example, currently we limit only 10 meg. I try 50 meg, or even 100 meg. It's 10 takes quite fast. Yeah. I didn't look that closely at your code. I'm a Golang programmer myself. Did you, when someone uploads, do they upload to S3? And then you take the S3 reference, or do you upload into some? I upload to S3. So transcoder will get input from S3 and output back to S3. Yeah. Because, but does your Golang actually accept the binary? Or do you post directly to S3 using the? OK, so when you upload, the file will be stored in the memory. So in this space, and then a temporary file. And you open that to convert. It's the file handler with the IO reader. And then the AWS ADK will take the IO reader to pass it. I was going to say, you can post directly to S3. That saves a lot of hassle. I think so, but I haven't tried. Well, we can try that. And of course, I had another question. I forgot it. Another question? How many minutes are you transferring? It's like six per month. Like total minutes are you? We haven't done an analytic on that. Yes? Cues about the price. I have no idea about the price. I was surprised by a minute. By the minute of the video is converted. Of the converted video. Yes. Wait a minute. The upload minute is going to be the same as the convert minute, right? No, it may be different. I'm not sure what. Maybe the time is processing. Or maybe the time is the length of the video. Do you remember what your bill is? I have no information. No permission to accept that. That's the greatest company. No, honestly, I genuinely think as a developer, it's important to know how much things cost. I get asked that question all the time. Luckily, I'm staying in my free time now. Well, I look forward to seeing videos on poverty guru. Also, I look forward to four plans. Four plans, that's what I want to see. Okay, thanks again. Thank you.