Tag: database design

A Library Data Model

What data model would allow you to comfortably search for books and borrow them in your local library? Have you ever gone to a library and borrowed a book? Maybe that seems old-fashioned in today's world of instant internet knowledge and e-books. But I'm sure there's still this analog part of you that still likes to smell, touch, and read books. Or maybe you were forced to use a library when you couldn't find something on the internet!

A Database Model for a Hotel Reservation Booking App and Channel Manager

Everybody books into a hotel at some point. In this article, we’ll look at a data model that could power a hotel reservations system and channel manager. Faster, cheaper transportation options allow us to travel across the world in a matter of hours. And people have more disposable income than ever before. Is it any surprise that tourism is growing rapidly? In addition to traditional hotel booking channels, we also have newer options – like Airbnb and Booking.

Using Python and MySQL in the ETL Process: Using Python and SQLAlchemy

In the previous two articles of this series, we discussed how to use Python and SQLAlchemy to perform the ETL process. Today we’ll do the same, but this time using Python and SQL Alchemy without SQL commands in textual format. This will enable us to use SQLAlchemy regardless of the database engine we’re connected to. So, let’s start. Today we’ll discuss how to perform the ETL process using Python and SQLAlchemy.

Using Python and MySQL in the ETL Process: SQLAlchemy

SQLAlchemy helps you work with databases in Python. In this post, we tell you everything you need to know to get started with this module. In the previous article, we talked about how to use Python in the ETL process. We focused on getting the job done by executing stored procedures and SQL queries. In this article and the next, we’ll use a different approach. Instead of writing SQL code, we’ll use the SQLAlchemy toolkit.

Using Python and MySQL in the ETL Process

Python is very popular these days. Since Python is a general-purpose programming language, it can also be used to perform the Extract, Transform, Load (ETL) process. Different ETL modules are available, but today we’ll stick with the combination of Python and MySQL. We’ll use Python to invoke stored procedures and prepare and execute SQL statements. We’ll use two similar-but-different approaches. First, we’ll invoke stored procedures that will do the whole job, and after that we’ll analyze how we could do the same process without stored procedures by using MySQL code in Python.

Designing a Database for a Recruitment System

Do you want to learn how to design a database system and map a business process to a data model? Then this post is for you. In this article, you’ll see how to design a simple database schema for a recruitment company. After reading this tutorial, you will be able to understand how database schemas are designed for real-world applications. The Recruitment System Business Process Before designing any database or data model, it is imperative to understand the basic business process for that system.

A SaaS Subscription Data Model

SaaS (Software as a Service) is one of the three main components of Cloud computing. Usually, SaaS applications are web-based and can handle many different users at one time. Subscription-based solutions are very popular SaaS offerings. Some well-known SaaS products include Microsoft Office 365, Amazon Web Services (AWS), Slack, Jira, Stripe, and (of course) Vertabelo! Today we’ll take a look at a data model that would allow us to manage SaaS subscriptions.

The Important Dates Data Model

Are you forgetting something? A data model to help you remember important dates – before they happen. Have you ever forgotten an important date – your mom’s birthday or your anniversary? Or that you’re giving a lecture? Yup, things like that happen in real life. Maybe not to all of us, but to some of us (including me), they certainly do. To prevent such disasters, we’ll create a data model you could use as the background for an application that will notify you right on time.

A Data Model for a Wine Store

Producing a great wine is a really complex process, one that takes many years to master. Offering and selling wines to customers is another complicated process. There are many stores specializing in only one product. If you want that product, you’ll go to that store. Wine stores are an example of what I’m talking about. What would be the data background of a wine store? Let’s find out.In many ways, a wine store is like any other store. So, you can expect this data model to have most of the tables common to any other retail business. Still, there will be some details that will distinguish this model from others.

A Peer-to-Peer Lending Platform Data Model

There are many online portals which allow investors to lend money directly to individual borrowers – with no banks acting as intermediaries. What data model might underlie such a site?Online lending platforms bring borrowers and investors together and allow them to choose to whom they want to lend their money (in the case of investors) and who they want to borrow money from (in the case of borrowers). Some peer-to-peer lending sites also allow borrowers and investors to make their own deals in terms of lending rates (i.e. interest rates) and loan tenure.

Automobile Repair Shop Data Model

Running an automobile/car repair shop is a really complex business. You’ll need to make appointments while some customers will drive in and you don’t want to have them wait for hours. Also, you’ll need to organize employees, track repairs, materials, charge customers, etc. You’ll definitely need an IT solution and, of course, a data model in the background. Today we’ll talk about one such model.The IdeaI’ve already mentioned that this business model is really complex. Therefore, I won’t try to cover everything. I’ve intentionally omitted tracking materials and spare parts and also simplified some parts of the model. The reason for that is pretty simple. If I’ve included really everything, the model would simply be too large for an article of the reasonable size. So, let’s start.

The Smart Home Data Model

Smart homes used to be strictly in the future; now they are a reality. Most of us have heard about them, but they are not so widespread as they will be in the near future. Managing your home the ‘smart’ way will definitely produce a lot of data. Today, we’ll analyze a data model we could use to store smart home data.The Data ModelWhen you think of a smart home, you probably think of remotely locking and unlocking your home, activating alarms, lights, or cameras from your phone, having thermometers that automatically manage your heating and cooling, etc. But smart homes can do much more. You can connect a number of smart devices and controllers to achieve many complex functionalities. You can send instructions to devices or read their statuses from wherever you are.

A Data Model for a Freelancers Collective

Freelancing is becoming more and more popular these days. While most freelancers are a one-man band, that’s not the only option. You could be a part of a collective and collaborate on larger and more complex projects. A data model that could power a freelancers collective’s app is the topic of today’s article.Freelancing is not new, but it’s becoming more and more popular. Working from 9:00 to 17:00 has certain advantages, but it also comes with many disadvantages. Therefore, an increasing number of people decide to become freelancers.

The 9 Most Common Database Design Errors

You’ve probably made some of these mistakes when you were starting your database design career. Maybe you’re still making them, or you’ll make some in the future. We can’t go back in time and help you undo your errors, but we can save you from some future (or present) headaches.Reading this article might save you many hours spent fixing design and code problems, so let’s dive in. I’ve split the list of errors into two main groups: those that are

A Subscription Business Data Model

In the previous two parts, we’ve presented the live database model for a subscription-based business and a data warehouse (DWH) we could use for reporting. While it’s obvious that they should work together, there was no connection between these two models. Today, we’ll take that next step and write the code to transfer data from the live database into our DWH.The Data ModelsBefore we dive into the code, let’s remind ourselves of the two models we’ll work with. First is the transactional data model we’ll use to store our real-time data. Taking into account that we run a subscription-based business, we’ll need to store customer and subscription details, customers’ orders, and the order statuses.

A Subscription Business Data Model

Can you design an OLAP database model from an OLTP model? In this article, we’ll show you how!This is the second article of our data warehouse (DWH) series. You can find the first one here . The idea behind the series is to start with the OLTP (Online Transaction Processing) database model, present a possible solution for the reporting/OLAP (Online Analytical Processing) data model, and then finally consider the code we’ll use to perform the ETL process.

Querying MySQL’s INFORMATION SCHEMA: Why? How?

Databases need to run optimally, but that’s not such an easy task. The INFORMATION SCHEMA database can be your secret weapon in the war of database optimization.We’re used to creating databases using a graphical interface or a series of SQL commands. That’s completely fine, but it’s also good to understand a bit about what is going on in the background. This is important for the creation, maintenance, and optimization of a database, and it’s also a good way to track changes that happen ‘behind the scenes’.

A Subscription Business Data Model

Welcome to a new series that shows you the practical side of the data warehouse (DWH)! In the first article, we’ll tackle a data model for a subscription business.In previous data warehouse articles ( The Star Schema , The Snowflake Schema , Star Schema vs. Snowflake Schema ) we focused more on the theory. In this series, we’ll show you how you could create a data warehouse for a real-life application, such as a database model. Today, we’ll take a look at the data model behind a subscription-based business. In upcoming articles, we’ll build a DWH and the code that makes the magic work.

A Marathon Training App Data Model

Do you dream of running a marathon? Let’s look at the data model for an app that could take you from lazy couch potato to marathoner.What do you need to run a marathon? You’ll need enthusiasm and determination. A good pair of running shoes. And lots of physical training! Let’s say you have an app that helps you go from novice runner to marathon finisher. What would the data model look like?

The Secrets of Dominoes, or A Domino Game Data Model

Board games like dominoes are still very popular. Let’s take a look at dominoes from a data modeling point of view.The game of dominoes has been around for hundreds of years, and it’s played all over the world. As you might expect, this means a lot of variations in play! In this article, we’re going to examine a data model that could support the most common variants – draw and block. The basics of these two variants are almost the same; there’s just slight differences in rules. Dominoes can be played by two or more players, so our data model will support multiple players.

Spreadsheets vs. Databases: Is It Time to Switch? Part 2

Spreadsheets – Excel, Google Sheets, or a sheet by any other name – are really cool and powerful tools. But then, so are databases. When should you stick with a spreadsheet? When should you move up to a database?This is the continuation of my previous article “ Spreadsheets vs. Databases: Is It Time to Switch? ” where we’ve discussed the most common disadvantages of using spreadsheets to organize lots of data. In this article, we will find out how a database solves those problems.

Spreadsheets vs. Databases: Is It Time to Switch? Part 1

Spreadsheets – Excel, Google Sheets, or a sheet by any other name – are really cool and powerful tools. But then, so are databases. When should you stick with a spreadsheet? When should you move up to a database?You can use spreadsheets and databases for similar purposes. Given that both organize data and facilitate reporting, at times it can be hard to determine which is the best one to use. So let’s talk about the pros and cons of each option.

Earn Money with Unused Stuff: A Sharing Economy Data Model

There isn’t much chance you’ve missed the whole idea of the sharing economy – whether you like it or not. Popularized by companies like Airbnb, Uber, Lyft, and many others, it lets people earn some cash by renting out their unused stuff. Let’s see the data model behind such an application.Got a spare room? Sign up with Airbnb and make some extra money renting it out. Got a car and some free time? Become an Uber driver. And so it goes – the idea behind these companies and many more like them is almost the same. It’s all about sharing a resource with (mostly) strangers, with a perk for both parties. The owner gets money for their unused property, while the customer usually gets a good deal; this should be a win-win situation.

A Grocery Delivery Data Model

If there’s a way to order groceries online, why not use it? This article examines the data model behind a grocery store’s delivery system.We still get a special feeling from picking something from the garden and then preparing it right away – but it’s not something we can do often. Today’s fast pace doesn’t allow it. In fact, sometimes it doesn’t even allow us to go to the store to “pick” our groceries. So it makes sense to save ourselves some time and use an app to order what we need. Our order will just show up at our home. Maybe we won’t get that special fresh-picked feeling, but there will be food on our table.

A Data Model for Map- and Turn-Based Games

Turn-based games and their map-based counterparts have been popular for a long time. Suppose we were to take such games into the 21st century by making them digital. What data model is up to the job?If you think about it, many popular games have been map-based, turn-based, or both. On the one hand, we have simple low-tech board games likeDon’t Get AngryandMonopoly; the other end of the spectrum includes the computer-based

Tap and Park: A Parking App Data Model

Various apps promise to make your search for parking painless. Let’s examine this type of app using our data modeling glasses. What does the underlying model look like?In an earlier article , we explained how a parking lot is structured and how a data model can be designed to manage one. In this article, we are examining the data model for a parking app. You know these apps: they list nearby parking options, tell you the prices, and let you book or reserve a space or buy a parking pass.

A Children’s Party Data Model

Organizing children’s parties is not an easy job: everything has to be perfectly planned and delivered. Otherwise, chaos happens. It’s up to the adults – more specifically, the party planners – to take care of everything and do it properly.Is there a better way to do this than to organize everything in a database? We don’t think so!Children’s parties vary a lot. Some are simple, like birthday parties that include just invitations, food (snacks, beverages, and a cake) and maybe a clown or a magician to entertain the kids. Other parties are much more complex. They may require a trip out of town, sleeping accommodations, and many other activities. The more complicated the party, the less room for mistakes. While a clown that’s 10 minutes late isn’t a big deal, no one wants to wait with a group of bored kids for a bus that’s two hours late!

A Restaurant Delivery Data Model

Hungry but you don’t want to cook? Call up a restaurant, order your favorite meal, and read about a data model that can organize the whole process.Despite an abundance of “time-saving” technology, we seem to have less time to fulfill basic needs – such as eating. If we want to eat something but we don’t have the time (or the skills) to cook it ourselves, we can order food from a restaurant (i.e. a takeaway or takeout), which will bring our meals right to our doors. Of course, we have to pay for this convenience, so we expect the food to be good and hot!

A Dating App Data Model

It’s Valentine’s Day and you’re single. Again. Not cool. Not cool at all. We’ll do something about that with today’s dating app data model. Ok, reading this article won’t automatically get you a date. Or maybe it will. Let’s see.How many dating apps can you name? I can think of at least a dozen. As data modelers, though, we’re more interested in the data model underneath the app than the app itself. So let’s examine what it takes to run a data app, starting with what we need it to do.

A Data Model for a Weather App

Lots of people use mobile weather apps to plan their day – or at least decide if they need to carry an umbrella! What sort of data model lies underneath these popular programs?We all want to know how nasty the weather is before we step outside. Windows, iOS, and Android apps give us accurate and reliable information about current weather conditions. This article explains a detailed data model that could be used for such apps.

A Data Model for Trading Stocks, Funds, and Cryptocurrencies

Trading cryptocurrencies, buying stocks, and the like is extremely popular these days – it’s perceived as easy profit. Prices are currently rising, but we can’t know when that will change. On the other hand, we know it will at some point. But we’re not here to make financial predictions. Instead, we’ll talk about a data model that can be used to support the trade of cryptocurrencies and financial instruments like stocks or fund shares.

Star Trek 3D Chess Data Model

If you’re a Star Trek fan, you likely know that Captain Kirk and Mr. Spock frequently play a variant of chess called Tri-Dimensional Chess, or 3D chess, a game that’s similar to standard chess but with notable differences. In this article, we’ll build a data model for a 3D chess application that allows players to compete against each other. Beam us up, Scotty!The Concept of 3D ChessWhile chess itself is already a complex game, combining boards and multiple sets of pieces can significantly increase the game’s complexity.

Delivering Christmas Presents: Santa’s Data Model

With the holidays quickly approaching, Santa needs some additional help to deliver presents to children around the world. Today, we’ll develop a data model that can help Santa and his elves work more efficiently.BackgroundSanta’s job is extremely important, so he needs to do everything he can to ensure on-time success. Just remember all the problems Howard encountered in ‘Jingle All the Way’ when trying to find a single Turbo Man figure—we can’t let Santa slip up again, or his reputation will be ruined. So, to help Santa stay organized, we’ll divide his activities into three main phases.

Constructing a Data Model for a Parking Lot Management System

Research shows that cars remain parked for 95% of their lifetime, suggesting that parking lot management systems should be smart, efficient, and robust. In this article, we’ll construct a data model for such a system.IntroductionBefore we begin constructing our data model, we should first understand how parking lots are structured and how they operate. Let’s take a brief look at these two key areas.How are parking lots structured?A typical parking lot consists of one or more blocks that are further subdivided into floors. Each floor contains multiple wings that help drivers orient themselves and remember their parking spots. These are usually labeled with letters, such as “A”, “B”, “C”, and so on. A floor usually has a height limit that restricts certain vehicles from entering the parking lot. Additionally, a floor contains several uniquely numbered parking slots. Some of these slots are reserved for handicapped people; others can be reserved by regular visitors at a certain cost.

Wedding Organization Data Model

Weddings are often accompanied by merriment and celebration, with numerous guests, food, drinks, music, and dancing. But all of this can’t happen without the proper preparation and coordination. Let’s take a closer look at how data modeling can help us better organize a wedding so everything runs smoothly.Preliminary BackgroundThough we’re mostly all aware of what a typical wedding ceremonies looks like, it can’t hurt to briefly consider some aspects that could potentially impact our data model.

Life Insurance Data Model

Life insurance is something we all hope we won’t need, but as we know, life is unpredictable. In this article, we’ll focus on formulating a data model that a life insurance company may use to store its information.Life Insurance as a ConceptBefore we start discussing the actual data model for a life insurance company, we’ll briefly remind ourselves of what insurance is and how it works so we have a better idea of what we’re working with.

Modeling an Open Marketplace for Education

Keeping up with the latest changes in technology is necessary if you want to get ahead in today’s competitive job market. In this article, we’ll build a data model for online portals that offer a more engaging platform for learning new skills, using Native Monks as our guide.IntroductionIn one of our recent articles , we built a working data model for an e-learning portal, and we explained how courses can be split into recorded/transcript lessons and made available to students. However, there are some who’d prefer to learn directly from teachers in more engaging, personal sessions. Unlike platforms such as Udemy and Coursera, Native Monks allows students to hire teachers (either locally or online) and to learn skills directly from them in one-on-one classes that are administered either online or in person.

Hire or Get Hired: A Data Model for the Recruitment Process

No matter which side of the equation you’re on, sometimes it’s tough to find a qualified person for a specific job. In this post, we look at a data model to help recruiters and HR departments stay organized during the hiring process.Most of us have been involved in the hiring process – most often as the job applicant. However, we can also find ourselves involved on the hiring side, maybe by testing the applicant’s technical knowledge. The recruiting process takes a certain amount of time, and the group of applicants grows continuously smaller as we get closer to the final decision. The result should be the selection of the best person for the job.

A Data Model for a Medical Appointment Booking App

Booking a doctor’s appointment using an online app is an innovation that simplifies the entire process. Let’s dive into the data model behind an appointment booking app.Why use an app? It makes it easier for people to find the doctors of their choice, letting them see the doctor’s professional records and patient reviews. When someone finds a doctor they like, they can book an appointment with them without leaving the app. An app can also help doctors keep their patients’ waiting times as short as possible, help them schedule their patients, and enable them to keep an eye on patients’ online reviews.

An Event Management Data Model

Organizing an event is a lot of work! In this article, we examine the data model behind an event organization app.If you’ve ever tried to organize an event for more than ten people (and don’t count parties or business meetings here) you know how complicated event management can be! Have we invited everyone? Have they confirmed if they are coming? Is the venue booked and prepared? Who will host the event? Who will participate in the various parts? There are many other questions to answer, and things could easily go wrong.

A Real Estate Agency Data Model

Other than location, what’s it take to run a successful real estate business? We examine a data model to help real estate agencies stay organized.Buying, selling, and renting apartments or houses is really big business today. Most people are happy to pay a fee and let a professional real estate agency do the work for them. On the other hand, the company could act in its own behalf, buying properties to resell or rent. A real estate company may also lease a property then rent or sublease it and make a profit on the difference.

A Data Model to Keep Track of Your Most Precious Possession

Being healthy and fit is a lifestyle, not a fad. People who realize the value of health make it a priority, keeping records of all their fitness-related facts. In this article, we’ll examine the design of the database behind a health and fitness application.There are many applications which let users log their health and fitness information. A couple of big players like Apple, Google, and Microsoft have launched their own development APIs specifically for this market. For example, Google has ‘

Improving Our Online Job Portal Data Model

In this era of tough competition, job portals are not just platforms for publishing and finding jobs. They are leveraging advanced services and features to keep their customers engaged. Let’s dive into some advanced features and build a data model that can handle them.I explained the basic features needed for a job portal website in a previous article . The model is shown below. We’ll consider this model as a base, which we will change to meet the new requirements. First, let’s consider what these requirements (or enhancements) should be.

Designing a Database for an Online Job Portal

Across the globe, the job portal site is a well-known feature of the Internet landscape. Big players like Indeed and Monster have turned job hunting and recruiting into a veritable online industry. Let’s dive into the elementary features leveraged by job portals and build a data model that can support them.People love saving time by using technological innovations; the online job portal is another version of working smarter, not harder. Job seekers and companies alike realize the value in taking their search online: they get a better reach at higher speeds and lower costs.

A Database Model for a MOOC Platform

If you ran a MOOC online learning platform like edX or Coursera, how would you keep it organized? In this article, we’ll look at a database model that would do the job.You’ve probably heard of MOOC (Massive Open Online Course), a trending way to learn online. And if you haven’t, think of a MOOC program as university subjects with all materials, tests, and feedback available online. Two of the most popular online MOOC providers are

A Database Model for a Taxi Service

Call them taxis or cabs, these convenient rides for rent have been around for centuries. Nowadays, it’s a lot more complicated to run a taxi service. In this article, we’ll look at a database model designed to meet the needs of a cab company.The history of “calling a cab” began in 17thcentury London. In most places, cabs are more affordable than ever. They are also becoming a lot more accessible: we can order a taxi by phone, via mobile applications, or on the Web. Or we can use the same techniques that have been working for hundreds of years – line up at a cab station or flag one down on the street.

Database Models for E-Commerce Part 1: The Newsletter

In general, people do not like receiving unsolicited e-mails. Nevertheless, they sometimes subscribe to newsletters in order to get a discount or to keep up-to-date with new products. This article will present one approach to designing a newsletter database.Why Worry About Newsletter Emails?Newsletter subscribers represent an extremely valuable group of clients – they are interested in our products, they trust us, and they spend time reviewing our offers and promotions. What is more, sending emails to clients is one of the cheapest tools in online marketing. However, it needs to be done carefully – data must be updated daily (because people subscribe and unsubscribe) and be high-quality (we do not want to send unwanted emails, as it negatively impacts brand image).

Again and Again! Managing Recurring Events In a Data Model

A recurring event, by definition, is an event that recurs at an interval; it’s also called a periodic event. There are many applications which allow their users to setup recurring events. How does a database system manage recurring events? In this article, we’ll explore one way that they are handled.Recurrence is not easy for applications to deal with. It can become a hurricane task, especially when it comes to covering every possible recurring scenario – including creating bi-weekly or quarterly events or allowing the rescheduling of all future event instances.

A Data Model for Listing Apartments and Other Rental Units

Everyone planning to move to a new location looks for good accommodations. In the Internet era, the very first place they tend to look at sites dedicated to listing rental properties. According to a poll by one well-known agency, 76% of people looking to rent turn to the internet first; this figure rises to 88% for those aged 25–34.Let’s dive into a full-fledged data model that supports such sites and their underlying features. Our model also enables site users to conveniently filter search results.

Serving Delicious Food (and Data) – A Data Model for Restaurants

What part does database design play in running a restaurant? What might the data model for a restaurant database look like? Find out in this article.A restaurant serves people with ready-made food. This is a type of business that is thriving all over the world, and often with a lot of flare. People feel very comfortable going to restaurants, and they are starting to expect a wide range of options when it comes to their next meal.

Does Evolving Contact Information Mean Changing Your Database?

There are a number of ways to contact someone these days, right?We have various phones: mobile and landline, personal and work. We have different addresses – residential, mailing, billing, business, etc. – and likely several email addresses, too. Don’t forget Skype and various messaging apps. Now add in LinkedIn and Facebook –which by the way, both have their own messaging elements.Not that long ago, many of these didn’t exist. So you can pretty much guarantee that in a few years, we’re going to have some new way of contacting people and organizations.

What Do the Olympic Games, UEFA Euro 2016 Football Matches, and Databases Have In Common?

On hearing what I do, people tend to ask me the same question:Can you develop a system that predicts football match results? Or Olympic medal outcomes?Personally, I don’t put much faith in predictions. Still, if we had a large amount of historical data and relevant indicators, we could certainly design a system to help us come up with more accurate assumptions. In this article, we’ll consider a model that can store the results of matches and tournaments.

Dimensions of Dimensions: A Look at Data Warehousing’s Most Common Dimensional Table Types

When we start a data warehousing project, the first thing we do is define the dimensional tables. Dimensional tables are the interesting bits, the framework around which we build our measurements. They come in many shapes and sizes. In this article, we are going to take a closer look at each type of dimensional table.Dimensional tables provide context to the business processes we wish to measure. They tell us all we need to know about an event. Since they give substance to the measurements (i.e. fact tables) of the data warehouse (DWH) system, we spend more time on their definition and identification than on any other aspect of the project. Fact tables

Party Relationship Pattern. How to Model Relationships

Relationships are everywhere: between people, between organizations, between organizations and people. Think about being an employee of a company, being a member of a project team, or being a subsidiary of another company. Is there a straightforward way to accurately model and manage all these relationships? Can we easily answer the question ‘Who knows who?’A Quick Review of RelationshipsExactly how this basic model was derived was described in my previous article,

Flexible and Manageable Bill of Materials (BOM) Designs

The bill of materials design pattern is deceptively simple, yet incredibly powerful. This article will introduce an example, familiar to IT professionals, that you may not have thought fits the BOM pattern. It will also introduce concepts to show you how to make your BOM structures more flexible and much easier to manage.A Short Recap of the BOMAbill of materialshas its roots in manufacturing. It is a list of the raw materials, sub-assemblies, intermediate assemblies, sub-components, parts, and the quantities of each needed to manufacture an end product.

MMO Games and Database Design

Let’s be honest: we all love to play games, especially on our computers. Until the Internet became widespread, most of us played computer games by ourselves, usually against AI opponents. It was fun, but as soon as you realized how the gameplay mechanics worked, the game lost most of its magic.The development of the Internet moved games online. Now, we can play against human opponents and test our skills against theirs. No more rote gameplay!

Identifying the Bill of Materials (BOM) Structure in Databases

The bill of materials (BOM) design pattern is deceptively simple, yet incredibly powerful. Historically, it’s been employed to model product structures, but the pattern can be used to do much more than simply define a hierarchy. This article will introduce three very different examples to help you to recognize the pattern in your own projects.What Is a Bill of Materials, or BOM?Abill of materialshas its roots in manufacturing. It is a list of the raw materials, sub-assemblies, intermediate assemblies, sub-components, parts, and the quantities of each needed to manufacture an end product. You can look at it as a hierarchical decomposition of a product. Other terms for the same thing are product structure, bill of material, and associated list.

Beverly Hills 90210 and ZIP+4: Handling Addresses in Data Models

In my last post, I wrote about ensuring that your data model properly handles global information : numbers, currencies, phone numbers, addresses, dates, and time zones, among other things. However, I’ve realized that many example data models have exactly the “self-centric” or “Amero-centric” approach that I cautioned against.As an American living abroad (for almost 30 years now), I often find that people make too many assumptions about the universality of what they know. For example, some Americans assume that others automatically understand their country’s ZIP code system, and its supplementary ZIP+4 version. In my experience, most of the world has no idea what a ZIP+4 is.

Looking for a Simple Full-Text Search?<br /> Try MySQL InnoDB + CakePHP with Word Stemming

Implementing a user-friendly search can be tricky, but it can also be done very efficiently. How do I know this? Not long ago, I needed to implement a search engine on a mobile app. The app was built on the Ionic framework and would connect to a CakePHP 2 backend. The idea was to display results as the user was typing. There were several options for this, but not all of them met my project’s requirements.

7 Key Things to Remember About Data Model Globalization

Very few database authors mention the challenges of globalization and localization in any meaningful way. There’s a similar lack of foresight from database architects. The fact is that many authors and designers are frequently very ‘self-centric’: they create (or write about) data models that only properly handle their local time zones, addresses, etc.A self-centric approach has a big problem: the resulting model will only support local data. In today’s Internet-fueled world, applications are often unexpectedly accessed by users around the globe. We need to support as much flexibility as possible for this international audience. Therefore, we need to design our data models with a globalized approach.

What Do Poker, Blackjack, Belot and Préférence Have to Do with Databases?

How to design a database flexible enough to accommodate several very different card games.Recently, we showed how a database could be used to store board game results . Board games are fun, but they’re not the only online version of classic games going. Card games are also very popular. They introduce an element of luck into gameplay, and there is much more than luck involved in a good card game!In this article, we’ll focus on building a data model to store game matches, results, players and scores. The main challenge here is storing data related to many different card games. We could also consider analyzing this data to determine winning strategies, improve our own playing skills, or build a better AI opponent.

Star Schema vs. Snowflake Schema

In the previous two articles, we considered the two most common data warehouse models: the star schema and the snowflake schema. Today, we’ll examine the differences between these two schemas and we’ll explain when it’s better to use one or the other.The star schema and the snowflake schema are ways to organize data marts or entire data warehouses using relational databases. Both of them usedimension tablesto describe data aggregated in a

How to Design a Localization-Ready System

In this era of globalization, companies – including software developers – are always interested in expanding to new markets. This often means localizing their products for different areas. In this article, we’ll explain a few approaches to designing your data model for localization – specifically, for managing content in multiple languages.What Is Localization?Localization is the process of adapting a product to various markets. It is a prominent factor in achieving maximum market share in terms of product sales. When localization is done correctly, users will feel that the product was produced for their language, culture, and needs.

The Snowflake Schema

In a previous article we discussed the star schema model. The snowflake schema is next to the star schema in terms of its importance in data warehouse modeling. It was developed out of the star schema, and it offers some advantages over its predecessor. But these advantages come at a cost. In this article, we’ll discuss when and how to use the snowflake schema.The Snowflake SchemaThe snowflake schema’s name comes from the fact that dimension tables branch out and look something like a snowflake. When we look at the model above, we’ll notice it’s a fact table surrounded by a few dimension tables, some of which do the aforementioned branching. Unlike the star schema, dimension tables in the snowflake schema can have their own categories.

Security Approaches in Data Modeling. Part 4

This is the fourth in our multi–part series on data modeling for information security as well as data characteristics. A simple data model for a fictional website that supports shared–interest organizations (bird–watching clubs, etc.) has provided us with content for exploring data modeling from a security viewpoint.In Oscar Wilde’s playLady Windermere’s Fan, Lord Darlington tags a cynic as “somebody who knows the price of everything, and the value of nothing.” Sadly, the information in our databases can be unconsciously treated in the same way. Is a customer account worth the sum of its purchases? What do we suffer if we lose four hours of marketing data during holiday shopping season?

The Star Schema

Today, reports and analytics are almost as important as core business. Reports can be built out of your live data; often this approach will do the trick for small- and medium-sized companies without lots of data. But when things get bigger – or the amount of data starts increasing dramatically – it’s time to think about separating your operational and reporting systems.Before we tackle basic data modeling, we need some background on the systems involved. We can roughly divide systems in two categories: operational and reporting systems. Operational systems are often called Online Transaction Processing (OLTP). Reporting and analytical systems are referred to as Online Analytical Processing (OLAP). OLTP systems support business processes. They work with “live” operational data, are highly normalized, and react very quickly to user actions. On the other hand, the primary purpose of the OLAP systems is analytics. These systems use summarized data, which is usually placed in a denormalized data warehousing structure like the star schema. (What is denormalization? Simply put, it’s having redundant data records for the sake of better performance.

Database Design

I’ve been practicing agile database techniques for about twenty years now. My use of these techniques didn’t start as a set plan; rather, it evolved over time as I consulted on various projects. It made sense to look for ways of working faster and with greater customer interaction.I can think of at least three kinds of agile database techniques:Data modelingData warehouse developmentDatabase reverse engineeringAgile Data ModelingMany think of data modeling as a laborious task. But that need not be the case. You can take data modeling out of the back room and do it in front of a customer. You might think that customers would be put off by the technical gore, but they aren’t. Business staff have a passion for their work and a vision of where they want to go. They are thrilled to have IT as a facilitator rather than a roadblock.

Part 3 – Customers, Calls, and Meetings

Previously in this series, we imported SuiteCRM’s database model into Vertabelo and showed how to use Vertabelo’s features to organize it . In this article, we’ll see how common CRM data is stored in its database. We’ll also check the assumptions made in Part 2 about the relations between tables and their functions. If needed, we’ll make modifications to the model.What Do We Currently Have?In Part 1, we installed SuiteCRM locally using the Bitnami installation pack. After successfully logging in, the main SuiteCRM screen looks like the one below:

Using Configuration Tables to Define the Actual Workflow

The first part of this series introduced some basic steps for managing the lifecycle of any entity in a database. Our second and final part will show you how to define the actual workflow using additional configuration tables. This is where the user is presented with allowable options each step of the way. We’ll also demonstrate a technique for working around the strict reuse of ‘assemblies’ and ‘sub-assemblies’ in a Bill of Materials structure.

Crow’s Foot Notation

The most recognizable characteristic of crow’s foot notation (also known as IE notation) is that it uses graphical symbols to indicate the ‘many’ side of the relationship. The three-pronged ‘many’ symbol is also how this widely-used notation style got its name. Let’s see where crow’s foot is placed in the history of data modeling and take a look at its symbols.History: How Crow’s Foot Notation Got StartedThe beginning of crow’s foot notation dates back to an article by

Denormalization: When, Why, and How

Databases are designed in different ways. Most of the time we can use “school examples”: normalize the database and everything will work just fine. But there are situations that will require another approach. We can remove references to gain more flexibility. But what if we have to improve performance when everything was done by the book? In that case, denormalization is a technique that we should consider. In this article, we’ll discuss the benefits and disadvantages of denormalization and what situations may warrant it.

Using Workflow Patterns to Manage the State of Any Entity

Have you ever come across a situation where you need to manage the state of an entity that changes over time? There are many examples out there. Let’s start with an easy one: merging customer records.Suppose we are merging lists of customers from two different sources. We could have any of the following states arise:Duplicates Identified– the system has found two potentially duplicate entities;Confirmed Duplicates– a user validates the two entities are indeed duplicates; or

Security Approaches in Data Modeling. Part 3

This is the third of our multi-part series on applying information security approaches to data modeling. The series uses a simple data model, something to manage social clubs and interest groups, to provide the content we look to secure. Later we will address modeling for authorization and user management, as well as other parts of a secure database implementation.In social situations, it’s common to “read between the lines” – deducing the unspoken assumptions and assertions in a conversation. The same occurs in creating software and storing data in a database. Invoices are enumerated with the customer ID embedded, and how many data entities use a date-time as part of the key? It’s hard to imagine thoroughly documenting or structuring everything without some type of omission. But in our last instalment, we went through exactly that exercise. We were able to ascribe sensitivity to several parts of our social club database. But to quantify and manage that sensitivity, we must augment the structure of our data model in order to make the sensitive data and its relationships clear.

Part 2 – How to Organize a Large Database Diagram

In Part 1 of this series, we successfully imported the SuiteCRM database structure into our online database modeling tool. That’s when we saw that the model contains 201 tables without relationships between them. We got a wild bunch of tables that looked really messy. In this article, I will show you how you can organize such a large model.Just after importing to Vertabelo , the SuiteCRM database model looks as follows:

13 Blog Articles on Database Design Best Practices and Tips

There’s a lot to keep in mind when you’re designing a database, and very few of us can remember every valuable tip and trick we’ve learned. So, let’s take a look at some online resources that feature database design tips and best practices. As we go, I’ll share my own opinions on the ideas presented, based on my experience in database design.Obviously, this article is not an exhaustive list, but I’ve tried to review and comment on a cross section of sources. Hopefully, you’ll find the information that best suits your needs and goals.

Part 1 – How to Install SuiteCRM and Reverse Engineer Its Database

Customer Relationship Management applications (CRMs) have been around for some time. We could argue a lot about their advantages and disadvantages when comparing them to each other. In this series, we’ll take a look at the database behind one popular open-source CRM: SuiteCRM. We will also show how to install everything we need. In upcoming articles, we’ll organize the data model and see how it reacts to changes made on the user interface.

Viewing Holidays With Data Modeler’s Eyes

Celebration!! Family time!! Long drive!! A day at the beach!! All these words buzz into our minds when we think of holidays. Have you ever considered how a multinational company keeps track of holidays across the globe? There must be a data dictionary to maintain all these details so that they can ensure seamless business with their local partners.This article will explain such a data model.The Project Requirements in a Nutshell

“Is It Secret? Is It Safe?” Handling Sensitive Data in Your Data Modeling

Early in the movie “The Fellowship of the Ring”, the wizard Gandalf asks the hero Frodo this question:“Is it secret? Is it safe?”We may not have a magic ring to protect, but we’re asking the same question. But we’re talking about information.This is the second in a multi-part series on how to apply information security principles and techniques as part of data modeling. This series uses a simple data model designed to manage non-commercial clubs as an example of security approaches. In later articles, we will address modeling for fine-grained access controls, auditing, authentication, and other key aspects of secure database implementation.

The Reference Data Pattern: Extensible and Flexible

Having reference tables in your database is no big deal, right? You just need to tie a code or ID with a description for each reference type. But what if you literally have dozens and dozens of reference tables? Is there an alternative to the one-table-per-type approach? Read on to discover ageneric and extensibledatabase design for handling all your reference data.This unusual-looking diagram is a bird’s-eye view of a logical data model (LDM) containing all the reference types for an enterprise system. It’s from an educational institution, but it could apply to the data model of any kind of organization. The bigger the model, the more reference types you’re likely to uncover.

19 Online Resources for Learning About Database Design Errors

We all make mistakes, and we can all learn from other people’s mistakes. In this post, we’ll take a look at numerous online resources for avoiding poor database design that can lead to many problems and cost both time and money. And in an upcoming article, we’ll tell you where to find tips and best practices.Database Design Errors and Mistakes to AvoidThere are numerous online resources to help database designers avoid common errors and mistakes. Obviously, this article is not an exhaustive list of every article out there. Instead, we’ve reviewed and commented on a variety of different sources so that you can find the one that best suits you.

WordPress – Behind the Scenes, Part 2

In Part 1 of this series, I demonstrated how to install WordPress locally and how to import a WordPress database into Vertabelo . In this article, we’ll take a closer look at the tables in the WordPress database.A Quick Look at the WordPress Database Model and the DashboardIn the previous part , I imported the WordPress database into our online database modeling tool. For the record, the structure of the database is as follows:

WordPress – Behind the Scenes, Part 1

How often have you wondered about the structure of an existing database? It could be a 5-year-old legacy system or a brand-new open-source project. Let’s take a look at the ERD diagram of the database behind the most famous content management system: WordPress.What Is WordPress and How Does It Work?WordPress is an open-source CMS (content management system) that was initially released in 2003. It started out as a blogging platform, but it has developed so much that today it can be used for almost anything.

Logging in With External Services

Inputting a username and password is one way of accessing an account, but it’s not the only one. In this article, we’ll see how to enable external services (like Google or Facebook) when logging in to a database.What Are External Service Logins?Giving a user the option to access their system accounts through external services is a growing trend among web designers. This option can provide several benefits, such as giving users one less name-and-password combination to remember. It can also help administrators personalize user experiences.

Creating a Data Model for Carpooling

Nowadays, carpooling is accepted and promoted by people around the globe. It certainly reduces one’s personal carbon footprint, and it can be more cost-effective than renting or buying a car.Carpooling also takes a lot of work – organizational work that can readily be done by a well-designed database. This article explains a detailed data model that a carpooling website could use.Data Design, Meet CarpoolingSo, we need to design a data model for a ride-share (aka carpooling) website.

Problem Set 2 – Identifying Entities and Attributes

In an earlier article on data modeling we promised to give you a set of exercises to practice finding entities and attributes. Here is the second installment of our problem set. Enjoy.Problem 1: CountriesDescription:Find the right entities and their attributes to represent all the countries in the world, their interior regions (which can be called states, provinces, or regions) and their cities. We want to represent each country’s name, continent, date of independence, type of government and population. For each region (or province, state, etc.) we wish to store the capital city, the name of the governor, and the population. Finally, for each city we want to have the name, founding date, population, and the number of schools per inhabitant. We would also like to represent what every country calls its interior regions.

Renting out Cars Is as Simple as Driving: A Data Model for a Car Rental Company

You might have rented a car on your last vacation. You reserved your car online, and then picked it up from its designated location after paying all the previously-agreed charges. Once you were done, you returned it to the agency and perhaps paid some additional fees. Did you ever think about the system that makes all these things happen? In this article, we’ll look at a data model for a car rental system.

Problem Set 1 – Identifying Entities

In an earlier article on data modeling we promised to give you a set of exercises to practice finding entities. Well, here they are. Have fun!Problem 1: Language SchoolMr. Trotter, the proprietor of a rapidly-growing language school, wants to introduce a new system in his company. He can no longer keep track of all the information on his own, so he’s asked for our help. He is a bit chaotic, though. This is what he said:

Using Different MySQL Storage Engines in Database Design

Any database architect designing a MySQL database faces the issue of selecting the proper storage engine. Usually, an application uses only one engine:MyISAMorInnoDB. But let’s try to be a little more flexible and imagine how different storage engines can be used.The Initial Data ModelTo begin, let’s build a simplified data model for a CRM (customer relationship management) system that we’ll use to illustrate the point. The design will cover the main CRM functions: sales data, product definitions, and information for analytics. It won’t contain details typically used in CRM systems.

Database Modeling

I wrote a song about dental floss but did anyone’s teeth get cleaner?Frank ZappaWhen we think of the dental office, our first associations are the drill, the pain, and the fear. OK, that sounds bad. Besides taking care of teeth, a dentist has many other obligations that are professional, legal, or both. All of them require proper data management.To meet this documentation requirement, many dental and medical offices use paper records. Slowly but surely, though, there’s a trend towards the digital records and management of the 21st century.

An Unemotional Logical Look at SQL Server Naming Conventions

In the database world, there are some things that are universally agreed upon. Increased RAM is largely beneficial to DMBS systems. Spreading out data and log files on RAID improves performance.Naming conventions are not one of those things.This is a surprisingly polarizing topic, with the proponents of various methodologies firmly entrenched in their positions. And very vocal and passionate in their defense of the same.This article will delve into some of the specific conventions and the arguments on both sides, while attempting to present a reasonable conclusion for each point.

How Does Database Design Help Organize Teachers, Lessons, and Students?

An investment in knowledge pays the best interest.Benjamin FranklinIn the modern world, education is omnipresent. Now more than ever before, it plays an important role in our society. It’s so important, in fact, that many of us continue our education well after finishing school or college.We have all heard of lifelong learning, non-formal education, and workshops for all ages. These methods differ from formal education in many ways, but they also have things in common. There are classes, lessons, teachers, and students. And just as in a traditional setting, we’ll want to keep track of the class schedule, attendance data, and instructor or student achievement. How can we design a database to meet these needs? That’s what we’ll cover in this article.

50 Shades of NULL – The Different Meanings of NULL in SQL

Tony Hoare , who is mostly referred to as the inventor of the NULL reference, now calls it a billion-dollar mistake which pretty much all languages are now “suffering” from, including SQL.Quoting Tony (from his Wikipedia article):I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.

Tips for Better Database Design

Over the years, working as a data modeler and database architect, I have noticed that there are a couple rules that should be followed during data modeling and development. Here I describe some tips in the hope that they might help you. I have listed the tips in the order that they occur during the project lifecycle rather than listing them by importance or by how common they are.1. Plan Ahead

Managing Roles and Statuses in a System

There are many ways to solve a problem, and that’s the case with administering roles and user statuses in software systems. In this article you’ll find a simple evolution of that idea as well some useful tips and code samples.Basic IdeaIn most systems, there is usually a need to haverolesand userstatuses.Roles are related torightsthat users have while using a system after successfully logging in. Examples of roles are “call center employee”, “call center manager”, “back office employee”, “back office manager”, or “manager”. Generally that means that a user will have access to some functionality if he or she has the appropriate role. It’s wise to assume that a user can have multiple roles at the same time.

How to Keep Track of What the Users Do

In several of the projects we have worked on, customers have asked us to log more user actions in the database. They want to know all of the actions the users perform in the application, but capturing and recording all human interactions can be challenging. We had to log all modifications of data performed via the system. This article describes some of the pitfalls we encountered and the approaches that we used to overcome them.

A Database Model for an Online Survey. Part 1

I need to create the design for a new database which will be thedata layerfor an application; the application will be an onlinesurveyor polling like Survey Monkey. My challenge is that the functionality that I require is not supported by existing survey sites, so I need to build my own. What I need is a conditional survey (if the answer to question 4 is “yes,” then we ask question 5 and skip question 6; but if the answer to question 4 is “no,” then we skip question 5 and ask question 6).

Modeling a Basic Data Structure to Manage Users, Threads, and Posts

An online discussion forum is a site wherepeoplecan holdconversationsin the form of postedmessages. Discussion forums allow conversations to take place when people are not on-line, and messages may be temporarily archived. Also, depending on the forum set-up, a message might need to be approved by a moderator before it becomes visible to other users. Forums have a specific set of terms, for example, a single conversation is generally referred to as a “thread”. Threads can be replied to by as many people as would like to. Most forums require users to register and subsequently log in to post messages. However, on most forums, users do not have to log in to read existing messages.

How to Store Employees’ Schedules in a Database

Level:BeginnerSo many organizations face the common problem of storing employee schedules. No matter what institution: a company, a university or simply an individual, many entities need an application to view schedules. Therefore, I will try to come up with a database model and then, in a future article, we’ll talk about a simple application to store employees’ schedules in a database.Currently the design looks as follows:The model is pretty straightforward.Tip – Natural and Surrogate Key Strategies

How Do You Make Your Database Speak Many Languages?

The ScenarioYou are the owner of an online store, located in Poland. The majority of your customers are from Poland and they speak Polish. But you want to sell your products abroad too and your international customers mainly speak English. So you want your online store to be available in bothPolishandEnglish. You also expect that your products will sell well in France, so you anticipate that you’ll have to prepare a

UML Notation

UMLis popular for its notations. We all know thatUMLis for visualizing, specifying, and documenting the components of software and non software systems. What’s more, UML has many types of diagrams which are divided into two categories. Some types represent structural information, others general types of behaviors. Among these, there is one that is commonly used for entity relationship diagrams.In UML, anentityis represented by a rectangle:Relationshipsare solid lines with cardinality specified at the ends of the lines:

Arrow Notation

Arrow notationhas become one of the less recognized notations in entity relationships diagrams in recent years. Let’s discuss its elements.Entity and relationshipsAs you can see below, an entity is always represented by a rectangle, which is common to most notations (there isn’t a distinction if it is dependent or independent entity). Relationships and cardinality are represented by various combinations of arrows as the diagram below presents.There isn’t one way to represent attributes. Usually they are depicted the same way like in the IDEF1X notation or UML.

IDEF1X Notation

IDEF1X(Integration DEFinition for Information Modeling) is a method for designing relational databases with a syntax that supports constructs in developing conceptual schema.Not everyone knows that this notation has an interesting history. Indeed, the need for semantic data models was first recognized by the U.S. Air Force in the mid-1970s. As a result, the ICAM Program came into being (It identified a need for better analysis and communication techniques for people involved in improving manufacturing productivity), that later developed a series of techniques known as the IDEF; IDEF1X being one of them.

Chen Notation

Continuing our trip through different ERD notations, let’s review the Chen ERD notation.Peter Chen, who developed entity-relationship modeling and published his work in 1976, was one of the pioneers of using the entity relationship concepts in software and information system modeling and design. The Chen ERD notation is still used and is considered to present a more detailed way of representing entities and relationships.EntitiesAn entity is represented by a rectangle which contains the entity’s name.

Barker’s Notation

When looking at different kinds of ERD notations, it is hard not to come across Barker’s ERD notation, which is commonly used to describe data for Oracle. Richard Barker and his coworkers developed this ERD notation while working at the British consulting firm CACI around 1981, and when Barker joined Oracle, his notation was adopted.Let’s take a closer look at Barker’s syntax.The most important components in the ERD diagram are:entities, which can be thought as physical objects or elements that can be uniquely identified, and

ERD Notations in Data Modeling

An entity relationship diagram (ERD) is a diagram that defines the structure of database instances. Choosing which notation to use is typically left up to personal preference or conventions. Here, you can find some useful information about each notation: Part 1 – Barker’s Notation Part 2 – Chen Notation Part 3 – IDEF1X Notation Part 4 – Arrow Notation Part 5 – UML Notation

How to Create a Database Model From Scratch

So you want to create your first database model but you don’t know how to start? Read on!I assume you already know a little about tables, columns, and relationships. If you don’t, watch our video tutorials before you continue.Start With a System DescriptionYou should always start creating a database model with a description of a system. In a classroom situation, a system description is given to you by a teacher. In real life, preparing a description is a