Tumgik
#when i was like ''i wonder what this huge amount of timestamped data would look like in a calendar''
tafadhali · 1 year
Text
Truly astonishing to me that Google Calendar still doesn’t have a batch delete feature
1 note · View note
Quote
My Context I've never used DynamoDB in production, so I am not qualified to assess technical merit - there are other experts to do that. I write in order to share my experience of the book as a DynamoDB beginner. I'm not new to NoSQL - I've actually spent more time with Fauna, Firebase and MongoDB than I have Postgres, MySQL and SQLite - but NoSQL kind of follows a perversion of the Anna Karenina principle "All SQL DBs are alike; each NoSQL DB is NoSQL in its own way." My interest is personal though - my next job will use DynamoDB extensively, and in any case I expect that knowing foundational AWS services will be relevant for the rest of my life, and therefore a very good use of time. Structure This 450 page book has 22 chapters. There's no explicit grouping of them but here are my unofficial groupings: Chapters 1-6 (~120 pages): Explaining DynamoDB Concepts, APIs, and Expressions Related writing (not part of the book but representative) - DynamoDB Transactions: Use Cases and Examples, DynamoDBGuide.com Chapters 7-9 (~50 pages): Advice for DynamoDB Data Modeling/Implementation You can sample Ch. 8 - The What, Why, and When of Single-Table Design with DynamoDB Chapters 10-16 (~90 pages): Strategies for one-to-many, many-to-many, filtering, sorting, migrations, and others You can sample Ch. 11 - Strategies for oneto-many relationships Chapters 17-22 (~150 pages): 5 increasingly complex Data Modeling Examples - modeling a Session Store, Ecommerce App, a CMS backed Deals app, GitHub's backend and Migrations for the GitHub backend I write these details down to emphasize the ridiculous amount of thought put into this book. A lesser book would stop at Chapter 9 - mostly explaining factual statements in a more accessible way than the official docs, and then ending with some advice. But, in fact, the majority of the book comes in Chapters 10-22 - chock full of hard won advice, and worked examples for you to apply what you just learned, designed to prepare you for every real world scenario. This truly goes above and beyond, and turns the book from a read-once-and-discard deal into a reusable reference tome you will consult for the entirety of your DynamoDB usage. 5 Things I Learned There's way too much to write down, but I figured I should force myself to make some notes to process in public for myself and others. 1. Why Generic PK and SK names DynamoDB is marketed as a "key value store". The keys are split into Partition Keys (PK) and Sort Keys (SK) which helps DynamoDB scale behind the scenes, but also opens up some query patterns that let you do a lot more than simple key value lookup. Because of the benefits of Single Table Design, we overload the meaning of PKs and SKs to accommodate multiple domain objects, and use {TYPE}#{ID} conventions within the key rather than designate a fixed type to each key. An SK can consist of both ORG#ORGNAME and USER#USERNAME in the same item collection. This lets you query both in a single query. If this makes you queasy, I have't fully made peace with it too. It's basically the developer contorting themselves to fit the abstraction leak of DynamoDB. I rationalize it by basically regarding DynamoDB as a low level tool - it is closer to a linear memory address register than a DB. Think about it - DynamoDB promises single digit millisecond latency, but in exchange you have to be hyperaware which address you are slotting your data in and manage it carefully. That's just like dealing with low level memory! With a low level tool, you understand that you need to manage more of its details, but in exchange it gives you more performance than anything else possible. This is backed up by Alex quoting Forrest Brazeal: A well-optimized single-table DynamoDB layout looks more like machine code than a simple spreadsheet. You could build a DB layer atop DynamoDB that abstracts away these PK/SK shenanigans, but you do run the risk of making very inefficient queries because you have no control/knowledge over the data modeling. Maybe you care, maybe you don't (maybe you're no worse off from the inefficient queries made in SQL). There's a whole section called "Don't use an ORM" in the book, though Jeremy Daly's DynamoDB Toolbox and AWS' Document Client are OK. But it is clear that for stable data access patterns (eg you intend to run Amazon.com until the heat death of the universe), taking over low level PK/SK modeling details for DynamoDB will yield best possible results. 2. Why Global Secondary Indexes There are two types of Secondary Indexes in DynamoDB - Local and Global (aka LSI and GSI). LSIs can use the same PKs as the main table, but a different SK, whereas GSIs can use any attributes for both PK and SK. LSI GSI Pros Option for strongly-consistent reads PK flexibility, Creation time flexibility. Cons Must use same PK as table. Must be created when table is created. Eventual consistency. Needs additional throughput provisioning Given the importance of flexibility over strong consistency, it's clear why GSIs are so much more popular than LSIs. I don't have any numbers but vaguely also recall seeing on the Twitterverse that GSI replication delays are very rarely a problem. I wonder if AWS publishes p99 GSI replication numbers. 3. KSUIDs for Unique, Sortable IDs K-Sortable Unique Identifiers (KSUIDs) are a modification of the UUID standard by the fine folks at Segment that encodes a timestamp while also retaining chronological ordering when sorting as a string. Here's a UUIDv4: 96fb6bdc-7507-4879-997f-8978e0ba0e68 Here's a KSUID: 1YnlHOfSSk3DhX4BR6lMAceAo1V The benefit of using a KSUID compared to a UUID is that KSUIDs are lexicographically sortable. KSUIDs embed a timestamp, which you can decode and sort if you have a ksuid implementation handy - but also if you simply sort by the generated ID's they will sort themselves out chronologically (without any knowledge of how to decode KSUIDs!). This feature makes KSUIDs ideal as unique identifiers for DynamoDB keys, where you can use a condition expression like #id BETWEEN :start and :end where :start and :end represent starting and ending ID's of a range you want to query. I don't know how widely KSUIDs are known given this idea was only released in 2017, but I think this is useful even beyond DynamoDB. 4. Sparse Indexes for Filtering A sparse (secondary) index intentionally excludes certain items from your table to help satisfy a query (aka not merely as a result of PK/SK overloading). When you write an item, DynamoDB only copies it to the secondary index if the item has elements of the specified key schema for that index. This is useful in two ways: Using sparse indexes to provide a global filter on an item type Example: You have a list of Organizations (PK), each Organization has Members (SK), a few Members are Admins (role represented attributes). You want to query for Admins, without pulling ALL members of every organization. Setting up a sparse index that only includes Admins then lets you quickly and efficiently query them. Using sparse indexes to project a single type of entity Example: You have customers, orders, and inventory linearly laid out in PK/SKs in a single table. You want to query for all customers only. Setting up a sparse index that only includes customers helps you do that. I think you can regard this as a "filter" or "groupby" or "projection", depending on your functional/excel/linear/relational algebra preferences :) 5. Normalization is OK You'd think that Normalization is anathema in NoSQL, but it is actually recommended as one of the many-to-many strategies in the book! The given example is Twitter - a user follows other users, and other users follow yet more users. A social network. Every tweet or change in profile would cause a huge fan-out, aka "write thrashing". The recommended solution is storing User as PK, and then the SK has both User (again) and FOLLOWING#. When one user wants to view users they follow, we: use the Query API to fetch the User's info and initial few users they follow use the BatchGetItem API to fetch detailed User info for each user followed. This is making multiple requests, but there is no way around it. This pattern is also applicable in ecommerce shopping carts. Conclusion I mean. The premium package costs $249 ($199 for launch) for now. If you were to hire Alex to even do a consultation phone call or mentorship workshop for you you'd need at least 10x that. If you use or will use DynamoDB in any serious way, you would save a ton of time and pain and money by going through this book.
http://damianfallon.blogspot.com/2020/04/5-things-i-learned-from-dynamodb-book.html
0 notes
mrwilliamcharley · 6 years
Text
Everything HR Needs to Know About Blockchain
One of the somewhat newer technology-related topics to surface is blockchain. When it first came out, I must admit that I didn’t see it having much of an HR component. So, I started paying attention…but at a distance. Well, I was wrong.
The Society for Human Resource Management (SHRM) has written a few articles about the topic including “Is HR Ready for Blockchain?” and “Blockchain Could Phase Out Employment Screening”. It really made me take notice and realize that I need to learn more about what blockchain technology can do for HR and business.
To help us demystify blockchain, I spoke with Jessica Griffin, vice president of global product management for Workforce Ready at Kronos Incorporated. Jessica and I had the chance to talk during SHRM’s annual conference in Chicago. I’m grateful that she was willing to share her expertise with us.
Jessica, let’s start with a definition. What’s blockchain?
[Griffin] A blockchain is a distributed public digital ledger used to track records. For anyone learning about blockchain for the first time, there is a lot to unpack in that explanation, but I promise it’s not as confusing as it may seem. For starters, a block is simply another word for record, and a blockchain is simply a chain of records. What makes blockchain unique from other recordkeeping systems is that it is distributed, which is another way of saying the chain of records is stored across a large network of independent computers.
This distributed approach is what sets blockchain apart because it provides a new level of accuracy, security, and privacy. A blockchain contains every version of a record since it was created – which makes tracking changes over time and auditing incredibly simple. To alter one block would require altering all of the blocks to avoid detection. Because the blockchain is spread across a large network as opposed to a single database, this becomes an extremely challenging proposition, especially because every block is encrypted with a unique key that only the owner of that block knows.
From your definition, it sounds like blockchain has been around for a while. I wonder why we’re just hearing about it.
[Griffin] The idea of a blockchain was first theorized in the early 1990s as a manner to ensure document timestamps could not be altered. However, the first blockchain wasn’t put into practice until nearly 15 years later, in 2008, with the launch of the cryptocurrency Bitcoin. This is likely the context in which most people familiar with blockchain have heard about it. While the financial industry was the first to begin exploring blockchain applications, other industries, such as human resources, are not far behind.
Bitcoin, which runs on blockchain technology to securely track all Bitcoin transactions, burst into the public consciousness this year when its value skyrocketed to over $10,000 per coin. Since then, Bitcoin’s value has come back to earth, but the excitement around blockchain as a new technology remains high. While tracking financial transactions is one obvious application for blockchain, there are actually a host of HR applications across the human capital management lifecycle.
Why are businesses so focused on it right now? Is it simply “all about the bitcoins”?
[Griffin] It’s safe to say that blockchain is rapidly racing up the hype-cycle curve and for good reason. Given all the news lately about personal data being misplaced, stolen, or used without permission, businesses are looking for innovative ways to ensure that employee and customer data is kept safe, and that their own intellectual property is being handled securely. They also want a tool which allows employees and customers to take more control over that data.
It’s still early on, but blockchain has the potential to achieve this. Bitcoin runs on a blockchain which is public and spread across many computers, some secure and others likely unsecure. Enterprises are now investigating the benefits of private blockchains. A private blockchain leverages the same distributed architecture to keep track of blocks, but instead of running publicly, it runs privately on a network where all of the computers are known and proven secure.
How does blockchain impact human resources?
[Griffin] There are a number of examples where HR departments can utilize blockchain to improve the efficiency of their activities and processes. Applicant and employee verifications are one area that is seeing the most traction right now. Hiring and onboarding is a vital but tedious portion of the employee lifecycle for both the recruiter and the candidate, but blockchain can significantly streamline it.
At its core, blockchain provides a platform for companies and institutions to work together more efficiently. A lot of organizations have made tremendous strides in getting the paper out and moving to a digital system, but now there is a huge amount of file transfer-based sharing of information.
For instance, imagine streamlining benefits administration and carrier connections. This is one of the most time-consuming and error-prone activities for HR teams. A blockchain approach would dramatically streamline this process and others like it that involve third party partners, especially when you inherently trust the underlying technology will increase each transaction’s security, efficiency, and transparency. 
I understand that security is one of the big advantages of blockchain. So, I could see it being adopted for functions like you’ve mentioned – payroll, background checks, and other sensitive areas (like health records).
[Griffin] Imagine a digital token for each candidate or employee. That digital token stores their complete professional data set, including employment information, personal information, financial background – all of the data that today is spread across their resume, reference, and background checks. The applicant or employee could easily use digital keys to release various pieces of the data set in order to complete an application or validate a background check.
At the other end of the human capital management (HCM) lifecycle, payroll and tax can also benefit from blockchain. Payroll, despite all its complexities, is relatively straightforward when your employees live in one area and all have bank accounts with trusted institutions. It gets a lot more challenging when the organization needs to make cross-border payments to a global workforce, or if an hourly worker lives in a rural location that is underserved by banks and credit unions.
In those cases, organizations can securely transmit payroll information through a blockchain network, enabling institutions outside of those you typically interact with to securely access the information and distribute payment to those employees.
Last question, what do you see as Blockchain trends we should start paying attention to now?
[Griffin] For those who are interested in new ways for blockchain to influence HR technology and processes, they should start by keeping an eye on what is happening with blockchain outside of HR.
New technologies, like blockchain, almost always hit existing value chains first. For example, financial records and legal contracts are one area where blockchain’s promise is already being explored with depth. For this reason, I’d suspect employee contracts and records may be the first data to move into the blockchain. It’s arguable that these solutions have the greatest potential for growth as their associated benefits are likely to far outweigh their cost of adoption.
Disruption has been the name of the game in the HR technology landscape recently and that is going to continue. Organizations should exchange in frank discussions with their vendors about how they are using not just blockchain, but all emerging technologies, including artificial intelligence, machine learning, and responsive design, to deliver the more possible efficiency and the best possible employee experience.
A huge thanks to Jessica and our friends at Kronos for sharing their thoughts and expertise. If you want to do as Jessica suggested and stay on top of the latest trends in HCM, be sure to check out the Kronos blogs including The Workforce Institute and What Works blogs.
I’m sure you realize, just like I did after speaking with Jessica, that we’ve only just scratched the surface of blockchain technology and the value it can bring to HR and business. But there’s some very interesting potential for the HR function. I could see blockchain not simply making our work easier and more efficient but keeping employee data more secure. And that’s a business priority.
Image captured by Sharlyn Lauby while exploring after the HR Technology Conference in Las Vegas, NV
The post Everything HR Needs to Know About Blockchain appeared first on hr bartender.
from hr bartender https://ift.tt/2CBWo3X
0 notes