database-schema

Import and export schema in cassandra

会有一股神秘感。 提交于 2019-11-28 17:05:04
问题 How to import and export schema from Cassandra or Cassandra cqlsh prompt? 回答1: To export keyspace schema: cqlsh -e "DESC KEYSPACE user" > user_schema.cql To export entire database schema: cqlsh -e "DESC SCHEMA" > db_schema.cql To import schema open terminal at 'user_schema.cql' ('db_schema.cql') location (or you can specify the full path) and open cqlsh shell. Then use the following command to import keyspace schema: source 'user_schema.cql' To import full database schema: source 'db_schema

What's better - many small tables or one big table?

泪湿孤枕 提交于 2019-11-28 16:41:16
I've got a database which will store profiles about individuals. These individuals have about 50 possible fields. Some are common things like, first name, last name, email, phone number. Others are things like hobbies, skills, interests Some are height, weight, skin color. Each of these groups are used by the system at different times. In terms of being able to negotiate through the database I would prefer to have 7 tables each of about 8 fields. What is best practice to do? EDIT: The data is going to be used in a search engine, for finding profile matches. Does this affect what I am doing? It

Mysqldump: create column names for inserts when backing up

时间秒杀一切 提交于 2019-11-28 16:37:54
How do I instruct mysqldump to backup with column names in insert statements? In my case I didn’t a normal back up with insert sql’s resulting in LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` INSERT INTO `users` VALUES (1 structure. Now I went ahead and removed a column from the schema in users. After this when I run the backup sql’s I get a column number mismatch error . To fix this how do I go about instructing mysqldump to write column names too? Here is how I do it now mysqldump --host=${dbserver} --user=${dbusername} --password=${dbpassword} \ --no-create-db --no-create-info -

MongoDB Structure for message app

点点圈 提交于 2019-11-28 16:29:14
问题 I am breaking my mind up thinking about a good document structure for handling a message app. I basically need three (or four) types of objects: The user (username, email, password, etc.) The contacts list (containing different contacts or contacts groups) The conversation (a conversation is a collection of messages between some persons) The message (contains the message body, some timestamp and the creator.) My idea was to embed the contacts into the user document and to embed the messages

SaaS database design - Multiple Databases? Split?

只愿长相守 提交于 2019-11-28 15:12:53
I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps other commonly shared tables in another DB? Start with one database. Split data/functionality when project requires it. Here is what we can learn from LinkedIn: A single database does not work Referential integrity will not be possible Any data loss is a problem Caching is good even when it's modestly effective Never underestimate growth trajectory

The three schema of the database

人走茶凉 提交于 2019-11-28 13:35:13
问题 I have created a database in Access and right know i have to write a report. I know that the databasesystem has three forms of schemas: physical, conceptual and external. Does the following ER diagram (by using the method normalization ) belongs to the conceptual level?: Or does this belong to the conceptual level?(incl. ref integrity): As for the phisical schema, does this include the integrity rules? 回答1: The Three-level ANSI-SPARC Architecture aka three schema approach: An external schema

What are OLTP and OLAP. What is the difference between them?

橙三吉。 提交于 2019-11-28 13:07:42
问题 Actually what do they mean? All articles I find about them don't give me an idea, or my knowledge is too insufficient to understand it. Will some one give me some resources with which I can learn this from scratch. 回答1: Here you will find a better solution OLTP vs. OLAP OLTP (On-line Transaction Processing) is involved in the operation of a particular system. OLTP is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE). The main emphasis for OLTP systems is

relationships between 3 entities in ER diagram--is a ternary enough or are 2 binaries also needed?

一世执手 提交于 2019-11-28 12:25:48
I'm trying to draw an ER diagram for my project management software describing the following. It contains these entities: project - software projects tasks - software projects that can be broken into a number of tasks employees - employees that belong to this software And: A project can be divided into tasks. (Tasks can be created by the admin user, who can assign those tasks to selected projects. Here there is only assignment of tasks to projects, not assignment of employees to projects.) Employees can be assigned to projects. (An employee can be assigned to projects. Here there is only

How to check if database schema matches Entity Framework schema?

妖精的绣舞 提交于 2019-11-28 12:08:13
For my surprise, using the CreateDatabaseIfNotExists context initializer, the line context.Database.Initialize(true) doesn't throw an exception if the schema does not match my code first schema. Is there a way to validate if the current database matches our schema before, for instance, we try to access a entity, whose table doesn't exist on the database anymore, and an exception is thrown by EF? You can call CompatibleWithModel to determine if the database matches the model. If you set the parameter to true it will throw an exception if no model data is found in the database. bool isCompatible

Migrating ManyToManyField to null true, blank true, isn't recognized

倖福魔咒の 提交于 2019-11-28 09:04:27
I have made a model change from standard = models.ManyToManyField(Standard) to standard = models.ManyToManyField(Standard, blank=True, null=True) South schemamigration for this app doesn't recognize the change? Similar to this question, which is unanswered: South migrations and changes to many-to-may fields That behavior is correct: null doesn't mean anything at the database level when used with a ManyToManyField . The declaration of a ManyToManyField causes the creation of an intermediate table to hold the relationship, and although Django will create a standard attribute on your model