DEV Community

Cover image for What is Active Record? (Quick Intro)
Aweys Ahmed
Aweys Ahmed

Posted on

2 1

What is Active Record? (Quick Intro)

In this blog post, I'll introduce you to Active Record which is used in the Rails framework.

Ruby on Rails uses a software design pattern called Model-View-Controller (MVC) and Active Record is part of the model in MVC. This means that Active Records works with your database.

Object Relational Mapping (ORM)

Active Record is an ORM. Using an ORM allows a developer to use the language they are working with to query a database without having to use MySQL, PostgreSQL or other databases query commands.

Active record maps the class name to a table in a database and each row to an instance of the class.

This is part one of the intro into Active Record and it will be a series. The following blog posts in this series will cover.

  • Intro Part II
  • Migrations
  • Validations
  • Callbacks
  • Associations
  • Queries

So far what you need to know about Active Record is that it is an ORM. It allows you to interact with a database using the language that you are building your application with.

In part two, we will look at some examples of how Active Record allows you to interact with your database.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay