Earlier quoted context omitted.
For a while, I thought Sinatra was taking that role? It might be interesting to think about what people are looking for that's neither Sinatra nor Rails, or why Sinatra didn't live up to what people were hoping (if people think that). Sometimes I think some of this is just utopian grass-is-greener thinking. While there are _many_ things I'd do differently in Rails if I had the choice (some but certainly not all of wh…
For any project worth talking about Sinatra is too skinny. Basically you have to hack your routing in about the same way you do with Node's Express, enumerating the bindings between routes and methods. Obviously there are clever ways to do it but you end up reimplementing the resourceful routes of Rails. Another problem is that you really want to use ActiveRecord to access the database. Anything else it too painful.…
Lotus, a web framework for Ruby
131–140 of 143 posts
Re: Lotus, a web framework for Ruby
#132Weird, I get the idea of defining a new web framework API, but why would you build everything from scratch? There's loads of very good open source code out there. Why not fork DataMapper for Lotus::Model for example? Now you have some dodgy hand rolled library that's probably not seen enough eyes to be really production proof.
Re: Lotus, a web framework for Ruby
#133Looks nice. I particularly like the ORM, which seems well-designed compared to ActiveRecord. That said, I have a distinct feeling this is too little, too late. I and my teams have long migrated away from frameworks, to microservices, or what some people call SOA, and we are not looking back. I strongly encourage this design over the old monolithic Rails approach. These are mostly small, highly specialized Sinatra bac…
Re: Lotus, a web framework for Ruby
#134Earlier quoted context omitted.
For a while, I thought Sinatra was taking that role? It might be interesting to think about what people are looking for that's neither Sinatra nor Rails, or why Sinatra didn't live up to what people were hoping (if people think that). Sometimes I think some of this is just utopian grass-is-greener thinking. While there are _many_ things I'd do differently in Rails if I had the choice (some but certainly not all of wh…
Sinatra, in my opinion, gets pretty hacked together after the initial `def get '/'; puts "Hello World"; end` Personally, I think Camping is the perfect fit for Ruby frameworks
Re: Lotus, a web framework for Ruby
#135Looks nice. I particularly like the ORM, which seems well-designed compared to ActiveRecord. That said, I have a distinct feeling this is too little, too late. I and my teams have long migrated away from frameworks, to microservices, or what some people call SOA, and we are not looking back. I strongly encourage this design over the old monolithic Rails approach. These are mostly small, highly specialized Sinatra bac…
Can you give done examples of the types of things these micro services do?
- Single sign-on. We have a service that abstracts users into identities that map to one or more actual logins. It facilitates the OAuth interaction with providers. To add login in any app, you just redirect the browser to the microservice's /auth/:provider API; it redirects through FB or whatever.
- For sites that don't want to rely on providers like FB, we also have a simple OAuth provider that has a basic user database with salted passwords, email/password management, etc.
- Data store. We have a structured, hierarchical document-oriented data store that is a thin layer on top of PostgreSQL. Most apps don't have their own database, but use this data store.
- Security. We have a common, path-based security model across apps that can be validated through calls into a central security microservice; it's mostly a registry of what apps delegate responsibility, and when you ask the security service about whether, say, you're allowed to modify the object at path acmecorp.blogapp.posts.1, it asks every app that is registered to be the authority for that path. For example, acmecorp.blogapp might use a role-based security system, but a different path exampleinc.cmsapp might use LDAP.
- Voting. For Reddit-style voting and kudos we have a small microservice.
- Search. We wrap our data store in an indexing system that uses ElasticSearch.
- Organizational management. We have a microservice that handles members, groups and their roles. It plugs into the security system so that we can delegate access to very precise parts of the system. For example, any user can see comments, only the author can edit a comment, and editors can update anything.
- Email/texting. We have a microservice that abstracts text and email, currently supporting things like Mailgun and Twilio. It allows us to swap out the implementation without the app knowing.
- GIS/map stuff. We have a separate microservices for geocoding and storing GIS features.
- Image/audio/video processing. We have a wrapper around ffmpeg and other tools that processes transcoding requests.
An important piece of the system is the extensive use of pub/sub via RabbitMQ exchanges to asynchronously publish and listen to events. For example, any microservice can listen to changes to any part of the data store (based on path or event). For example, our search microservice automatically populates ElasticSearch with content from the data store.
Lastly, every app has a microservice as its own backend; for example, if the app is a blog system, we have a frontend (eg., a Node.js desktop/mobile web UI), and a separate backend tailored to that frontend; the frontend treats the backend like any other microservice.
Re: Lotus, a web framework for Ruby
#136Earlier quoted context omitted.
>If your website doesn't work with NoScript turned on, I won't utilize it. You're definitely in the minority then, most users don't even know what javascript is let alone NoScript. I find it ridiculous that people are arguing against javascript, we're using a computer and not allowing it to run code.
we're using a computer and not allowing it to run code. ...from sources which some people find uncomfortable to be blindly trusting. From a security perspective, it's a huge attack vector - the majority of browser exploits require JS to work. Even if it's sandboxed, there's also the annoyance aspect; scripts can consume CPU and do all sorts of irritating things like breaking the back button and seizure-inducing anima…
You don't need JavaScript for that.
div {
animation: seizure 16.6ms infinite alternate;
}
@keyframes seizure {
0% { background: black; }
100% { background: white; }
}Re: Lotus, a web framework for Ruby
#137Earlier quoted context omitted.
JavaScript is required to read any article? Why? The apps that I work on require JavaScript, but the landing pages for these apps do not. The content sites that I've worked on also don't require JavaScript. Not once in my life have I been reading an article on the web when I said to myself, "Man, this article sure could use some JavaScript."
Not once in my life have I ever considered switching off JavaScript. How completely silly.
However there are security concerns when dealing with JavaScript. For example, if you've ever surfed the darknet, disabling JavaScript is highly recommended to avoid present and future exploits that could compromise your anonymity, funds, etc.
Re: Lotus, a web framework for Ruby
#138Earlier quoted context omitted.
I suspect that many sites simply do not have staff and/or resources capable of producing NoScript-friendly (degradable) work.
Producing NoScript-friendly work is, oddly, ridiculously easy. You write your "view" code for React.JS, and render this via node.js on the server, then have the client do exactly the same. You can pick up libraries - or write your own in half an hour - which implement the glue to talk to models from both the client and the server. You shouldn't even need to write your business logic in node.js if it doesn't fit the l…
Re: Lotus, a web framework for Ruby
#139By what I've seen I like the spirit of Lotus, but I sense a movement away from complete web frameworks to pure API back-ends with the emergence of great single page JS frameworks like Ember. One ruby one that I like is https://intridea.github.io/grape/ . One interesting node API framework I mean to try is http://loopback.io/ .
Yes, I also think that the future of backend development is micro services communicating over defined HTTP API endpoints or other message protocols. If you look closely, rendering presentation layer on the server side and then sending it to the client is a hack and we've been doing it for a long time. It's time for changes.
From the view/presentation layer's perspective, it shouldn't matter where the rendering happens, and as a programmer working on these systems I'm tired of baking assumptions about the data layer into the view layer.
I actually think there's a best-of-both-worlds solution that we'll converge on at some point, which is this:
We have the option of rendering in both locations with the same code.
This allows the initial render to be offloaded to the server (so that the app's initial state is totally established and can be sent along with the app itself in a single HTTP request), and then subsequent rendering updates could happen mostly client-side (fetching only the raw data from the server where necessary).
This allows the JS-everywhere crowd to build their entire app as if all logic is running in-browser (with only a basic API on the server), but it appeases the more old-fashioned developers who want to be able to construct mappings between URLs and actual HTML documents (that don't have to be spun up and re-constructed using client-side scripting). There's obviously a huge debate here as to whether or not the latter is worth it, but I'd say it would be nice if only so that I don't need to have a flash of unloaded content or a "loading" indicator before the app is ready to be used.
I also don't like having to use PhantomJS to scrape data from a website that could very easily consist of HTML documents instead of a blob of JS, but that's probably not enough to affect most people's opinions.
Re: Lotus, a web framework for Ruby
#140Earlier quoted context omitted.
Can you give done examples of the types of things these micro services do?
Sure. I have been thinking about writing up a blog post about our work since it may be of use to others. A quick summary of some of our current microservices: - Single sign-on. We have a service that abstracts users into identities that map to one or more actual logins. It facilitates the OAuth interaction with providers. To add login in any app, you just redirect the browser to the microservice's /auth/:provider API…