Active record is also use in Hibernate/nHibernate for java and .net as an o/r (object relational) mapper. There are a number of things someone can do to speed/ or tweek the way that data is accessed. From what I have seen about the web.
You want to design your functions in such a way that you are not doing anything complicated at first. This means that you should focus your API, webservice, or website around operations that perform a single DB call, and are linear in their search time, sometimes page-ation can help too. If you have an api that, for instance tries to find friends of friends, you are opening yourself up to disaster if you are going to do that in real time for a web service. You would be better off offering a service that gives you the friends of a user, pending you have the rights to see that users friends.
Something else we discovered was that if you are using MySQL on a different box in the cloud, your data access times are going to be SLOW, but if you have the DB running on a machine connected through a 1Gb connection you might be alright, but if you have MySQL running on the same dedicated box, then DB calls are almost as fast a calls to memory. Especially if you set up your db connection to connect through some sort of piped call or something similar in linux. At that point your call avoids going through your network interface and you skip the TCP/IP stack, which is a huge latency boost.
You want to design your functions in such a way that you are not doing anything complicated at first. This means that you should focus your API, webservice, or website around operations that perform a single DB call, and are linear in their search time, sometimes page-ation can help too. If you have an api that, for instance tries to find friends of friends, you are opening yourself up to disaster if you are going to do that in real time for a web service. You would be better off offering a service that gives you the friends of a user, pending you have the rights to see that users friends.
Something else we discovered was that if you are using MySQL on a different box in the cloud, your data access times are going to be SLOW, but if you have the DB running on a machine connected through a 1Gb connection you might be alright, but if you have MySQL running on the same dedicated box, then DB calls are almost as fast a calls to memory. Especially if you set up your db connection to connect through some sort of piped call or something similar in linux. At that point your call avoids going through your network interface and you skip the TCP/IP stack, which is a huge latency boost.