Why use your application-level cache if database already provides caching?

Because to get the data from the database’s cache, you still have to: Generate the SQL from the ORM’s “native” query format Do a network round-trip to the database server Parse the SQL Fetch the data from the cache Serialise the data to the database’s over-the-wire format Deserialize the data into the database client library’s … Read more

CREATE DATABASE using file in default path

Create the database ‘Documents’ and give file properties through an alter. USE [master] GO CREATE DATABASE [Documents] GO ALTER DATABASE [Documents] MODIFY FILE ( NAME = N’Documents’, SIZE = 512MB, MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) GO ALTER DATABASE [Documents] MODIFY FILE ( NAME = N’Documents_log’, SIZE = 256MB, MAXSIZE = UNLIMITED, FILEGROWTH = … Read more

Generating an image of a database schema used in a Rails app

Have you tried rake db:schema:dump? Essentially, make sure that your database.yml file is referencing the database you wish to dump, and then run the command. It’ll take all of the tables and indexes in said database and then write it out to schema.rb. Note that you should rename schema.rb once it contains the dump; otherwise, … Read more

Is it recommended to use Database as a container in Production environment?

This blog post lists some reasons why you should not run production databases in containers. It also references another blog post describing problems with updating docker and unstable storage drivers. The main points here for me boil down to this: Dodgy storage drivers. This may be less of a problem when you write your database … Read more

What is the recommended equivalent of cascaded delete in MongoDB for N:M relationships?

What you are doing is the best and most optimal way of doing it in Mongo. I am in a similar situation and after going all possible implementations of the N:M design pattern, have also arrived to this same solution. Apparently, This is not a mongodb thing, but more of a concept of NoSQL, wherein, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)