--- layout: docpage title: "Documentation" is_homepage: false is_sphinx_doc: true doc-parent: "Data Modeling" doc-title: "Logical Data Modeling" doc-header-links: ' ' doc-search-path: "../search.html" extra-footer: ' ' ---
Now that you have defined your queries, you’re ready to begin designing Cassandra tables. First, create a logical model containing a table for each query, capturing entities and relationships from the conceptual model.
To name each table, you’ll identify the primary entity type for which you
are querying and use that to start the entity name. If you are querying
by attributes of other related entities, append those to the table
name, separated with _by_
. For example, hotels_by_poi
.
Next, you identify the primary key for the table, adding partition key columns based on the required query attributes, and clustering columns in order to guarantee uniqueness and support desired sort ordering.
The design of the primary key is extremely important, as it will determine how much data will be stored in each partition and how that data is organized on disk, which in turn will affect how quickly Cassandra processes reads.
Complete each table by adding any additional attributes identified by the query. If any of these additional attributes are the same for every instance of the partition key, mark the column as static.
Now that was a pretty quick description of a fairly involved process, so it will be worthwhile to work through a detailed example. First, let’s introduce a notation that you can use to represent logical models.
Several individuals within the Cassandra community have proposed notations for capturing data models in diagrammatic form. This document uses a notation popularized by Artem Chebotko which provides a simple, informative way to visualize the relationships between queries and tables in your designs. This figure shows the Chebotko notation for a logical data model.
Each table is shown with its title and a list of columns. Primary key columns are identified via symbols such as K for partition key columns and C↑ or C↓ to represent clustering columns. Lines are shown entering tables or between tables to indicate the queries that each table is designed to support.
The figure below shows a Chebotko logical data model for the queries involving hotels, points of interest, rooms, and amenities. One thing you’ll notice immediately is that the Cassandra design doesn’t include dedicated tables for rooms or amenities, as you had in the relational design. This is because the workflow didn’t identify any queries requiring this direct access.
Let’s explore the details of each of these tables.
The first query Q1 is to find hotels near a point of interest, so you’ll
call this table hotels_by_poi
. Searching by a named point of
interest is a clue that the point of interest should be a part
of the primary key. Let’s reference the point of interest by name,
because according to the workflow that is how users will start their
search.
You’ll note that you certainly could have more than one hotel near a given point of interest, so you’ll need another component in the primary key in order to make sure you have a unique partition for each hotel. So you add the hotel key as a clustering column.
An important consideration in designing your table’s primary key is making sure that it defines a unique data element. Otherwise you run the risk of accidentally overwriting data.
Now for the second query (Q2), you’ll need a table to get information
about a specific hotel. One approach would have been to put all of the
attributes of a hotel in the hotels_by_poi
table, but you added
only those attributes that were required by the application workflow.
From the workflow diagram, you know that the hotels_by_poi
table is
used to display a list of hotels with basic information on each hotel,
and the application knows the unique identifiers of the hotels returned.
When the user selects a hotel to view details, you can then use Q2, which
is used to obtain details about the hotel. Because you already have the
hotel_id
from Q1, you use that as a reference to the hotel you’re
looking for. Therefore the second table is just called hotels
.
Another option would have been to store a set of poi_names
in the
hotels table. This is an equally valid approach. You’ll learn through
experience which approach is best for your application.
Q3 is just a reverse of Q1—looking for points of interest near a hotel,
rather than hotels near a point of interest. This time, however, you need
to access the details of each point of interest, as represented by the
pois_by_hotel
table. As previously, you add the point of
interest name as a clustering key to guarantee uniqueness.
At this point, let’s now consider how to support query Q4 to help the
user find available rooms at a selected hotel for the nights they are
interested in staying. Note that this query involves both a start date
and an end date. Because you’re querying over a range instead of a single
date, you know that you’ll need to use the date as a clustering key.
Use the hotel_id
as a primary key to group room data for each hotel
on a single partition, which should help searches be super fast. Let’s
call this the available_rooms_by_hotel_date
table.
To support searching over a range, use clustering columns to store attributes that you need to access in a range query. Remember that the order of the clustering columns is important.
The design of the available_rooms_by_hotel_date
table is an instance
of the wide partition pattern. This
pattern is sometimes called the wide row pattern when discussing
databases that support similar models, but wide partition is a more
accurate description from a Cassandra perspective. The essence of the
pattern is to group multiple related rows in a partition in order to
support fast access to multiple rows within the partition in a single
query.
In order to round out the shopping portion of the data model, add the
amenities_by_room
table to support Q5. This will allow users to
view the amenities of one of the rooms that is available for the desired
stay dates.
Now let’s switch gears to look at the reservation queries. The figure shows a logical data model for reservations. You’ll notice that these tables represent a denormalized design; the same data appears in multiple tables, with differing keys.
In order to satisfy Q6, the reservations_by_guest
table can be used
to look up the reservation by guest name. You could envision query Q7
being used on behalf of a guest on a self-serve website or a call center
agent trying to assist the guest. Because the guest name might not be
unique, you include the guest ID here as a clustering column as well.
Q8 and Q9 in particular help to remind you to create queries that support various stakeholders of the application, not just customers but staff as well, and perhaps even the analytics team, suppliers, and so on.
The hotel staff might wish to see a record of upcoming reservations by date in order to get insight into how the hotel is performing, such as what dates the hotel is sold out or undersold. Q8 supports the retrieval of reservations for a given hotel by date.
 This provides a single
location that used to store guest information. In this case, you specify a
separate unique identifier for guest records, as it is not uncommon
for guests to have the same name. In many organizations, a customer
database such as the guests
table would be part of a separate
customer management application, which is why other guest
access patterns were omitted from the example.
As with other types of software design, there are some well-known patterns and anti-patterns for data modeling in Cassandra. You’ve already used one of the most common patterns in this hotel model—the wide partition pattern.
The time series pattern is an extension of the wide partition pattern. In this pattern, a series of measurements at specific time intervals are stored in a wide partition, where the measurement time is used as part of the partition key. This pattern is frequently used in domains including business analysis, sensor data management, and scientific experiments.
The time series pattern is also useful for data other than measurements. Consider the example of a banking application. You could store each customer’s balance in a row, but that might lead to a lot of read and write contention as various customers check their balance or make transactions. You’d probably be tempted to wrap a transaction around writes just to protect the balance from being updated in error. In contrast, a time series–style design would store each transaction as a timestamped row and leave the work of calculating the current balance to the application.
One design trap that many new users fall into is attempting to use Cassandra as a queue. Each item in the queue is stored with a timestamp in a wide partition. Items are appended to the end of the queue and read from the front, being deleted after they are read. This is a design that seems attractive, especially given its apparent similarity to the time series pattern. The problem with this approach is that the deleted items are now tombstones that Cassandra must scan past in order to read from the front of the queue. Over time, a growing number of tombstones begins to degrade read performance.
The queue anti-pattern serves as a reminder that any design that relies on the deletion of data is potentially a poorly performing design.
Material adapted from Cassandra, The Definitive Guide. Published by O’Reilly Media, Inc. Copyright © 2020 Jeff Carpenter, Eben Hewitt. All rights reserved. Used with permission.


NEWS & UPDATES - ANNUAL DAY CELEBRATION
LIBERTY HIGH SCHOOL
Established in 1993, the NBA accredited Liberty High School is a frontrunner in providing quality education.
Our center of excellence is situated in a serene scenic campus in Bangalore.
Ours is a focused learning environment with a fair share of fun.
Liberty Institutions are known for discipline, which is an 'obligation to excellence' in delivering high quality
education.
At Liberty, 'discipline' is synonymous with 'freedom with a purpose' and the purpose is 'overall development
of all the people involved viz students and staff'.


SIMON BIRCH
*** 1/2 (out of 4) - a great movie
Release Date: September 11, 1998 Starring: Ian Michael Smith, Joseph Mazzello, Ashley Judd, Oliver Platt, David Strathairn, Dana Ivey, Jim Carrey Directed by: Mark Steven Johnson Distributed by: Buena Vista Pictures MPAA Rating: PG (language, emotional thematic elements, an accident scene) URL: http://www.execpc.com/~kinnopio/reviews/1998/simon.htm
In some regards, making a movie is like trying to stretch a rubber band as far as you can without breaking it. Try too hard, and it snaps; but too much reservation means someone else will come along and pull it farther. In SIMON BIRCH, Director Mark Steven Johnson shows us just how to master the technique: he takes advantage of caution and poise, but also risks his movie with a few bold steps. In the end, he's not only holding an unbroken band, but he makes the audience appreciate the lengths he went to direct such a fine feature.
There's no doubt about it: the film that Johnson has crafted is rich. He chooses for his setting the quaint town of Gravestown, Maine - leaves turn bright orange in the fall, the grass is a lush green, pure white snow falls in the winter, and the sky goes on forever. The characters continue that turn: our two leads are Simon Birch (Ian Michael Smith) and Joe Wenteworth (Joseph Mazzello). Simon is the smallest baby ever born within the records of the local hospital, and by age twelve he's only two feet tall.  Naturally, the two outcasts become good friends and share many adventures together, from disrupting Sunday school to doing community service to playing Little League baseball.
In a wonderfully executed performance by Ian Michael Smith, Simon Birch is convinced that he's God's instrument, and there must be a reason he's so small. Joe doesn't quite buy it, but he sticks by Simon; the two tough it out through the worst of times and are each other's only true friends. Early on, the two meet up with Ben Goodrich (Oliver Platt), Rebecca's new boyfriend, and although the bond isn't immediate, Ben and the two boys develop a liking for each other. Both Platt and Judd give solid performances that lend their characters a deep likeability. The audience cares about them as much as they do about Joe and Simon, a testament to the acting jobs of both. Finally, Jim Carrey gives a cameo as the adult Joe in the present day, and his few minutes here are relatively more impressive than his entire performance in THE TRUMAN SHOW.
Mark Steven Johnson's sense of drama and writing is fantastic. The script is loosely based on John Irving's novel, A PRAYER FOR OWEN MEANY, but it's so far off the source material that Irving actually requested the credits be changed from 'based on' to 'suggested by.' Along those same lines, it's almost unfitting to compare the two; Johnson uses tension, humor, atmosphere, and suspense to create an original drama of Forrest Gumpian proportions. By no means has he developed a project of similar popularity - GUMP made over 300 million dollars while BIRCH ought to pass out of sight in a few weeks - but the winning idea remains the same. SIMON BIRCH is a different look at a different life, and one that will most likely be studied in film school classes in decades to come. In the present, however, it's an enjoyable little picture that everyone ought to take a look at.
-- Craig Roush<EMAIL_ADDRESS>-- Kinnopio's Movie Reviews http://www.execpc.com/~kinnopio
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


 The title is exactly the obverse of what it should be.
  Jon Voight in a general's outfit, too, but the movie is inept on so many levels that I was snickering at the sight of him by the twenty-minute mark.
The movie makes its foolishness plain right away. Sgt. James Dunn (Wayans), court-martialed for a bit of Gulf War righteousness that would not have even made it to court-martial in any other movie, is sentenced to die. He's yanked off death row at the behest of Lt. Col. Grant Casey (Voight), who wants to assemble a top-secret special ops squad. Since Dunn is legally dead, he makes a perfect candidate. Unfortunately, the first mission he's on turns out to be a covert assassination of the First Lady, and he's framed for the murder. However, there's a videotape of the whole thing, and so off he goes after it. All of this is over- and under-scored by a conspiracy plot that's both implausible and painfully convoluted. We also get yet another confirmation of the character-economy law -- the one person who just seems to be standing around with his thumb in his ear, isn't.
I shy at having to discuss a film this painfully bad in detail, but I'll try. Let's see. Among the ridiculous scenes: a moment where Dunn confronts the woman with the tape, then moves closer to her, murmuring, "Man, I haven't had a piece of *that* in years..." and then reaches for a pizza box behind her. Groan, groan. Even worse is a chase scene -- is that the right word? -- where everyone and his brother recognizes Dunn on the street and starts following him (much to the dismay of traffic all across the city). I wondered if we were looking at an outtake from IT'S A MAD, MAD, MAD, MAD WORLD.
There is *one* good thing in the movie. Exactly one -- no more, no less. It is Paul Sorvino's performance as a CIA man (although they give him an opening scene where he's feeding the ducks, and they have him mouth dialogue that's an utter embarrasement to an actor as good as him). Sorvino has a scene which so far outshines the rest of the movie, in fact, they could have built a whole new story around it. It turns out one of his men is a traitor, and when he learns this, he gives the man a talking-to that has real truth in it, and which almost makes the movie worth sticking it out for to hear. Almost.
<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Lindsey Pelas’ Cleavage Is Hard To Ignore In Curve-Hugging Blue Dress
November 16, 2019
Lindsey Pelas’ Cleavage Is Hard To Ignore In Curve-Hugging Blue Dress
Lindsey Pelas likely sent several hearts aflutter when she posted a photo of herself on Instagram in which she’s rocking a curve-hugging blue dress. The slinky belted dress features a large keyhole neckline that gives her 9 million followers a great view of her cleavage. It’s made all the more alluring by Lindsey’s seductive pose.
The model, who describes herself as “genetically gifted,” accessorized her look with simple gold earrings and accentuated her natural beauty with a soft, glamorous makeup look. She also wore her golden hair straight and it falls to her waist.
“Whole lotta woman,” she wrote in the caption.
Lindsey also revealed that the dress is by a fashion brand from Australia called Love Nookie. She didn’t reveal the name of the design, however.
The photo has accumulated close to 50,000 likes and over 670 comments in an hour. In those comments, fans marveled at Lindsey’s physically attractiveness.
Some of those comments came from fellow models.
“Whole lot of beauty,” wrote Dolly Castro, a Nicaraguan bombshell with 6.2 million followers on Instagram.
Her non-famous fans chimed in as well.
“Definitely more than a handful,” one fan wrote.
Although Lindsey’s other physical features are dominating the photo, one admirer focused on her eyes.
“Magnificent in blue,” another fan added. “Makes your eyes really pop!”
One commenter got very effusive in their praise and appeared to be baring their soul to her.
“A whole lot of southern goddess,” they wrote. “Most gorgeous woman gods ever created from all the natural beauty to those amazing eyes. Wife goals. I’d marry you in a heartbeat Lindsey P.”
Loading...
But a lot of her followers shared more generic expressions of admiration for her beauty.
“You look absolutely fabulous and gorgeous,” a fourth fan wrote.
Lindsey is likely used to getting this type of attention thanks to the stunning posts she shares on Instagram. As The Inquisitr noted, she got similarly enthusiastic comments when she posted a photo of herself late last month.
She’s dressed more casually than in the most recent photo on her page. In this previous photo, she’s braless and wearing a tiny white crop top that, short enough to reveal a sliver of her underboob. She paired the top with a pair of distressed blue jeans and isn’t wearing any makeup or jewelry,
In the caption, Lindsey revealed that the jeans were from Fashion Nova. The photo currently has more than 200,000 likes and over 2,5000 people have commented on the photo.


[gecode-users] Pruning filtered branchers.
Christian Schulte
cschulte at kth.se
Thu Nov 7 15:01:06 CET 2013
Hi,
This is indeed the desired behavior but I think this requires some better
explanation in MPG...
I do not know a better way around this, sorry.
Best
Christian
--
Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Duane Leslie
Sent: Thursday, November 07, 2013 5:12 AM
To: users at gecode.org
Subject: [gecode-users] Pruning filtered branchers.
I'm not sure if this is a feature or a bug, but I have a problem where I am
using the first brancher to implement iterative deepening with RBS.
I use a heuristic with the first brancher disable via the filter function to
determine a 'reasonably good' solution to use for BAB pruning, and then once
the bound has been determined I switch the brancher on to activate IDA.
I have found that if the filter function returns false the first time it is
called it is never called again, so I have had to implement an initial
harmless dummy action so that it looks like it has work to do. I am
assuming this is an optimisation that is pruning away the brancher because
it assumes it will never have work to do if it has none initially, but is
this the desired behaviour and if so is there a better way to get around it
than having a dummy action?
Regards,
Duane.
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list