Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
EAT THE EGGS RICOLA
May 29, 2008

I want to set up a model that can have many self-referential relationships.

Basically, I have a population of artists that are generally related to each other in some way. If I was just trying to track who each person's parents were, I could track this by just doing something like this:

code:
class Artist < ActiveRecord::Base
  belongs_to :parent, :class_name => 'Artist'
  has_many :children, :class_name => 'Artist', :foreign_key => 'parent_id'
end
I would like to be able to store as many relationship as required for each artist and to name what kind of relationship they have (i.e. A is B's Parent, B is A's Child, A is C's Aunt, C is A's Nephew). Ideally I would like to be able to just define these relationships and inverse relationships so I can refer to them, since there is a relatively small number of types.

What is the right way to do this? Should I set up a separate Relationship model that defines and stores the relationship_type, then have the Artist model refer to that?

EAT THE EGGS RICOLA fucked around with this message at 23:53 on Nov 12, 2013

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance
You might want to look at using something like awesome_nested_set for that.

EAT THE EGGS RICOLA
May 29, 2008

prom candy posted:

You might want to look at using something like awesome_nested_set for that.

This is perfect for the hierarchy, but what would you say is the best way to define the relationship type? One person might have a half dozen child/parent/sibling nodes related to it, and I can use a helper or simple code in the view to figure out who is who in a simple family structure (kids and parents are obvious, nephews and nieces are just the children of siblings, etc) but what would I do if adopted kids, spouses, or roommates enter the picture?

EAT THE EGGS RICOLA fucked around with this message at 03:44 on Nov 15, 2013

KoRMaK
Jul 31, 2012



Is there a way I can manually execute the validtors that are listed on a model using the validates(*attributes) method?

I can get a list of them using Model.validators, but how would I then easily apply those to the instance I have? I want to skip the ones that use the validates_with clause and only run the ones that do validates(*args) e.g.
Ruby code:
validates :title, presence :true
e: I found a solution here http://stackoverflow.com/questions/3542819/in-rails-3-how-can-i-skip-validation-of-the-password-field-when-im-not-attempt

ee: Here's my current dilema: how do I move this code to a module? Currently this doesn't work.

eee: add included do to the module, this seems to work.
Ruby code:
#module.rb
module FieldValidatorModule
  module Model
    extend ActiveSupport::Concern
    included do
    attr_accessor :system_validations_only
    
    validates_with FieldValidator, :if => Proc.new{ |m| !m.system_validations_only }
    end
  end  
end
Ruby code:
#mymodel.rb
include FieldSettingValidatorModule::Model

KoRMaK fucked around with this message at 16:58 on Nov 15, 2013

a slime
Apr 11, 2005

Hey, I'm trying to write my first RSpec tests, and I don't know Ruby very well at all. I'm using WebMock to simulate some http requests. The application I'm testing should send a request that contains a list of attributes in the format "request=attr1,attr2,attr3,...", in no particular order after the equals sign. I want to test that all the required attributes are present.

stub_request only accepts a single .with call, and as far as I can tell that's the only way to check the content of the body of the request. Preferably I could get the content of the request as a string that I could check myself, but I'm not sure if that's possible. Right now, I have a shared example for the structure of the request, and then a bunch of little describes for each attribute.

code:
  shared_examples_for 'a key request' do
    before do
      stub_request(:post, 'http://example.org/keyrequest')
        .with( :body => /^request=.*\b#{attr_name}\b/ )
        .to_return( body: 'key=asdf' )
      get "/makerequest"
    end

    ...
  end

  describe 'GET /makerequest' do
    let(:attr_name) { 'attr1' }
    it_behaves_like 'a key request'
  end

  describe 'GET /makerequest' do
    let(:attr_name) { 'attr2' }
    it_behaves_like 'a key request'
  end

Is there a more concise way to do this? I feel like there should be a way to retrieve the text of the request body, but I can't figure it out.

edit:
WebMock lets you set up a custom callback on making a request, this looks like the answer
code:
  WebMock.after_request do |request_signature, response|
    puts "Request #{request_signature.body} was made and #{response} was returned"
  end

a slime fucked around with this message at 22:56 on Nov 15, 2013

prom candy
Dec 16, 2005

Only I may dance

EAT THE EGGS RICOLA posted:

This is perfect for the hierarchy, but what would you say is the best way to define the relationship type? One person might have a half dozen child/parent/sibling nodes related to it, and I can use a helper or simple code in the view to figure out who is who in a simple family structure (kids and parents are obvious, nephews and nieces are just the children of siblings, etc) but what would I do if adopted kids, spouses, or roommates enter the picture?

Oh you're like literally making a family tree app? You'll probably want a relationships table as you mentioned then. Eventually you may want to be able to add comments and other info to individual relationships as well.

Sil
Jan 4, 2007
Bit confused about how require works. I've got some files required in a spec_helper file. Then I require_relative that spec_helper file in a model_spec file. But the files that were required in the helper aren't loaded in the model_spec. However if I manually require the files in the model_spec everything is fine.

Is that supposed to work that way? ie. not being able to have chains of requires across files.

e. for reference this is in ruby 2.0, rails 4.0.1

Sil fucked around with this message at 05:38 on Nov 17, 2013

KoRMaK
Jul 31, 2012



I'm trying to incoporate facebook login via omniauth with devise. Users can login via facebook, but it broke the regular devise login. I'm getting a wierd error when a user does the ole devise login
Ruby code:
Started GET "/users/sign_in" for 127.0.0.1 
Processing by Devise::SessionsController#new as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Redirected to [url]http://localhost:3001/dashboard[/url]
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.2ms)

Filter chain halted as :require_no_authentication rendered or redirected


I have created a sessions_controller.rb that inherits from Devise::SessionsController but it looks like it is not overriding the gemmed version that comes with devise. How do I override the sessions_controller?

I set the routes for it to this

ruby posted:

devise_for :users, :controllers => {:sessions => "sessions"}

I also have tried overrideing require_no_authentication in the sessions_controller.rb but it never seems to called.

e: drat, I forgot the s in :controllers

KoRMaK fucked around with this message at 18:23 on Nov 19, 2013

EAT THE EGGS RICOLA
May 29, 2008

prom candy posted:

Oh you're like literally making a family tree app? You'll probably want a relationships table as you mentioned then. Eventually you may want to be able to add comments and other info to individual relationships as well.

I didn't really intend to make a family tree app at first, but I guess that's what makes the most sense now.

Thanks!

kayakyakr
Feb 16, 2004

Kayak is true

KoRMaK posted:

I'm trying to incoporate facebook login via omniauth with devise. Users can login via facebook, but it broke the regular devise login. I'm getting a wierd error when a user does the ole devise login
Ruby code:
Started GET "/users/sign_in" for 127.0.0.1 
Processing by Devise::SessionsController#new as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Redirected to [url]http://localhost:3001/dashboard[/url]
Filter chain halted as :require_no_authentication rendered or redirected
Completed 302 Found in 2ms (ActiveRecord: 0.2ms)

Filter chain halted as :require_no_authentication rendered or redirected


I have created a sessions_controller.rb that inherits from Devise::SessionsController but it looks like it is not overriding the gemmed version that comes with devise. How do I override the sessions_controller?

I set the routes for it to this


I also have tried overrideing require_no_authentication in the sessions_controller.rb but it never seems to called.

e: drat, I forgot the s in :controllers

What directions are you following for using omniauth with devise? I have a working devise + omniauth (for facebook, google, etc) and I don't have my sessions controller overridden.

The only things I've done is add an ominauth callbacks controller and the configuration to config/initializers/devise.rb

KoRMaK
Jul 31, 2012



kayakyakr posted:

What directions are you following for using omniauth with devise? I have a working devise + omniauth (for facebook, google, etc) and I don't have my sessions controller overridden.

The only things I've done is add an ominauth callbacks controller and the configuration to config/initializers/devise.rb
This one http://railscasts.com/episodes/360-facebook-authentication?view=asciicast

It doesn't talk about devise, so I'm filling in those gaps myself and with this gist
https://gist.github.com/schleg/993566

Maybe I should follow this guide https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview

KoRMaK fucked around with this message at 21:19 on Nov 19, 2013

prom candy
Dec 16, 2005

Only I may dance
I'm going to be mentoring at the Ladies Learning Code Ruby event in Toronto this Saturday. Come and say hi if you're there as a mentor or a student, I'll be the white nerdy guy with glasses. And if anyone knows any women who are interested in learning to code you should tell them about this event (or other LLC events) as they're apparently really good!

kayakyakr
Feb 16, 2004

Kayak is true

That's the one.

enki42
Jun 11, 2001
#ATMLIVESMATTER

Put this Nazi-lover on ignore immediately!

prom candy posted:

I'm going to be mentoring at the Ladies Learning Code Ruby event in Toronto this Saturday. Come and say hi if you're there as a mentor or a student, I'll be the white nerdy guy with glasses. And if anyone knows any women who are interested in learning to code you should tell them about this event (or other LLC events) as they're apparently really good!

Awesome! I'm mentoring there too. It is a really awesome event, Dessy (the instructor) does an amazing job with the course. I'll try to find you. (white nerdy guy with glasses is a bit of a broad category with LLC mentors..)

KoRMaK
Jul 31, 2012



Sweet, I have devise and facebook login working side by side. I had to override registrations and sessions to handle the two properly.

New question: how do I keep heroku from taking forever when doing the assets:precompile step? I added ckeditor to my vendor/javascripts folder and I am pretty sure that is what is taking it so long. I never change the files in that directory, so why does it precompile on each push? I want it to only precompile if there are differences.

In case anyone here wants to check out what I've been working on, you can find it at http://marquee.liquid-software.com It lets you create conversation threads connected to any gps location. Kind of like yelp, but instead of being tied to a business you can tie it to any arbitrary location.

kayakyakr
Feb 16, 2004

Kayak is true

KoRMaK posted:

Sweet, I have devise and facebook login working side by side. I had to override registrations and sessions to handle the two properly.

New question: how do I keep heroku from taking forever when doing the assets:precompile step? I added ckeditor to my vendor/javascripts folder and I am pretty sure that is what is taking it so long. I never change the files in that directory, so why does it precompile on each push? I want it to only precompile if there are differences.

In case anyone here wants to check out what I've been working on, you can find it at http://marquee.liquid-software.com It lets you create conversation threads connected to any gps location. Kind of like yelp, but instead of being tied to a business you can tie it to any arbitrary location.

try:
https://github.com/ndbroadbent/turbo-sprockets-rails3

prom candy
Dec 16, 2005

Only I may dance

enki42 posted:

Awesome! I'm mentoring there too. It is a really awesome event, Dessy (the instructor) does an amazing job with the course. I'll try to find you. (white nerdy guy with glasses is a bit of a broad category with LLC mentors..)

Cool! Yeah the white nerdy guy with glasses was kind of a joke, I assume there'll be a few of us who fit that profile. Just awkwardly ask everyone if they have stairs in their house, it's the only way.

Have you mentored before? What's it like? I don't really know what to expect.

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.
Teaching/Mentoring is awesome, but tough. Don't be too depressed if you fail miserably the first time you give it a go. Keep doing it if you can - finding simple ways to explain complicated subjects is one of the best ways to deepen your own understanding of the subject at hand.

prom candy
Dec 16, 2005

Only I may dance
It should be pretty interesting! The class has a dedicated teacher and a prepared lesson plan, so I think the mentors are just meant to wander and answer questions or help people who are stuck. I do a decent amount of mentoring at work but I haven't work with people who don't code at all before.

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
I'm comfortable with rails, but I feel like my ruby knowledge is lacking. Is there any recent material about the language that isn't aimed at people new to programming? A book would be good.

I want to know how classes, modules, closures, etc. work in ruby without googling each individual term as I remember that I want to learn about it, as that'll leave me with holes that I want to fill in.

Basically "oh, you already know some other language well? here's everything you should know about ruby!"

I'd like to get up-to-speed quickly. Basically, I'll be setting up something with Shopify's active_merchant to handle payments for the main product we're working on, and I'll doing something similar with Stripe's Abba, so it won't be extremely complicated, but I'd feel more comfortable if I had more Ruby knowledge.

Also, our operations guy would really like to have this done on a windows environment. The brief reading I've done suggests that ruby is much slower on Windows (though JRuby helps, kind of), that permissions will be a pain in the rear end, and that I can expect to have a hard time finding support* for any problems that may pop up because pretty much everyone talking about ruby online is not using Windows.

Pro to Ruby on Windows:
- Our server guy knows Windows really well, doesn't know anything about linux <-- This is the main issue

Con to Ruby on Windows:
- People online think it sucks, so as the only developer here with Ruby experience, if something stumped me, I could have trouble getting advice online?

The only linux experience I have is from using and developing on ubuntu day-to-day in my personal time. It seems like it makes sense to go with Windows, so that we have someone who actually understands the environments we'll be running it on. His time is more expensive than mine as well, so it makes more sense for me to spend time grappling with any Windows-Ruby issues that come up than it does for him to spend time figuring out redhat or something.

Safe and Secure! fucked around with this message at 20:46 on Nov 23, 2013

Obsurveyor
Jan 10, 2003

Safe and Secure! posted:

Basically "oh, you already know some other language well? here's everything you should know about ruby!"

I liked "The Well-Grounded Rubyist" when I was getting started. It still starts out pretty basic but it doesn't waste much time with it before getting into all the gritty details. It's a pretty good reference too that I still go back to when I'm looking for something.

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013

Obsurveyor posted:

I liked "The Well-Grounded Rubyist" when I was getting started. It still starts out pretty basic but it doesn't waste much time with it before getting into all the gritty details. It's a pretty good reference too that I still go back to when I'm looking for something.

Going from the amazon comments, that looks like exactly what I'm looking for. Thanks!

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.

Safe and Secure! posted:

I'm comfortable with rails, but I feel like my ruby knowledge is lacking. Is there any recent material about the language that isn't aimed at people new to programming? A book would be good.

I want to know how classes, modules, closures, etc. work in ruby without googling each individual term as I remember that I want to learn about it, as that'll leave me with holes that I want to fill in.

Basically "oh, you already know some other language well? here's everything you should know about ruby!"

I'd like to get up-to-speed quickly. Basically, I'll be setting up something with Shopify's active_merchant to handle payments for the main product we're working on, and I'll doing something similar with Stripe's Abba, so it won't be extremely complicated, but I'd feel more comfortable if I had more Ruby knowledge.

Also, our operations guy would really like to have this done on a windows environment. The brief reading I've done suggests that ruby is much slower on Windows (though JRuby helps, kind of), that permissions will be a pain in the rear end, and that I can expect to have a hard time finding support* for any problems that may pop up because pretty much everyone talking about ruby online is not using Windows.

Pro to Ruby on Windows:
- Our server guy knows Windows really well, doesn't know anything about linux <-- This is the main issue

Con to Ruby on Windows:
- People online think it sucks, so as the only developer here with Ruby experience, if something stumped me, I could have trouble getting advice online?

The only linux experience I have is from using and developing on ubuntu day-to-day in my personal time. It seems like it makes sense to go with Windows, so that we have someone who actually understands the environments we'll be running it on. His time is more expensive than mine as well, so it makes more sense for me to spend time grappling with any Windows-Ruby issues that come up than it does for him to spend time figuring out redhat or something.

If you're deploying to Windows, JRuby is your only real choice. MRI sucks balls and it is even worse on Windows. The good news is that if your shop has any kind of Java infrastucture, deploying JRuby apps is trivial. Warbler can create a .war file for you that you can deploy on any Servlet container, so in theory, the ops guys don't need to know anything about Ruby or JRuby.

JRuby does still have some string encoding problems on Windows (because most of the JRuby users and developers use Linux or OS X), but they're getting ironed out.

Smol fucked around with this message at 21:46 on Nov 23, 2013

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
That's great, our product is basically a pile of JSP running on a Tomcat server. So it doesn't sound like a horrible idea to go with Windows (and JRuby), then?

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.
Nope. And anyways, if you run into any problems or have any further questions, feel free to give me a shout here or on #jruby at freenode.

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
Thanks!

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.
Just be aware, you're going to have a bad time with gems that rely on C extensions. But fortunately, most of the widely used ones (e.g. database drivers, nokogiri for xml parsing) have direct JRuby ports or more-or-less equivalent alternatives, so in most cases, it's not a big issue. But there is a significant number of gems that you simply might not be able to use because of this. And of course, you'll be able to leverage the JVM ecosystem as well. Using Java libraries in JRuby is easier than using them in Java. :v:

Smol fucked around with this message at 21:54 on Nov 23, 2013

KoRMaK
Jul 31, 2012



There were a couple issues I ran into while trying to run my dev environment on windows and I eventually just jumped into running my own linux VM. I'm glad I did it. Linux isn't that scary and the gnome desktop is basically OSX. I like it alot now, and I've learned so much and I was able to learn at my own pace.

EAT THE EGGS RICOLA
May 29, 2008

KoRMaK posted:

There were a couple issues I ran into while trying to run my dev environment on windows and I eventually just jumped into running my own linux VM. I'm glad I did it. Linux isn't that scary and the gnome desktop is basically OSX. I like it alot now, and I've learned so much and I was able to learn at my own pace.

I did this too, I got so annoyed trying to run everything in windows that I eventually just gave up and did everything in either OSX or a linux VM.

kayakyakr
Feb 16, 2004

Kayak is true
Programming in Ruby helped me decide to make the permanent switch to Linux. Haven't looked back.

Smol
Jun 1, 2011

Stat rosa pristina nomine, nomina nuda tenemus.
Whatever OS you use for development, it's worth running your dev environments in virtual machines that are as close to the production environment as possible. Tools like vagrant coupled with something like chef or puppet make this really easy, not to mention how much they help in setting up and maintaining your production environments.

KoRMaK
Jul 31, 2012



Yep. That works. From 600 seconds down to 6 seconds. Thanks. Since I'm on heroku I had to add the builder pack to my app.

foutre
Sep 4, 2011

:toot: RIP ZEEZ :toot:
Apologies if this is the wrong place to ask this. I have basically no knowledge of programming (like, I knew Java and Visual Basic in middle school, but haven't programmed in the last seven years). Now though, I want to make a web-app (I think) that would basically just let people submit forms on a site, and then spit out a generic email response.

I have a good three months to do this, and want to figure it out myself. Would Ruby on Rails be a good way of doing this, and if so, what are some good resources for getting started?

At the moment I'm using codeacademy's Ruby track, that teaches poo poo like "what the hell does && do". I'm also taking CS 101 online from Stanford, that is basically "what is a program". Beyond that though, I'm not sure how to best go about teaching myself. Should I get a dummies book? Are there online resources I'm missing? I'd love help, thanks a lot.

e: Should I learn Python first like the FAQ suggests, or would I be ok going straight into Ruby?

kayakyakr
Feb 16, 2004

Kayak is true

foutre posted:

Apologies if this is the wrong place to ask this. I have basically no knowledge of programming (like, I knew Java and Visual Basic in middle school, but haven't programmed in the last seven years). Now though, I want to make a web-app (I think) that would basically just let people submit forms on a site, and then spit out a generic email response.

I have a good three months to do this, and want to figure it out myself. Would Ruby on Rails be a good way of doing this, and if so, what are some good resources for getting started?

At the moment I'm using codeacademy's Ruby track, that teaches poo poo like "what the hell does && do". I'm also taking CS 101 online from Stanford, that is basically "what is a program". Beyond that though, I'm not sure how to best go about teaching myself. Should I get a dummies book? Are there online resources I'm missing? I'd love help, thanks a lot.

Ruby on Rails is indeed a good language for what you want to do. Fairly easy to learn and has a good bit of hand-holding for beginners once you grasp a few concepts of the Rails conventions.

I used O'Reilly Rails Cookbook for my first book, but I'm more of a get it started and learn as I go kind of person, so I moved beyond the book pretty quickly.

There should be some other suggestions coming shortly, though.

MrDoDo
Jun 27, 2004

You better remember quick before we haul your sweet ass down to the precinct.

foutre posted:

Apologies if this is the wrong place to ask this. I have basically no knowledge of programming (like, I knew Java and Visual Basic in middle school, but haven't programmed in the last seven years). Now though, I want to make a web-app (I think) that would basically just let people submit forms on a site, and then spit out a generic email response.

I have a good three months to do this, and want to figure it out myself. Would Ruby on Rails be a good way of doing this, and if so, what are some good resources for getting started?

At the moment I'm using codeacademy's Ruby track, that teaches poo poo like "what the hell does && do". I'm also taking CS 101 online from Stanford, that is basically "what is a program". Beyond that though, I'm not sure how to best go about teaching myself. Should I get a dummies book? Are there online resources I'm missing? I'd love help, thanks a lot.

e: Should I learn Python first like the FAQ suggests, or would I be ok going straight into Ruby?

Michael Hartl's Ruby on Rails Tutorial would probably be a really good place for you to start. It has you built out a simple web app (basically a Twitter clone last time I used it but it could have changed). This would probably give you a good base to understand all of the pieces of Rails put together for a full app. For such a simple app like you are suggesting it might just be easiest to dive straight in to Rails and trying to implement it rather than trying to build more of a foundation first. If you really want to keep going with programming learning more about Ruby or Python would definitely be a good place to start and keep going what you are doing.

foutre
Sep 4, 2011

:toot: RIP ZEEZ :toot:
Thanks a lot, I'll try both. I like the idea of just jumping in and figuring things out along the way -- I'll probably be back here with problems though. Both of these also seem a lot better than codecademy. That was getting to be a little much.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

foutre posted:

Thanks a lot, I'll try both. I like the idea of just jumping in and figuring things out along the way -- I'll probably be back here with problems though. Both of these also seem a lot better than codecademy. That was getting to be a little much.

I'll second that tutorial with the only caveat is that people tend to not read it 100% and get stuck on things here or there, or have problems with setting Rails up which can be a little confusing the first few times you do it. It's easy to get the wrong version of a Gem or start out with the wrong version of Ruby and have weird stuff not work.

But once you get going, you should be able to run through that tutorial in a few days to a week depending on how much time you can put into it. Whether or not you should do all the 'tests' for the code is debatable (not tests like a quiz but code tests, it's a programming thing) and will take up most of the time. But once you're halfway through the book you could make a website where you can 'enter forms and get email responses' in a few hours. It's very powerful stuff.

raej
Sep 25, 2003

"Being drunk is the worst feeling of all. Except for all those other feelings."
Well, as a proof of concept with bogus data entries, I have the web app up and running on Heroku.

One thing I'm facing now is that to go live, I'll need to import my beer data set into the database. This means ~200,000 unique beers and ~14,000 breweries. This puts me into two options with Heroku:

1) $9/month - Hobby databases are designed for trial, development, testing, and basic usage for hobby apps. Hobby databases are not suited for production. Up to four hours of downtime per month.
2) $200/month - Tengu - 1.7GB RAM - 256GB storage - 200 connections

That escalates quickly.

Are the other hosting options for long but not wide databases?

kayakyakr
Feb 16, 2004

Kayak is true

raej posted:

Well, as a proof of concept with bogus data entries, I have the web app up and running on Heroku.

One thing I'm facing now is that to go live, I'll need to import my beer data set into the database. This means ~200,000 unique beers and ~14,000 breweries. This puts me into two options with Heroku:

1) $9/month - Hobby databases are designed for trial, development, testing, and basic usage for hobby apps. Hobby databases are not suited for production. Up to four hours of downtime per month.
2) $200/month - Tengu - 1.7GB RAM - 256GB storage - 200 connections

That escalates quickly.

Are the other hosting options for long but not wide databases?

They have another tier under standard for $50/month. But in all honesty, you could probably use their hobby level $9 database and be ok.

Other options:
- There's a heroku add-on that will give you a 1GB mysql db with claimed 100% uptime for $10/month.
- Could use AWS free tier for their sql-style database (think it has a 250 MB allowance).
- Could set up a $5/month small instance on DigitalOcean, install your own database, and open it up to connections from Heroku.

Adbot
ADBOT LOVES YOU

Nybble
Jun 28, 2008

praise chuck, raise heck

kayakyakr posted:

- Could set up a $5/month small instance on DigitalOcean, install your own database, and open it up to connections from Heroku.

I would recommend this highly. DigitalOcean is phenomenal.

(Heck, you could just put your app there, too.)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply