Heroku is a cloud platform as a service (PaaS) that is used for the deployment of the web application and RESTful API application. It supports deployment for multiple programming languages. It is a free platform as a server (PaaS) which is a good option for deploying and managing the small applications.
Its architectural components:
Dyno:
All its application runs on the dyno. What is dyno? Dynos are the collection of Linux container which is a core part of its cloud. There are different types of dynos.
Stacks:
Stacks are nothing but the operating system which maintained by it. Currently, it provides three stacks: Cedar-14 (Ubuntu 14.04),Heroku-16(Ubuntu 16.04) and Heroku-18(Ubuntu 18.04).
Why to use it?
Saves a ton of time because you don’t have to manage servers and infrastructures. All you need to do is push your app in a git repository and it’ll run it for you. You don’t have to set up and manage servers, OS, networking, firewalls, etc. You can scale your app up and down by just moving the knob or a slider.
How to use?
Getting started: Follow the steps below to create your app. Or follow the URL by choosing the programming language/frameworks that you are using. (https://devcenter.heroku.com/articles)
(Note- App name is optional. If you didn’t provide the application name it will create one for you). This command will add its git repository URL.
If you already have its app and need to create a new application in the existing one. This will add new git URL for the application.
cmd> heroku git:remote -a YOUR_APP_NAME
To ensure that remote named it has been set for your application.
cmd> git remote -v
Deployment:
It’s pretty easy to deploy on it as it uses GIT (version control system) for application deployments.
cmd> git add
cmd> git commit -m “Initial commit”
cmd> git push origin master (If you have a git repository.)
cmd> git push heroku master
It automatically detects and installs newly added dependencies for you. To migrate and seed the tables of your application you need run command explicitly. Remember, migration and seeding commands depends upon the frameworks that you have been using for the building your application. For example in rails application:
cmd> heroku run rake db:migrate
cmd> heroku run rake db:seed
Debugging:
It provides logs that are a real-time stream of application events.
Procfile: Suppose we have some kind of commands and need to be executed on the server so its application has a specific file called Procfile. Then these commands should be defined in the procfile. To know more about the naming convention and how exactly these commands are defined in the file visit this URL (https://devcenter.heroku.com/articles/procfile).
It has a strict 30 seconds request timeout which is not configurable. Any request which takes more than 30 seconds receives application error. So if you are having any bulky request such as uploading file/image or sending emails it’s better to switch to background jobs/worker. Although there are different types of application error in it you can know from the following URL https://devcenter.heroku.com/articles/error-pages.
Its file system is read-only so cannot create files on it. Well, there are multiple ways to do this
1. You can use AWS s3 service to store the file and access it from the cloud.
2. You can store the file in the database.
3. You can also use some document store, such as CouchDB or MongoDB
Its free account has a limit of 10,000 rows in the database. This plan can be upgraded according to the size and requirement of applications.
Its free account can create up to 5 applications and 2 databases backups per database.
All content provided on this blog is for informational purposes only. Tudip Technologies provides no endorsement and makes no representations as to accuracy, reliability, completeness, suitability or validity of any information or content on, distributed through or linked, downloaded or accessed from this site. Tudip Technologies will not be liable for any errors, omissions, or delays in this information or any losses, injuries, or damages arising from its display or use of the information on this site. All information is provided on an as-is basis without any obligation to make improvements or to correct errors or omissions. This site may contain links to other websites. Tudip Technologies makes no guarantees or promises regarding these websites and does not necessarily endorse or approve of their content. You may not modify any part of the blog. The inclusion of any part of this blog in another work, whether in printed or electronic or other form, or inclusion of any part of the blog in another website by linking, framing or otherwise without the express permission of Tudip Technologies is prohibited. This site may not be used for any illegal or illicit purpose and Tudip Technologies reserves the right, at its sole discretion and without notice of any kind, to remove anything posted to this site. By using this site, you hereby acknowledge that any reliance upon any materials shall be at your sole risk.