11

We're all familiar with basic ORM with relational databases: an object corresponds to a row and an attribute in that object to a column, though many ORMs add a lot of bells and whistles.

I'm wondering what other alternatives there are (besides raw access to the data). Alternatives that just work with relational databases would be great, but ones that could work with multiple types of backends besides just SQL (such as flat files, RSS, NoSQL, etc.) in a uniform manner would be even better. I'm more interested in ideas rather than specific implantations and what languages/platforms they work with, but please link to anything you think is interesting.

swampsjohn
  • 6,826
  • 7
  • 37
  • 42
  • I don't mean to be rude, but I addressed that specifically in my question. Any platform is fine, I'm interested in the concept more than implementations. – swampsjohn May 24 '10 at 02:54
  • 5
    @Lukas Eder why was this closed as "opinion-based"? The author appears to be looking for alternatives to ORM - this may impart, to you, an opinion about ORM, but the question remains valid, and there are alternatives. Where in that question do you infer an opinion? – mindplay.dk Nov 01 '15 at 15:47
  • 1
    @swampsjohn, Good old question. I've been working on a OpenSource project that delivers good ORM alternative that's focused on high-latency connections (cloud SQL/NoSQL). I would love to hear your thoughts: http://git.io/ad – romaninsh Nov 30 '16 at 09:32
  • 3
    @LukasEder this should never have been closed as "opinion-based", nothing in it asks for an opinion. It simple asks *"What are the alternatives..."* not *"Which ones are good/bad/why?"* – smci May 12 '19 at 06:45
  • The last sentence *"I'm more interested in ideas rather than specific implantations and what languages/platforms they work with, but please link to anything you think is interesting."* should be removed/edited to keep the question objective and having a specific answer. – smci May 16 '19 at 00:39

2 Answers2

4

Your basic choices are:

  • Just use raw SQL.
  • Pick an ORM that meets your needs. Most platforms have a variety of choices. - for example the .NET platform supports LINQ, nHibernate, Entity Framework, etc.
  • Write your own ORM and/or data access framework.
Justin Ethier
  • 131,333
  • 52
  • 229
  • 284
  • 1
    I'm asking if there are other abstractions for data access besides ORM. Unless everyone is using ORM as a catch-all for "everything higher-level than raw SQL", there must be other ideas people have had for encapsulating access to a database. – swampsjohn May 24 '10 at 16:15
  • 1
    Perhaps, but if you look at all of the different ORM solutions, you will see that there is a *lot* of variety among them. For example, compare LINQ, Ruby-on-Rails ActiveRecord, and Sybase' DataWindow.NET - all could be considered "ORM" yet each uses their own unique approach. – Justin Ethier May 24 '10 at 16:20
  • 1
    @swampsjohn Check out https://github.com/craigmichaelmartin/sql-toolkit as an example of a non-ORM data access library. – craigmichaelmartin Mar 22 '19 at 20:54
1

I'm working in something more or less along the lines you have said. I think that data-store related tools have grown complex with time instead of simpler and more usable.

So, instead to add complexness, this kind of things must be as simple as:

  1. Get something that points to the data
  2. Use it to do something with the data (query or modify)

The thing you use to interact with the data should do some kind of (transparent) adaptation to the data-store you are working with, and done.

The translation thing may sound a bit ORM-like, but I'm speaking of something more generic:

  • Some kind of internal implementation to communicate with whatever you are working with (something similar to a JDBC driver, but without the need to work with SQL)

  • Some kind of mapping to convert data to java object (more or less like in ORM)

The implementation of these concepts I've developed is for java and you can see more of it at http://www.bryghts.com

Right now, I've only developed an engine for SQL related data-sources, but it's prepared for independence of it.