DigitalOcean

DigitalOcean

Application and Data / Application Hosting / Cloud Hosting

Hello, I'm currently writing an e-commerce website with Laravel and Laravel Nova (as an admin panel). I want to start deploying the app and created a DigitalOcean account. After some searches about the deployment process, I saw that the setup via DigitalOcean (using Droplets) isn't very easy for beginners. Now I'm not sure how to deploy my app. I am in between Laravel Forge and DigitalOcean (?Apps Platform or Droplets?). I've read that Heroku and Laravel Vapor are a bit expensive. That's why I didn't consider them yet. I'd be happy to read your opinions on that topic!

READ MORE
8 upvotes·176.4K views
Replies (2)
Full-stack software developer at Grafeno Digital·

Probably the best bet is to go through dockerize your application and you'll be free to deploy anywhere since almost any host company offer some way to deploy using docker images.

I've made some simple infra to deploy a laravel app using docker image with docker compose behind a traefik to offer a blue green deployment, pratically the same container was deployed to a production and staging system, only changing some environment vars using 12factor. This pipeline mentioned uses gitlab ci to build the docker image, run tests and if the branch is staging/development or main, the deploy occurs through gitlab runner, connecting to a customer VPS and do the script to pull the image, sinalize traefik to direct traffic from the old container image to the new one.

READ MORE
5 upvotes·1 comment·4.5K views
Vasilios Zachopoulos
Vasilios Zachopoulos
·
September 18th 2021 at 9:22AM

Thanks for the reply. I'll take a look at your suggestions.

·
Reply
Founder at Vanilo·

Considering that you mention "isn't easy for beginners" I'd suggest Forge and Digital Ocean. They're still the most simple ones available out there. Docker would be a good solution too, but there you need to understand docker and the services you're connecting to, and some level of orchestration. In my experience, these are not trivial at all, especially for beginners.

Envoyer comes into the picture as a missing piece that can be used for deployment, and integrates with Forge and DO quite well.

I'd be happy to help you with a basic setup (DM me on Twitter or Github).

READ MORE
4 upvotes·1 comment·4.4K views
Vasilios Zachopoulos
Vasilios Zachopoulos
·
September 18th 2021 at 9:23AM

Thanks! I will try it myself first :)

·
Reply

Hi, I'm a beginner at using MySQL, I currently deployed my crud app on Heroku using the ClearDB add-on. I didn't see that coming, but the increased value of the primary key instead of being 1 is set to 10, and I cannot find a way to change it. Now I`m considering switching and deploying the full app and MySql to DigitalOcean any advice on that? Will I get the same issue? Thanks in advance!

READ MORE
7 upvotes·138.7K views
Replies (2)
Freelance Developer at DGTEpro·

If a database tables has had some records added to it, and those records are then deleted the Auto Increment value is not automatically reset to avoid accidentally referencing an incorrect row. (e.g. maybe another reference to that row ID exists somewhere). If that's not a problem you can manually reset it with

ALTER TABLE tablename AUTOINCREMENT = 0;

Alternatively, if you were to TRUNCATE the table (DELETE ALL RECORDS), this would also reset the AUTO INCREMENT value: TRUNCATE TABLE table_name;

READ MORE
2 upvotes·2 comments·5.5K views
Cesare Mannino
Cesare Mannino
·
September 17th 2021 at 12:42PM

Hi Andy, thank you. I will save these lines of code. My issue by the way was that the autoincrement for every record is 10 a the time. If for example I insert one record clearDB will give the id of 5, for the next one it will be 15, 25 ,35 and so on, instead of be 1,2,3,4,5. Anyway I solve temporary the problem not showing the ID value on my HTML table. I will look in the future to change the deployment service.

·
Reply
Andy Gee
Andy Gee
·
September 18th 2021 at 4:16AM

Oh I see! There's 2 possible causes for this, the most likely is the auto_increment_increment setting is not 1. Try running this query to check the setting.

`SHOW VARIABLES LIKE 'auto_incre%'; `

auto_increment_increment = 1

auto_increment_offset = 1

If they are not set to 1 then change your configuration and restart the mysql server.

I've just read that with ClearDB you can't change this, you're stuck with an offset of 10.

ClearDB's response to the same question on SO here https://stackoverflow.com/questions/26002784/auto-increment-by-1-in-mysql-with-cleardb#26004621

ClearDB uses circular replication to provide master-master MySQL support. As such, certain things such as auto_increment keys (or sequences) must be configured in order for one master not to use the same key as the other, in all cases. We do this by configuring MySQL to skip certain keys, and by enforcing MySQL to use a specific offset for each key used. The reason why we use a value of 10 instead of 2 is for future development.

·
Reply
Needs advice
on
ASP.NET CoreASP.NET Core
and
GolangGolang

I am going to build a backend which will serve my React site. It will need to interact with a PostgreSQL database where it will store and read users and create and use JSON Web Token for authenticating HTTP requests. I know EF core has good migration tooling, can Go provide the same or better? I am a one man team and I'll be hosting this either on Heroku or DigitalOcean.

READ MORE
4 upvotes·167.2K views
Replies (2)
System Architect at RE: GmbH·
Recommends
on
Next.js

From your question I gather that you don't have any specific requirements with regards to performance or technology: both PostgreSQL and JWT are well-supported in both ecosystems and so my recommendation would be to go with whatever you're most familiar with already which seems to be ASP.NET if I interpret the wording correctly.

Although there are very good frameworks and libraries for Go, you'll be looking forward to doing a lot of things manually. Although this can potentially lead to very optimized and high quality software, it can just as well slow you down because you're dealing with low-level stuff that doesn't actually add business value to your application.

The point in favour of Go would be that you can easily deploy it to Heroku, which (afaik) doesn't support ASP.NET.

As you're a one-man team, you might even want to reconsider the decision to have separate codebases and languages for back-end and front-end. You're going to need to be very focused on adding business value to your application without getting distracted by some low-level technical detail or context switch. With React being your chosen front-end technology, I'll throw Next.js in the ring. (It'll deploy on Heroku nicely, too).

In the end: choose the technology that will support your flow the most.

READ MORE
7 upvotes·1 comment·2.2K views
G\ C\
G\ C\
·
January 12th 2021 at 9:58PM

Thanks, next.js is my selection for the website / web panel! As you say, Go can be overkill for a one man team and I will be using nodejs with express js for most backend APIs. I also replaced Postges with MongoDB and I'm happy I did DX-wise.

·
Reply
Recommends
on
C#

I'm a dotnet developer, and recently enjoyed building cli apps in golang, it's been a fun experience. The main reason for me using golang will be its resource consumption, Small cross-platform executables. What I did notice though, building more complex applications, those benefits starts to erode quickly. And the latest articles about dotnet core single executables and AOT compile modes does suggest a much smaller footprint for dotnet apps going forward.

Either way, I like both languages

READ MORE
6 upvotes·2.1K views
Web Developer at Soltech LLC·

This week, we finally released NurseryPeople.com. In the end, I chose to provision our server on DigitalOcean. So far, I am SO happy with that decision. Although setting everything up was a challenge, and I learned a lot, DigitalOceans blogs helped in so many ways. I was able to set up nginx and the Laravel web app pretty smoothly. I am also using Buddy for deploying changes made in git, which is super awesome. All I have to do in order to deploy is push my code to my private repo, and buddy transfers everything over to DigitalOcean. So far, we haven't had any downtime and DigitalOceans prices are quite fair for the power under the hood.

READ MORE
Search for Plants and Nurseries | NurseryPeople (nurserypeople.com)
15 upvotes·8 comments·181.6K views
Kamal ABOUNAIM
Kamal ABOUNAIM
·
April 24th 2020 at 4:08PM

Great i just wanna learn about trick how to auto deploy after pushing to Git

thanks to your comment i ll see about Buddy

·
Reply
Christopher Wray
Christopher Wray
·
April 24th 2020 at 4:25PM

Buddy is amazing man. And for our site it is free, which is incredible.

·
Reply
Christopher Wray
Christopher Wray
·
April 24th 2020 at 4:25PM

I will say that last week DigitalOcean had an outage for a little. Didn't last very long, but something to think about.

·
Reply
Joshua Kapellen
Joshua Kapellen
·
April 30th 2020 at 2:28PM

Nothing has 100% uptime; you should always design and plan for outages as well. This lets you at least have some say in the user experience even during an outage.

·
Reply
Christopher Wray
Christopher Wray
·
April 30th 2020 at 2:48PM

How do you design and plan for outages if the server is completely down?

·
Reply
Shared insights
at

In mid-2018 we made a big push for speed on the site. The site, running on PHP, was taking about 7 seconds to load. The site had already been running through CloudFlare for some time but on a shared host in Sydney (which is also where most of the customers are). We found when developing the @TuffTruck site that DigitalOcean was fast - and even though it's located overseas, we still found it 2 seconds faster for Australian users. We found that some Wordpress plugins were really slowing the TTFB - with all plugins off, Wordpress would save respond 1.5-2 seconds faster. With a on/off step through of each plugin we found 2 plugins by Ontraport (a CRM type service that some forms we populating) was the main culprit. Out it went and we built our own WP plugin to do push the data to Ontraport only when required. With the TTFB acceptable, we moved on to getting the completed page load time down. Turning on CloudFlare 's HTML/CSS/JS minifications & Rocket Loader we could get our group of test pages, including the homepage, loading [in full] in just over 2 seconds. We then moved images off to imgix and put the CSS, JS and Fonts onto a mirrored subdomain (so that cookies weren't exchanged), but this only shaved about another 0.2 seconds off. We are keeping it running for the moment, but the $10 minimum a month for imgix is hardly worth it (this would be change if new images were going up all the time and needed processing). The client is overly happy with the ~70% improvement and has already seen the site move up the ranks of Google's SERP and bring down their PPC costs. AND all the new hosting providers still come in at half the price of the previous Sydney hosting service. We have a few ideas that we are testing on our staging site and will roll these out soon.

READ MORE
3 upvotes·1 comment·499.5K views
Mountain/ \Ash
Mountain/ \Ash
·
July 15th 2019 at 6:05PM

Platform Update: we’ve been using the Performance test tool provided by @KeyCDN for a long time in combination with @pingdoms similar tool and the @WebpageTest and @GoogleInsights - we decided to test out @KeyCDN for static asset hosting. The results for the endpoints were superfast - almost 200% faster than @Cloudflare in some tests and 370% faster than @imgix. So we’ve moved Washington Brown from imgix for hosting theme images, to KeyCDN for hosting all images and static assets (Font, CSS & JS). There’s a few things that we like about “Key” apart from saving $6 a month on the monthly minimum spend ($4 vs $10 for imgix). Key allow for a custom CNAME (no more advertising imgix.com in domain requests and possible SEO improvements - and easier to swap to another host down the track). Key allows JPEG/WebP image requests based on clients ‘accept’ http headers - imgix required a ?auto=format query string on each image resource request - which can break some caches. Key allows for explicitly denying cookies to be set on a zone/domain; cookies are a big strain on limited upload bandwidth so to be able to force these off is great - Cloudflare adds a cookie to every header… for “performance reasons”… but remember “if you’re getting a product something for free…”

·
Reply