Phoenix as a Meteor alternative

In either framework it wouldn’t be so cut and dry. You could also have the user subscribe to data with no arguments and they could get realtime data (but in this example we need the passenger coords).

So the only way to have something as easy as Meteor publications with other backends is to use RethinkDB/Postgres changedfeeds (which puts the load on the DB instead of the web app).

Pretty much. Someone has to calculate the changes. If you need easy realtime Meteor is the best fit. Nothing at scale is going to be easy :smiley: Rethink seems to be the most optimized for this on a very low level though. Every mutation is made in a way for realtime updates where as the oplog is a bolted on solution.

2 Likes

Then RethinkDB will solve almost all the problems that people have with Meteor scaling haha :stuck_out_tongue: And also, apart from having a better programming paradigm, structure, good practices, tests, performance and fault-tolerance, what will be the advantage of Phoenix over Meteor if the load will be on the DB and not on the web server ?
(Btw, I’ll receive ''Programming Elixir" next Monday :smiley: !)

1 Like

Not a lot as far as publications go. One thing is that you’d have the option to use pub/sub for realtime without a changefeed. Outside of publications you’d have more control over everything (like webpack vs Meteor bundler).

the zotonic promo video is quite possibly the awesomest thing i’ve seen today.

3 Likes

How about to create a repository where we can try to simulate the Meteor behaviour?

2 Likes

What behaviour do you want to simulate ?

Combo of Webpack, React, Redux, Channels - pub/sub (add items/update/remove), User Authentication, SQL database as a start.

3 Likes

So you want to create a boilerplate project where all those components and base functionalities are already pre installed/configured ? That’s a good idea !

We can use the already available repo from the Phoenix React tutorial and build upon it ?

1 Like

Yes, some kind of a boilerplate, we can use to quickly start a new project or just try (or benchmark), how it works. I like this tutorial, but I miss User Auth and Router part, which are must have for me.

3 Likes

Thank you for the research. I know what I’m doing this weekend! :slight_smile:

You could always fork that project yes, but I’m of the opinion it’s best to see what @ryanswapp comes up with first. After all, his React/Meteor tutorial was excellent. I’m sure his version will have basic auth and routing in some fashion.

Redis is hand tuned to the point it would easily win an obfuscated c contest. RethinkDB I’ve read is a tad slower than Mongo.

Also, Redis is getting geo queries in 3.2.

Don’t thank me. Blame @SkinnyGeek1010 for turning me on to Phoenix. 30 years of OO down the drain!

Hah why is poor Charlotte sitting in the back? Her website gets a lot of hits… no comment!

3 Likes

Meteor could really improve the documentation like they have done with Phoenix. It was quite easy and felt a less steep learning curve compared I had with Meteor. Of course, the full documentation is really good these days - however I spend a lot of time finding things that were deprecated or simply non-existing. Important differences in Meteor vs other solutions were merely mentioned. Hopefully, that will change.

1 Like

Did you see my meteor-elixir project towards the top? It has a Reactive setup that would be similar to using a webpack outside of the Phoenix app (only it’s Blaze in this case).

I also have a boilerplate with webpack/redux/redux-router for the frontend and the server just needs a command run:

mix phoenix.new foo  --database mongodb
cd foo
mix deps.get

And then the generator builds the server boilerplate for you. If you have your models ready then you can scaffold out a model, controller, routes, and tests (this is great for learning too):

mix phoenix.gen.json posts post title:string desc:string

However, it’s not pre wired up to the Phoenix’s channels (though you could mash together the two repos and use the HTML if you want). Also if someone is looking for an app to replicate my facebook wall clone it’s up on my Github :wink:


[quote="miningsam, post:113, topic:13519"] Meteor could really improve the documentation like they have done with Phoenix. It was quite easy and felt a less steep learning curve compared I had with Meteor. [/quote]

I agree, I was going to refer Sashko to those guides as a reference as he’s working on new guides now.

2 Likes

you’ve made some great points regarding computing resources needed for SSR and SSR may not be necessary for most apps.

However, for consumer and/or content heavy sites, SSR is critical for SEO and, indirectly, traffic generation.

Wonder if there is a feasible option to React SSR w/ Phoenix. If not, pre-render may be the next best option.

1 Like

Most likely you’d want a node cluster to serve out the initial HTML pages and then when the client renders it can connect to Phoenix. Serverside rendering React is also going to have it’s own issues using flux/redux but that’s a sep. thread :smile:

Phoenix started as an API first and recently added the view layer so it’s definitely not required to use it.

If SEO is the concern, I was under the impression that google webcrawler is quite adept these days at rendering and indexing javascript driven sites.

Perhaps I’m wrong about that? It’s not just use webpack to speed up the initial page load and call it a day?

1 Like

Google does a great job at this. At one time they dinged you for the slower page load but i’m not sure if this is the case now. I’m running blonk.co without any kind of spiderable package. Bing at one time didn’t rank as well and i’m not sure if that’s why.

Ideally you could have a proxy in front sniffing headers and then serve an SSR to the bots only, and real users get a non-SSR (I know RDIO did this).

Personally for my stuff I just compile webpack, kick off a makefile, and watch it upload to S3 and Cloudfront. The server gets deployed as an API only to keep things simple and flexible.


> Don't thank me. Blame @SkinnyGeek1010 for turning me on to Phoenix. 30 years of OO down the drain!

Haha. JS just got classes and I was so excited… now i’m not using them and realizing the functional style has been there in JS for years :see_no_evil:

While you’re going back to the stone age you might be interested in this emacs setup for Elixir. I’m a diehard Vim fan and i’m now preparing to dip my toe over into the darkside to see if it’s worth it :smile: The vim binding sound good enough… we’ll see!

Hah I always used pico/nano. I guess the equivalent of writing source in notepad. I looked at the vi/vim guys like they were insane. The only command I ever learned in it was :q! to get the hell out of dodge.

There is an elixir plugin for IntelliJ. I need a full IDE these days.

That made my day lol. Sounds like a true Java developer :laughing: :stuck_out_tongue:

Does that plugin work well?

I’ll admit, the first week is hell, the 2nd week you’re close to where you started and a few months later it’s smooth sailing. Years later, sublime feels like it’s the weird one and is hard to use lol.

All joking aside the main reason i’m switching, at least on Elixir projects, is that Alchemist has IDE type functionality built into it. Having the ability to auto complete, lookup documentation, jump to definitions, run tests, run iex in the editor, etc… (and Chris uses it too lol)

Kicking the tires in regular emacs mode (not Vim lol) might be easier until there’s a full IDE.

1 Like

Tbqh that doesn’t look too bad at all. I might actually give that a shot.

I wrote straight ansi-c code in pico not java! That was at a time before there were such things as an ide. I still use it to edit bash scripts.

1 Like